IPRoute2

From Wildsong
Revision as of 23:05, 25 December 2014 by Brian Wilson (talk | contribs) (Created page with " #Create an alias to call our table echo 10 ovpn >> /etc/iproute2/rt_tables # When packets come in from the LAN, send them to the custom table ip rule add from 192.168.4....")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
#Create an alias to call our table
echo 10 ovpn >> /etc/iproute2/rt_tables
# When packets come in from the LAN, send them to the custom table 
ip rule add from 192.168.4.0/24 table ovpn
ip route add 10.8.0.0/27 via 10.8.0.5 dev tun0 table ovpn
# When packets are destined for the CDS network, send then to the tunnel
ip route add 192.168.2.0/24 via 10.8.0.5 dev tun0 table ovpn
# When they are destined for the LAN, send them to it.
ip route add 192.168.4.0/24 via 192.168.4.254 dev br-lan table ovpn

# Everything else goes to the Internet router
ip route add default via 192.168.1.1 dev eth1 table ovpn
ip route show table ovpn
ip route flush cache