Hi everyone,
I have a problem with the routing of my OpenVPN client, running on a router in my LAN, connecting to a remote OpenVPN server.
First, here's my setup:
Internet -> DSL Modem/Router (192.168.1.1) -> MRT150N VPN-Router (192.168.1.4) -> FON Wifi-Router (192.168.1.3)
All 3 routers are in the same subnet of 192.168.1.0/24.
The DSL-Modem has no DHCP-Server, so the VPN-Router has a static IP (192.168.1.4) with 192.168.1.1 as gateway and static Google public DNS-servers (8.8.8.8 / 8.8.4.4).
The FON-Router runs in bridge-mode and has a static IP (192.168.1.3) with 192.168.1.4 as gateway and a DHCP-Server (192.168.1.30-60) for the Wifi clients.
So far, so good. Everything runs well when the VPN-Router has no server or client running, so the traffic gets just handed to the regular gateway and the route is simply:
mrt150n# iproute
192.168.1.0/24 dev vlan0 src 192.168.1.4
default via 192.168.1.1 dev vlan0
Now I'm starting the OpenVPN client on the router, which is supposed to route all traffic through the VPN-tunnel (on this device the tun1 interface).
First, all goes well. The client connects to the OpenVPN server, redirects the gateway and gets a remote IP-address (see syslog extracts):
user.notice openvpnclient[3325]: UDPv4 link remote: 37.221.175.42:9081
user.notice openvpnclient[3325]: TLS: Initial packet from 37.221.175.42:9081, sid=9e6a943f bb3ca9aa
user.notice openvpnclient[3325]: /bin/ip addr add dev tun1 local 10.129.24.134 peer 10.129.24.133
user.notice openvpnclient[3325]: /etc/openvpn.d/client-up tun1 1242 1300 10.129.24.134 10.129.24.133 init
user.info client-up[3380]: Local IP address: 10.129.24.134
user.info client-up[3380]: Remote IP address: 10.129.24.133
So the routing table is now:
mrt150n# iproute
10.129.24.133 dev tun1 src 10.129.24.134
37.221.175.42 via 192.168.1.1 dev vlan0
10.129.0.1 via 10.129.24.133 dev tun1
192.168.1.0/24 dev vlan0 src 192.168.1.4
0.0.0.0/1 via 10.129.24.133 dev tun1
128.0.0.0/1 via 10.129.24.133 dev tun1
default via 192.168.1.1 dev vlan0
The problem is now that this routing is somehow wrong or I'm missing some NAT or forwarding rule, because I can't connect to anything outside the local LAN, except the remote OpenVPN server. Plus, I can ping the remote OpenVPN server (37.221.175.42), but all traffic goes through vlan0, not tun1. And I can't ping anything outside of the local LAN, like
http://www.google.com or 8.8.8.8.
Any help would be greatly appreciated, since I'm pretty stuck here. I tried all sorts of things, even switch from TUN to TAP, thinking a bridge would be easier, but reading about it showed that it is in fact not. I just seem to overlook something very obvious here as far as the routing / NAT / forwarding goes.
Thanks,
Martin.