Advanced Linux Firewall (2 ISP, 2 Networks)
Hello all. I am new to the board. Hope you can help shed some light on this problem I need to solve.
I Have 2 ISPS ( One is DSL (Using PPPoE) and the Other is Cable )
The Building Has two Networks (192.168.1.0/24 & 192.168.2.0/24)
Server: Slackware 10.0 (On a PIII-550 / 128 Megs Ram / 40 Gig Drive)
Services on the Box: HTTP (Apache,PHP,Mysql) / SFTP / Iptables Routing, DHCP Server
The box is up and running on the PPPoE (DSL) Connection.
The ADSL Modem is connected to the Swtich then Eth0 is connected to the switch.
Giving me This Configuration
ppp0: 18.104.22.168 (ex:) (*Dynamic) (Client: Roaring-Penguin)
One interface is used to create one virtual interface (ppp0)
Anyway, the problem is I will be installing a second nic (Eth1) and hoooking it up to Cable.
I need IPTABLES to do some routing as follows
- All IP's from 192.168.1.0/24 need to use the ppp0 connection
- All IP's from 192.168.2.0/24 need to use the eth1 (Cable) connection
Unless. One of the interfaces drop. Then it will route all traffic to the connection that is working.
I am currently using the Mon Montha rc.firewall script. But not sure if I can modify it for my needs.
I found this on a site (For splitting the connections):
iptables -t nat -A POSTROUTING -o $EXTIF -s $INTNET1 -j SNAT --to $EXTIP1
iptables -t nat -A POSTROUTING -o $EXTIF -s $INTNET2 -j SNAT --to $EXTIP2
But seeing the IP is dynamic, I would need to reload the firewall everytime the IP changes. Which is not really a problem. I can work with that.
The second issue is failover in case one connection drops.
I found this...
# route add default gw 192.168.1.2 dev eth0
# route add default gw 192.168.2.2 dev eth0
Not sure how to incorporate all this. (Trying to keep/modify the Mon Montha Firewall Script)
Help. Please :cry: I am trying to avoid using m0n0wall. :lol: