Re: return routes

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday 28 July 2004 06:27, you wrote:
> What do you mean :
> >If I set the default gateway to eth0
> > but send the mail thru eth1, the outgoing mail does in fact go correctly
>
> out,
> ?
> How are you doing this?

The very core that 'should' get things going (and works for traffic going 
out ) is as follows:

assuming tables 'adsl' and 'shaw' are set up already 
in /etc/iproute2/rt_tables (debian)

I am using shorewall as a firewall and both eth0 and eth1 are masqueraded to  
eth2 (local) and eth3 (dmz with the mail server)

assuming $GATEWAW_TELUS and $GATEWAY_SHAW have been defined as the appropriate 
IP's for the gateways of shaw (eth0) and telus (eth1)

# setting up default routes in the two tables
ip route add default via $GATEWAY_TELUS table adsl
ip route add default via $GATEWAY_SHAW table shaw

# setting up default route when no branch is taken
ip route add default via $GATEWAY_SHAW

# mark port 25 traffic coming from mail server
iptables - t mangle -A PREROUTING -p tcp --dport 25 -s 192.168.1.2 /
-j mark --set-mark 1

# use table telus when port 25 traffic is detected
ip route add fwmark 1 table adsl

# clear routing cache
ip route flush cache

Jens
_______________________________________________
LARTC mailing list / LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux