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
 
(One intermediate revision by the same user not shown)
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
 
# Allow direct access to the other end of the tunnel
  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


# Route packets for the Ubiquiti radio direct to the WAN port
ip route add 192.168.1.20 via 192.168.1.1 dev eth1 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 19:
  # 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

Latest revision as of 00:10, 26 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

# Allow direct access to the other end of the tunnel
ip route add 10.8.0.0/27 via 10.8.0.5 dev tun0 table ovpn
# Route packets for the Ubiquiti radio direct to the WAN port
ip route add 192.168.1.20 via 192.168.1.1 dev eth1 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