OpenVPN and multi-LAN NAT question ?
Posted: Fri Mar 21, 2014 1:39 am
Hello sorry for my poor English,
I have a Debian machine that I want to use as a custom router.
It has 3 network interfaces
eth0: WAN
eth1: LAN1
eth2: LAN2
LAN1 and LAN2 are on different IP range, served by a dhcp server running on the machine
I have also a OpenVPN client, connected as a tun to a server that I don't control
I need to route all eth1(LAN1) internet traffic through the VPN tunnel, and at the same time route all eth2(LAN2) internet traffic through the default WAN gateway.
the nat table is set on tun0 for eth1 (to provide NAT via VPN tunnel), and set to eth0 for eth2.
I have been unable to have both LAN interfaces working at the same time.
If OpenVPN is running, eth1 is working but not eth2, and the opposite if OpenVPN is stopped.
Is there any solution to make both interfaces work together ?
I assume the trick is by setting specific route (and not the default/0 gw vpn_gateway), but I have been unable to find the right combination.
Anyone have an idea ?
I have a Debian machine that I want to use as a custom router.
It has 3 network interfaces
eth0: WAN
eth1: LAN1
eth2: LAN2
LAN1 and LAN2 are on different IP range, served by a dhcp server running on the machine
I have also a OpenVPN client, connected as a tun to a server that I don't control
I need to route all eth1(LAN1) internet traffic through the VPN tunnel, and at the same time route all eth2(LAN2) internet traffic through the default WAN gateway.
the nat table is set on tun0 for eth1 (to provide NAT via VPN tunnel), and set to eth0 for eth2.
I have been unable to have both LAN interfaces working at the same time.
If OpenVPN is running, eth1 is working but not eth2, and the opposite if OpenVPN is stopped.
Is there any solution to make both interfaces work together ?
I assume the trick is by setting specific route (and not the default/0 gw vpn_gateway), but I have been unable to find the right combination.
Anyone have an idea ?