I am yet to do this for myself. Bigpond permanent modem with subnet 
allocated, and also a ADSL (yet to come)

I do however have an example snip of code as we set up a friends machine. 
He has Optus Cable Modem and permanent Bigpond perm.

Machine has 3 pci nic's... eg; 1 nic for dhcp from optus (eth2), 1 nic for 
192.168.0.1/24 priv lan (eth1), 1 nic for bigpond perm subnet (eth0)

Example;

#!/bin/sh

case $1 in
 start)
  # internal to internal, no route
  ip rule add from 203.40.227.128/26 to 203.40.227.128/26 table main pre 100
  ip rule add from 203.40.227.128/26 to 192.168.0.1/24 table main pre 100
  ip rule add from 192.168.0.1/24 to 192.168.0.1/24 table main pre 100
  ip rule add from 192.168.0.1/24 to 203.40.227.128/24 table main pre 100

  # perm modem traffic goes back out via modem
  ip rule add from 203.40.227.128/26 to 0/0 table 101 pre 101
  ip route add table 101 via 139.130.37.65 dev ppp0

  # and the rest goes via cable
  ip rule add from 192.168.0.1/24 to 0/0 table 102 pre 101
  ip route add table 102 via optusdhcpd-assigned-ip dev eth2

  ;;

 stop)
  ip rule del from 203.40.227.128/26 to 203.40.227.128/26 table main pre 100
  ip rule del from 203.40.227.128/26 to 192.168.0.1/24 table main pre 100
  ip rule del from 192.168.0.1/24 to 192.168.0.1/24 table main pre 100
  ip rule del from 192.168.0.1/24 to 203.40.227.128/24 table main pre 100

  ip rule del from 203.40.227.128/26 to 0/0 table 101 pre 101
  ip route del table 101 via 139.130.37.65 dev ppp0

  ip rule del from 192.168.0.1/24 to 0/0 table 102 pre 101
  ip route del table 102 via optusdhcpd-assigned-ip dev eth2
  ;;

 *)
  echo "start or stop?"
  ;;

 esac

End example

Hope this helps... cheers


> I have a cable modem and a ISDN line. I want to put two network cards in
> the one machine and have packets return on the interface they come in on.
> At the moment they return via the default route.
> 
> I have not tried to get it working but my life would be a lot closer to
> complete if I could. One year I will use the floppy router project to
> create such a firewall/router.
> 
> Please post how you go.




-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug

Reply via email to