IPRoute2: Difference between revisions
From Wildsong
Jump to navigationJump to search
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...." |
Brian Wilson (talk | contribs) mNo edit summary |
||
Line 1: | Line 1: | ||
#Create an alias to call our table | #Create an alias to call our table | ||
echo 10 ovpn >> /etc/iproute2/rt_tables | echo 10 ovpn >> /etc/iproute2/rt_tables | ||
# When packets come in from the LAN, send them to the custom table | # 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 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 | 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 | # 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 | 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. | # 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 | ip route add 192.168.4.0/24 via 192.168.4.254 dev br-lan table ovpn | ||
Line 15: | Line 15: | ||
# Everything else goes to the Internet router | # Everything else goes to the Internet router | ||
ip route add default via 192.168.1.1 dev eth1 table ovpn | ip route add default via 192.168.1.1 dev eth1 table ovpn | ||
ip route show table ovpn | ip route show table ovpn | ||
ip route flush cache | ip route flush cache |
Revision as of 23:05, 25 December 2014
#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