File tree Expand file tree Collapse file tree 12 files changed +49
-31
lines changed
root/defaults/example/config Expand file tree Collapse file tree 12 files changed +49
-31
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ### 1.0.4 - IPv6 docs, improved wizards
4+
5+ - Added instructions for IPv6 configuration
6+ - Added outside interface option to setup wizards
37### 1.0.3 - New examples, fixes, more docs
48
59- Updated instructions
Original file line number Diff line number Diff line change @@ -60,15 +60,8 @@ services:
6060 - net.ipv6.conf.all.disable_ipv6=0
6161 - net.ipv6.conf.default.forwarding=1
6262 - net.ipv6.conf.all.forwarding=1
63- networks :
64- mynetwork :
65- ipv4_address : 10.0.0.5
66- ipv6_address : 2001:1111::5
67-
68- networks :
69- mynetwork :
70- driver : host
71- enable_ipv6 : true
63+ network_mode : host
64+
7265```
7366
7467## Parameters
@@ -114,13 +107,15 @@ If you are new to containers please see rather [Detailed first setup guide](docs
114107
115108 ``` bash
116109 ovpn_enconf basic_nat
110+ # Out interface [eth0]: <interface connected to the Internet>
117111 # Protocol udp, tcp, udp6, tcp6 [udp]:
118112 # VPN network [10.0.0.0]:
119113 # Port [1194]:
120114 # Public IP or domain of server: <YOUR PUBLIC IP>
121115 # DNS1 [8.8.8.8]:
122116 # DNS2 [8.8.4.4]:
123117 ```
118+
1241194 . Enable ** port forwarding** on your router so OpenVPN server will be accessible from the internet.
1251205 . Add clients
126121
Original file line number Diff line number Diff line change @@ -95,6 +95,7 @@ This is simple setup guide to help you get started. It uses the simplest configu
9595
9696 ``` bash
9797 ovpn_enconf basic_nat
98+ # Out interface [eth0]: <interface connected to the Internet>
9899 # Protocol udp, tcp, udp6, tcp6 [udp]:
99100 # VPN network [10.0.0.0]:
100101 # Port [1194]:
Original file line number Diff line number Diff line change 88ovpn-iptables -D INPUT -p udp -m udp --dport $PORT -j ACCEPT -m comment --comment " Open OpenVPN port"
99
1010# Disable LAN protection of VPN
11- ovpn-iptables -D FORWARD -i tun0 -s $NETWORK_ADDRESS /24 -o eth0 -d 10.0.0.0/8 -j REJECT -m comment --comment " Drop traffic VPN --> LANs"
12- ovpn-iptables -D FORWARD -i tun0 -s $NETWORK_ADDRESS /24 -o eth0 -d 192.168.0.0/16 -j REJECT -m comment --comment " Drop traffic VPN --> LANs"
13- ovpn-iptables -D FORWARD -i tun0 -s $NETWORK_ADDRESS /24 -o eth0 -d 172.16.0.0/12 -j REJECT -m comment --comment " Drop traffic VPN --> LANs"
11+ ovpn-iptables -D FORWARD -i tun0 -s $NETWORK_ADDRESS /24 -o $OUT_INT -d 10.0.0.0/8 -j REJECT -m comment --comment " Drop traffic VPN --> LANs"
12+ ovpn-iptables -D FORWARD -i tun0 -s $NETWORK_ADDRESS /24 -o $OUT_INT -d 192.168.0.0/16 -j REJECT -m comment --comment " Drop traffic VPN --> LANs"
13+ ovpn-iptables -D FORWARD -i tun0 -s $NETWORK_ADDRESS /24 -o $OUT_INT -d 172.16.0.0/12 -j REJECT -m comment --comment " Drop traffic VPN --> LANs"
1414
1515# Disable Routing Internet <--> VPN network
16- ovpn-iptables -D FORWARD -i tun0 -s $NETWORK_ADDRESS /24 -o eth0 -j ACCEPT -m comment --comment " Allow traffic VPN --> Internet"
17- ovpn-iptables -D FORWARD -i eth0 -d $NETWORK_ADDRESS /24 -o tun0 -j ACCEPT -m comment --comment " Allow traffic Internet --> VPN"
16+ ovpn-iptables -D FORWARD -i tun0 -s $NETWORK_ADDRESS /24 -o $OUT_INT -j ACCEPT -m comment --comment " Allow traffic VPN --> Internet"
17+ ovpn-iptables -D FORWARD -i $OUT_INT -d $NETWORK_ADDRESS /24 -o tun0 -j ACCEPT -m comment --comment " Allow traffic Internet --> VPN"
1818
1919# Disable NAT for VPN traffic
20- ovpn-iptables -t nat -D POSTROUTING -s $NETWORK_ADDRESS /24 -o eth0 -j MASQUERADE -m comment --comment " NAT traffic VPN --> Internet"
20+ ovpn-iptables -t nat -D POSTROUTING -s $NETWORK_ADDRESS /24 -o $OUT_INT -j MASQUERADE -m comment --comment " NAT traffic VPN --> Internet"
2121
Original file line number Diff line number Diff line change 88ovpn-iptables -A INPUT -p udp -m udp --dport $PORT -j ACCEPT -m comment --comment " Open OpenVPN port"
99
1010# Protect LANs after VPN
11- ovpn-iptables -A FORWARD -i tun0 -s $NETWORK_ADDRESS /24 -o eth0 -d 10.0.0.0/8 -j REJECT -m comment --comment " Drop traffic VPN --> LANs"
12- ovpn-iptables -A FORWARD -i tun0 -s $NETWORK_ADDRESS /24 -o eth0 -d 192.168.0.0/16 -j REJECT -m comment --comment " Drop traffic VPN --> LANs"
13- ovpn-iptables -A FORWARD -i tun0 -s $NETWORK_ADDRESS /24 -o eth0 -d 172.16.0.0/12 -j REJECT -m comment --comment " Drop traffic VPN --> LANs"
11+ ovpn-iptables -A FORWARD -i tun0 -s $NETWORK_ADDRESS /24 -o $OUT_INT -d 10.0.0.0/8 -j REJECT -m comment --comment " Drop traffic VPN --> LANs"
12+ ovpn-iptables -A FORWARD -i tun0 -s $NETWORK_ADDRESS /24 -o $OUT_INT -d 192.168.0.0/16 -j REJECT -m comment --comment " Drop traffic VPN --> LANs"
13+ ovpn-iptables -A FORWARD -i tun0 -s $NETWORK_ADDRESS /24 -o $OUT_INT -d 172.16.0.0/12 -j REJECT -m comment --comment " Drop traffic VPN --> LANs"
1414
1515# Allow Routing Internet <--> VPN network
16- ovpn-iptables -A FORWARD -i tun0 -s $NETWORK_ADDRESS /24 -o eth0 -j ACCEPT -m comment --comment " Allow traffic VPN --> Internet"
17- ovpn-iptables -A FORWARD -i eth0 -d $NETWORK_ADDRESS /24 -o tun0 -j ACCEPT -m comment --comment " Allow traffic Internet --> VPN"
16+ ovpn-iptables -A FORWARD -i tun0 -s $NETWORK_ADDRESS /24 -o $OUT_INT -j ACCEPT -m comment --comment " Allow traffic VPN --> Internet"
17+ ovpn-iptables -A FORWARD -i $OUT_INT -d $NETWORK_ADDRESS /24 -o tun0 -j ACCEPT -m comment --comment " Allow traffic Internet --> VPN"
1818
1919# Preform NAT for VPN traffic
20- ovpn-iptables -t nat -A POSTROUTING -s $NETWORK_ADDRESS /24 -o eth0 -j MASQUERADE -m comment --comment " NAT traffic VPN --> Internet"
20+ ovpn-iptables -t nat -A POSTROUTING -s $NETWORK_ADDRESS /24 -o $OUT_INT -j MASQUERADE -m comment --comment " NAT traffic VPN --> Internet"
2121
Original file line number Diff line number Diff line change @@ -29,6 +29,11 @@ if not os.path.isdir(TEMP_PATH):
2929 print ("Specified directory does not exist" )
3030 sys .exit (2 )
3131
32+ # Select output interface
33+ out_int = input ("Out interface [eth0]:" )
34+ if len (out_int ) == 0 :
35+ out_int = "eth0"
36+
3237# Select protocol
3338protocol = input ("Protocol udp, tcp, udp6, tcp6 [udp]:" )
3439AVAILABLE_PROTOCOLS = ["udp" , "tcp" , "udp6" , "tcp6" ]
@@ -65,6 +70,7 @@ if len(dns2) == 0:
6570
6671# Write to server config
6772vars = [
73+ ("$OUT_INT" , out_int ),
6874 ("$PROTO" , protocol ),
6975 ("$PORT" , port ),
7076 ("$NETWORK_ADDRESS" , network ),
Original file line number Diff line number Diff line change 88ovpn-iptables -D INPUT -p udp -m udp --dport $PORT -j ACCEPT -m comment --comment " Open OpenVPN port"
99
1010# Disable Routing Internet <--> VPN network
11- ovpn-iptables -D FORWARD -i tun0 -s $NETWORK_ADDRESS /24 -o eth0 -j ACCEPT -m comment --comment " Allow traffic VPN --> Internet"
12- ovpn-iptables -D FORWARD -i eth0 -d $NETWORK_ADDRESS /24 -o tun0 -j ACCEPT -m comment --comment " Allow traffic Internet --> VPN"
11+ ovpn-iptables -D FORWARD -i tun0 -s $NETWORK_ADDRESS /24 -o $OUT_INT -j ACCEPT -m comment --comment " Allow traffic VPN --> Internet"
12+ ovpn-iptables -D FORWARD -i $OUT_INT -d $NETWORK_ADDRESS /24 -o tun0 -j ACCEPT -m comment --comment " Allow traffic Internet --> VPN"
1313
1414# Disable NAT for VPN traffic
15- ovpn-iptables -t nat -D POSTROUTING -s $NETWORK_ADDRESS /24 -o eth0 -j MASQUERADE -m comment --comment " NAT traffic VPN --> Internet"
15+ ovpn-iptables -t nat -D POSTROUTING -s $NETWORK_ADDRESS /24 -o $OUT_INT -j MASQUERADE -m comment --comment " NAT traffic VPN --> Internet"
1616
Original file line number Diff line number Diff line change 88ovpn-iptables -A INPUT -p udp -m udp --dport $PORT -j ACCEPT -m comment --comment " Open OpenVPN port"
99
1010# Allow Routing Internet <--> VPN network
11- ovpn-iptables -A FORWARD -i tun0 -s $NETWORK_ADDRESS /24 -o eth0 -j ACCEPT -m comment --comment " Allow traffic VPN --> Internet"
12- ovpn-iptables -A FORWARD -i eth0 -d $NETWORK_ADDRESS /24 -o tun0 -j ACCEPT -m comment --comment " Allow traffic Internet --> VPN"
11+ ovpn-iptables -A FORWARD -i tun0 -s $NETWORK_ADDRESS /24 -o $OUT_INT -j ACCEPT -m comment --comment " Allow traffic VPN --> Internet"
12+ ovpn-iptables -A FORWARD -i $OUT_INT -d $NETWORK_ADDRESS /24 -o tun0 -j ACCEPT -m comment --comment " Allow traffic Internet --> VPN"
1313
1414# Preform NAT for VPN traffic
15- ovpn-iptables -t nat -A POSTROUTING -s $NETWORK_ADDRESS /24 -o eth0 -j MASQUERADE -m comment --comment " NAT traffic VPN --> Internet"
15+ ovpn-iptables -t nat -A POSTROUTING -s $NETWORK_ADDRESS /24 -o $OUT_INT -j MASQUERADE -m comment --comment " NAT traffic VPN --> Internet"
1616
Original file line number Diff line number Diff line change @@ -29,6 +29,11 @@ if not os.path.isdir(TEMP_PATH):
2929 print ("Specified directory does not exist" )
3030 sys .exit (2 )
3131
32+ # Select output interface
33+ out_int = input ("Out interface [eth0]:" )
34+ if len (out_int ) == 0 :
35+ out_int = "eth0"
36+
3237# Select protocol
3338protocol = input ("Protocol udp, tcp, udp6, tcp6 [udp]:" )
3439AVAILABLE_PROTOCOLS = ["udp" , "tcp" , "udp6" , "tcp6" ]
@@ -65,6 +70,7 @@ if len(dns2) == 0:
6570
6671# Write to server config
6772vars = [
73+ ("$OUT_INT" , out_int ),
6874 ("$PROTO" , protocol ),
6975 ("$PORT" , port ),
7076 ("$NETWORK_ADDRESS" , network ),
Original file line number Diff line number Diff line change 88ovpn-iptables -D INPUT -p udp -m udp --dport $PORT -j ACCEPT -m comment --comment " Open OpenVPN port"
99
1010# Disable Routing Internet <--> VPN network
11- ovpn-iptables -D FORWARD -i tun0 -s $NETWORK_ADDRESS /24 -o eth0 -j ACCEPT -m comment --comment " Allow traffic VPN --> Internet"
12- ovpn-iptables -D FORWARD -i eth0 -d $NETWORK_ADDRESS /24 -o tun0 -j ACCEPT -m comment --comment " Allow traffic Internet --> VPN"
11+ ovpn-iptables -D FORWARD -i tun0 -s $NETWORK_ADDRESS /24 -o $OUT_INT -j ACCEPT -m comment --comment " Allow traffic VPN --> Internet"
12+ ovpn-iptables -D FORWARD -i $OUT_INT -d $NETWORK_ADDRESS /24 -o tun0 -j ACCEPT -m comment --comment " Allow traffic Internet --> VPN"
1313
You can’t perform that action at this time.
0 commit comments