Networking Forums

Networking Forums > Computer Networking > Linux Networking > routing out two ppp lines via source eth - iptables

Reply
Thread Tools Display Modes

routing out two ppp lines via source eth - iptables

 
 
chris329@_REMOVE_earthlink.net
Guest
Posts: n/a

 
      08-27-2004, 05:19 PM
I am trying to create two tables to route traffic based on the
ethernet port in which the originate.

Basically it is setup like this;

25
------->| eth0 | --------->ppp0 ---------> Internet
| 80 |
| |
| 26 |
------->| eth0:1 | --------->ppp1 ---------> Internet

8080

On each eth interface an instance of squid and sendmail are running
through the ports identified above.

I have scripted the connection for each ppp interface and then followed
up with the following;

#/bin/bash!
p0=`/sbin/ifconfig |grep P-t-P | awk '{print $2}'\
|sed -e 's/addr\://g;' |grep 209`
p1=`/sbin/ifconfig |grep P-t-P | awk '{print $2}'\
|sed -e 's/addr\://g;' |grep 129`
#
echo $p0
echo $p1
# Setup IPTABLES
iptables -t mangle -A PREROUTING -i eth0 -j MARK --set-mark 20
iptables -t mangle -A PREROUTING -i eth1 -j MARK --set-mark 21
ip route add default via $p0 dev ppp0 table 22
ip route add default via $p1 dev ppp1 table 23
ip rule add fwmark 20 table 22
ip rule add fwmark 21 table 23

Unfortunately this is not working - for some reason it is taking the default
route instead of using the rules setup above.

Can anyone shed some light on where i have gone wrong?

Thanks in advance for any and all help

Cheers,

Chris
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple WAN lines - source routing jesper@harder.adsl.dk Linux Networking 0 02-19-2007 09:54 AM
Multiple WAN lines - source routing jesper@harder.adsl.dk Linux Networking 0 02-19-2007 09:54 AM
Multiple WAN lines - source routing jesper@harder.adsl.dk Linux Networking 0 02-19-2007 09:54 AM
Multiple WAN lines - source routing jesper@harder.adsl.dk Network Routers 0 02-19-2007 06:53 AM
Iptables NAT specific source IPs.. BWGames Linux Networking 2 03-16-2005 01:04 AM



1 2 3 4 5 6 7 8 9 10 11