Hello,
I'm trying set-up openvpn on a Asus RT N56U router. My goal is to connect over the internet to this router when I'm away to access may NAS and also the internet with my home IP address.
I can connect to the server, but don't have internet access. I googled a lot and "think" the problem might be with iptables. I have to say that I'm very unsure if this is correct what I do:
iptables -t nat -X POSTROUTING -s 10.8.0.0/24 -o eth3 -j MASQUERADE
where eth3 is the WAN port on which the router connects to the internet, connections is established via PPPoE.
server.conf looks as follows:
proto tcp-server
port 1194
dev tun1
topology subnet
server 10.8.0.0 255.255.255.0
client-config-dir ccd
push "route 192.168.1.0 255.255.255.0"
ca /etc/storage/openvpn/server/ca.crt
dh /etc/storage/openvpn/server/dh1024.pem
cert /etc/storage/openvpn/server/server.crt
key /etc/storage/openvpn/server/server.key
tls-auth /etc/storage/openvpn/server/ta.key 0
persist-key
persist-tun
user nobody
group nogroup
script-security 2
tmp-dir /tmp/openvpn
writepid /var/run/openvpn_svr.pid
client-connect ovpns.script
client-disconnect ovpns.script
### User params:
push "redirect-gateway local def1"
push "dhcp-option DNS 8.8.8.8"
client.conf:
client
dev tun
proto tcp
remote SERVER 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert client.crt
key client.key
tls-auth ta.key 1
cipher BF-CBC
comp-lzo
verb 3
redirect-gateway
output of iconfig on the router:
br0 Link encap:Ethernet HWaddr xx:04:xx:90:xx:2F
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:843640 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:372934368 (355.6 MiB)
eth2 Link encap:Ethernet HWaddr xx:04:xx:90:xx:2F
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:1934957 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:446153258 (425.4 MiB)
Interrupt:3
eth3 Link encap:Ethernet HWaddr xx:04:xx:90:xx:2E
inet addr:10.21.10.2 Bcast:10.21.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10927034 errors:0 dropped:378 overruns:0 frame:0
TX packets:9157005 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:7279417810 (6.7 GiB) TX bytes:7695391712 (7.1 GiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MULTICAST MTU:16436 Metric:1
RX packets:318 errors:0 dropped:0 overruns:0 frame:0
TX packets:318 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:60432 (59.0 KiB) TX bytes:60432 (59.0 KiB)
ppp0 Link encap:Point-to-Point Protocol
inet addr:xx.xx.xx.15 P-t-P:xx.xx.xx.65 Mask:255.255.255.255
UP POINTOPOINT RUNNING MULTICAST MTU:1492 Metric:1
RX packets:8898205 errors:0 dropped:0 overruns:0 frame:0
TX packets:8980256 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:2589212419 (2.4 GiB) TX bytes:3154734022 (2.9 GiB)
tun1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.8.0.1 P-t-P:10.8.0.1 Mask:255.255.255.0
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)