Route outbound connections from local network through VPN

Posted by Sharkos on Server Fault See other posts from Server Fault or by Sharkos
Published on 2012-09-30T12:52:11Z Indexed on 2012/09/30 15:39 UTC
Read the original article Hit count: 168

Filed under:
|
|
|
|

I have a server A running OpenVPN, an OpenVPN client B (a rooted Android phone as it happens) and a third party C (a laptop, tablet etc.) tethered to B.

B can use the VPN to access the internet via A; C can use the tethered connection WITHOUT the VPN to access the internet via B.

However, with the VPN on B active, I cannot load information from the internet on C.

A appears to log similar traffic inbound and outbound when B or C attempt to load a webpage, say, but the VPN on device B reports no inbound traffic when the connection originated from C.

Where should I look for packets being dropped, and what ip rules should I use to make sure they are passed back through the VPN and into the local network B <-> C?

(I'll obviously post whatever further information is needed.)

Further info

Without VPN:

root@android:/ # ip route
default via [B's External Gateway] dev rmnet0
[B's External Subnet] dev rmnet0  proto kernel  scope link  src [B's External IP]
[B's External Gateway] dev rmnet0  scope link
192.168.43.0/24 dev wlan0  proto kernel  scope link  src 192.168.43.1

With VPN:

root@android:/ # ip route
0.0.0.0/1 dev tun0  scope link
default via [B's External Gateway] dev rmnet0
[B's External Subnet] dev rmnet0  proto kernel  scope link  src [B's External IP]
[B's External Gateway] dev rmnet0  scope link
[External address of A] dev tun0  scope link
128.0.0.0/1 dev tun0  scope link
172.16.0.0/24 dev tun0  scope link
172.16.0.8/30 dev tun0  proto kernel  scope link  src 172.16.0.10
192.168.43.0/24 dev wlan0  proto kernel  scope link  src 192.168.43.1
192.168.168.0/24 dev tun0  scope link

© Server Fault or respective owner

Related posts about networking

Related posts about vpn