I have an OpenVPN client running on a DD-WRT router. The global set-up (server + client) is configured so all traffic from machines connected to the router goes through the VPN tunnel, and it works perfectly.
However, I'd like to override this default behaviour for one particular machine. Let's say my local network is defined as 192.168.10.0/24
. The router is located at 192.168.10.254
. The machine I want to route outside the VPN tunnel is located at 192.168.10.135
.
Following this Serverfault answer, or this OpenVPN thread, I added the directive
route 192.168.10.135 255.255.255.255 net_gateway
to the OpenVPN client config file.
However, even if I have the confirmation that this new rule has been successfully added by looking at the routing table of the router, this doesn't work. Not only the machine .135
now cannot connect to the internet, but it's not even able to connect to the LAN anymore (eg, a simple ping 192.168.10.254
fails).
Am I missing something in the VPN client configuration? Or somewhere else?
Thank you for your help.
EDIT - as requested in the comment, here are what I got from the router's shell.
root@router $ ip -4 addr
1: lo: <LOOPBACK,MULTICAST,UP,10000> mtu 65536 qdisc noqueue
inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
inet 47.X.X.250/24 brd 47.X.X.255 scope global eth1
valid_lft forever preferred_lft forever
6: br0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc noqueue
inet 169.X.X.1/16 brd 169.X.X.255 scope global br0:0
valid_lft forever preferred_lft forever
inet 192.168.10.254/24 brd 192.168.10.255 scope global br0
valid_lft forever preferred_lft forever
11: tun1: <POINTOPOINT,MULTICAST,NOARP,UP,10000> mtu 1500 qdisc pfifo_fast qlen 100
inet 10.8.0.6 peer 10.8.0.5/32 scope global tun1
valid_lft forever preferred_lft forever
Note: 47.X.X.250 is my public ISP address. 167.X.X.. is the address of the VPN server in the cloud.
root@router $ ip route get 192.168.10.135
192.168.10.135 via 47.X.X.1 dev eth1 src 47.X.X.250
cache
root@router $ ip route
0.0.0.0/1 via 10.8.0.5 dev tun1
default via 47.X.X.1 dev eth1
10.8.0.1 via 10.8.0.5 dev tun1
10.8.0.5 dev tun1 proto kernel scope link src 10.8.0.6
47.X.X.0/24 dev eth1 proto kernel scope link src 47.X.X.250
127.0.0.0/8 dev lo scope link
128.0.0.0/1 via 10.8.0.5 dev tun1
167.X.X.107 via 47.X.X.1 dev eth1
169.X.X.0/16 dev br0 proto kernel scope link src 169.X.X.1
192.168.10.0/24 dev br0 proto kernel scope link src 192.168.10.254
192.168.10.135 via 47.X.X.1 dev eth1
root@router $ ip rule
0: from all lookup local
32766: from all lookup main
32767: from all lookup default