Networking Forums

Networking Forums > Computer Networking > Linux Networking > route based on incoming eth out ppp - two eth / two ppp

Reply
Thread Tools Display Modes

route based on incoming eth out ppp - two eth / two ppp

 
 
Chris329@earthlink.REMOVE.net
Guest
Posts: n/a

 
      08-27-2004, 06:15 PM
I have two ethernet connections to an internal lan and two
outbound connections via ppp - two seperate isp's

I need to be able to route traffic based on incoming source.

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


I have two squid and two sendmail daemons running each
bound to it's interface.
Outbound mail needs to be able to go through it's
respective isp's smtp server as a smart host - hence
the traffic shaping.

I have scripted the connection and then added the following
iptables setup. Unfortunately it is not working.

#/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

Can anyone see where i have made a mistake in this?

Thanks 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
Route some packets based on port or source ip, over pptp link morleyc@gmail.com Linux Networking 2 06-26-2007 09:22 PM
Bus-Based Cisco Networking Academy Programs give Students a new Route to Acquire IT Skills ntwrkstudy@yahoo.com Linux Networking 0 09-09-2006 05:44 PM
Filtering rule based on dynamic route dr.minix Linux Networking 1 05-08-2006 04:55 AM
Load balancing : route based Gü¥-¥öm Linux Networking 0 09-13-2004 06:17 PM
Adding route to vpn based destinations - vpn not set as default gw Peter Tobin Windows Networking 7 02-26-2004 01:28 PM



1 2 3 4 5 6 7 8 9 10 11