• We did not send an email asking for donations - please read this post.

Lan not tunneling through OpenVPN


New Member
Jan 8, 2021
Reaction score
Hello, my effort to to route my LAN traffic via the OpenVPN tunnel is failing, although
curl ifconfig.me from the OpenVPN device shows OpenVPN device is tunneling. However the LAN Traffic is not being forwarded to the Internet VPN Gateway. Please review my routing table below for a fix.

Lan------------------→ VPN-device --→ ISP Router ------Internet Cloud------------→ VPN Gateway→→ISP Router-

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface       UG        0 0          0 tun0         UG        0 0          0 eth0         UG        0 0          0 eth1   U         0 0          0 tun0 UGH       0 0          0 eth0       UG        0 0          0 tun0   U         0 0          0 eth1   U         0 0          0 eth0

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_ inet [URL=''][/URL] brd scope global dynamic noprefixroute eth0

3: eth1: <BROADCAST,MULTICAST,UP,LOWER_ inet [URL=''][/URL] brd scope global dynamic noprefixroute

OpenVPN Device
4: tun0: <POINTOPOINT,MULTICAST,NOARP, inet [URL=''][/URL] brd scope global tun0

It appears that I need to route the LAN through the tun0 Interface on the VPN device.

ip forwarding was enabled
sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
iptables routing via masquerade
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE /sbin/iptables -A FORWARD -i eth0 -o tun0 -m state --state RELATED,ESTABLISHED -j ACCEPT /sbin/iptables -A FORWARD -i tun0 -o eth0 -j ACCEPT
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation

Members online