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 1
1
# Changelog
2
2
3
+ ### 1.0.4 - IPv6 docs, improved wizards
4
+
5
+ - Added instructions for IPv6 configuration
6
+ - Added outside interface option to setup wizards
3
7
### 1.0.3 - New examples, fixes, more docs
4
8
5
9
- Updated instructions
Original file line number Diff line number Diff line change @@ -60,15 +60,8 @@ services:
60
60
- net.ipv6.conf.all.disable_ipv6=0
61
61
- net.ipv6.conf.default.forwarding=1
62
62
- 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
+
72
65
```
73
66
74
67
## Parameters
@@ -114,13 +107,15 @@ If you are new to containers please see rather [Detailed first setup guide](docs
114
107
115
108
``` bash
116
109
ovpn_enconf basic_nat
110
+ # Out interface [eth0]: <interface connected to the Internet>
117
111
# Protocol udp, tcp, udp6, tcp6 [udp]:
118
112
# VPN network [10.0.0.0]:
119
113
# Port [1194]:
120
114
# Public IP or domain of server: <YOUR PUBLIC IP>
121
115
# DNS1 [8.8.8.8]:
122
116
# DNS2 [8.8.4.4]:
123
117
```
118
+
124
119
4 . Enable ** port forwarding** on your router so OpenVPN server will be accessible from the internet.
125
120
5 . Add clients
126
121
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
95
95
96
96
``` bash
97
97
ovpn_enconf basic_nat
98
+ # Out interface [eth0]: <interface connected to the Internet>
98
99
# Protocol udp, tcp, udp6, tcp6 [udp]:
99
100
# VPN network [10.0.0.0]:
100
101
# Port [1194]:
Original file line number Diff line number Diff line change 8
8
ovpn-iptables -D INPUT -p udp -m udp --dport $PORT -j ACCEPT -m comment --comment " Open OpenVPN port"
9
9
10
10
# 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"
14
14
15
15
# 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"
18
18
19
19
# 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"
21
21
Original file line number Diff line number Diff line change 8
8
ovpn-iptables -A INPUT -p udp -m udp --dport $PORT -j ACCEPT -m comment --comment " Open OpenVPN port"
9
9
10
10
# 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"
14
14
15
15
# 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"
18
18
19
19
# 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"
21
21
Original file line number Diff line number Diff line change @@ -29,6 +29,11 @@ if not os.path.isdir(TEMP_PATH):
29
29
print ("Specified directory does not exist" )
30
30
sys .exit (2 )
31
31
32
+ # Select output interface
33
+ out_int = input ("Out interface [eth0]:" )
34
+ if len (out_int ) == 0 :
35
+ out_int = "eth0"
36
+
32
37
# Select protocol
33
38
protocol = input ("Protocol udp, tcp, udp6, tcp6 [udp]:" )
34
39
AVAILABLE_PROTOCOLS = ["udp" , "tcp" , "udp6" , "tcp6" ]
@@ -65,6 +70,7 @@ if len(dns2) == 0:
65
70
66
71
# Write to server config
67
72
vars = [
73
+ ("$OUT_INT" , out_int ),
68
74
("$PROTO" , protocol ),
69
75
("$PORT" , port ),
70
76
("$NETWORK_ADDRESS" , network ),
Original file line number Diff line number Diff line change 8
8
ovpn-iptables -D INPUT -p udp -m udp --dport $PORT -j ACCEPT -m comment --comment " Open OpenVPN port"
9
9
10
10
# 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"
13
13
14
14
# 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"
16
16
Original file line number Diff line number Diff line change 8
8
ovpn-iptables -A INPUT -p udp -m udp --dport $PORT -j ACCEPT -m comment --comment " Open OpenVPN port"
9
9
10
10
# 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"
13
13
14
14
# 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"
16
16
Original file line number Diff line number Diff line change @@ -29,6 +29,11 @@ if not os.path.isdir(TEMP_PATH):
29
29
print ("Specified directory does not exist" )
30
30
sys .exit (2 )
31
31
32
+ # Select output interface
33
+ out_int = input ("Out interface [eth0]:" )
34
+ if len (out_int ) == 0 :
35
+ out_int = "eth0"
36
+
32
37
# Select protocol
33
38
protocol = input ("Protocol udp, tcp, udp6, tcp6 [udp]:" )
34
39
AVAILABLE_PROTOCOLS = ["udp" , "tcp" , "udp6" , "tcp6" ]
@@ -65,6 +70,7 @@ if len(dns2) == 0:
65
70
66
71
# Write to server config
67
72
vars = [
73
+ ("$OUT_INT" , out_int ),
68
74
("$PROTO" , protocol ),
69
75
("$PORT" , port ),
70
76
("$NETWORK_ADDRESS" , network ),
Original file line number Diff line number Diff line change 8
8
ovpn-iptables -D INPUT -p udp -m udp --dport $PORT -j ACCEPT -m comment --comment " Open OpenVPN port"
9
9
10
10
# 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"
13
13
You can’t perform that action at this time.
0 commit comments