Skip to content
dboyd13 edited this page Sep 24, 2013 · 1 revision

Combine Source and Destination Routing

A combination of 'source based' and 'destination based' is possible:

  1. Delete the current (bad) route for 192.168.1.0 on the RPi: sudo route del -net 192.168.1.0 netmask 255.255.255.0

  2. Add routes back to your internal network on the RPi using your current routers WAN address (should be 10.254.254.10) as a gateway. I've included all 3 of the registered private (RFC1918) address space as a 'catch-all':

sudo ip route add 10.0.0.0/8 via 10.254.254.10
sudo ip route add 172.16.0.0/12 via 10.254.254.10
sudo ip route add 192.168.0.0/16 via 10.254.254.10
  1. Disable SPI firewall on your existing router.
  2. Disable NAT on your existing router, often it's not called NAT it could be called 'Router' Mode.
  3. On the RPI create a new IP Rule substituting with the source IP you wish to route (note that table 1 is ppp0, and table 2 is ppp1 and so forth) - sudo ip rule add from 192.168.1.119 table 1
  4. Test is all traffic from the specific source is defaulted down the PPP/VPN int.

Note that the IP Rule created will not persist reboots or DSVR service restarts. If it works ok for people and there is some degree of demand (create a enhancement request) for this I'll look at making it a GUI based and persistent feature.

Static MAC - Get around being forced to use your ISP supplied router

It is most common that they ‘recognise’ their router is by it’s MAC address. If so, it’s possible to make the WAN side (ETH0) of the Raspberry Pi the same, you can try the following:

  1. Determine the MAC address of your provider router (WAN interface).
  2. SSH into the RPi, and modify the /etc/network/interfaces with hwaddress ether xx:xx:xx:xx:xx:xx in the ETH0 section – note the format and replace xx: portions with the desired MAC, it’ll be something like what I’ve put at the end of this section
  3. Reboot the Raspberry Pi and provide equipment.
  4. Test!

Would appreciate feedback if this works or not.

auto lo
iface lo inet loopback
#Onboard NIC connecting to the MODEM/CE (Internet)
auto eth0
iface eth0 inet dhcp
hwaddress ether xx:xx:xx:xx:xx:xx
post-up route del default gw 10.254.254.254
post-up route add default dev eth0

#USB NIC connecting to the Internal Router (DDwrt)
auto eth1
iface eth1 inet static
address 10.254.254.254
netmask 255.255.255.0
network 10.254.254.0
broadcast 10.254.254.255
gateway 10.254.254.254
post-up route add -net 192.168.1.0 netmask 255.255.255.0 gw 10.254.254.254 dev eth1````