Hi All, I''ve got server with one LAN card eth0 ip=10.0.0.5 default access t ointernety done through ADSL router gw 10.0.0.1 we got second internet access through another ADSL router gw 10.0.0.2 I want to send all e-mail out through gw 10.0.0.2 How it can be done? I''ve tried to mark packets: iptables -t mangle -A OUTPUT -p tcp --dport 25 -j MARK --set-mark 0x1 and ip ru add fwmark 0x1 table mail.out ip ro add default via 10.0.0.2 lookup mail.out But it is dosen''t work Any help? -- -- Michael _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
Silly mistake I always make is too forget to put in NAT on GW. But what you have done should work. Have you confirmed that this works on 10.0.0.5 ip route del default ip route add default via 10.0.0.2 ip route flush cache If that works maybe try # Dont know which one of these I think your right it should be output iptables -t mangle -A PREROUTING -p tcp --dport 25 -j MARK --set-mark 0x1 iptables -t mangle -A OUTPUT -p tcp --dport 25 -j MARK --set-mark 0x1 ip rule add from 10.0.0.0/8 fwmark 1 lookup 200 ip route add default via 10.0.0.2 table 200 # The I would try tcpdump -vv -ni eth? and look at the MACs # or and check the mark iptables -I POSTROUTING -p tcp --dport 25 -j LOG On Fri, 2006-08-04 at 14:36 +1200, Michael wrote:> Hi All, > > I''ve got server with one LAN card eth0 ip=10.0.0.5 > > default access t ointernety done through ADSL router gw 10.0.0.1 > we got second internet access through another ADSL router gw 10.0.0.2 > > I want to send all e-mail out through gw 10.0.0.2 > How it can be done? > I''ve tried to mark packets: > iptables -t mangle -A OUTPUT -p tcp --dport 25 -j MARK --set-mark 0x1 > and > ip ru add fwmark 0x1 table mail.out > ip ro add default via 10.0.0.2 lookup mail.out > > But it is dosen''t work > Any help? > > -- > -- > Michael > _______________________________________________ > LARTC mailing list > LARTC@mailman.ds9a.nlhttp://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
On 04-08-2006 04:36, Michael wrote:> Hi All, > > I''ve got server with one LAN card eth0 ip=10.0.0.5 <http://10.0.0.5> > > default access t ointernety done through ADSL router gw 10.0.0.1 > <http://10.0.0.1> > we got second internet access through another ADSL router gw 10.0.0.2 > <http://10.0.0.2> > > I want to send all e-mail out through gw 10.0.0.2 <http://10.0.0.2> > How it can be done? > I''ve tried to mark packets: > iptables -t mangle -A OUTPUT -p tcp --dport 25 -j MARK --set-mark 0x1 > and > ip ru add fwmark 0x1 table mail.out > ip ro add default via 10.0.0.2 <http://10.0.0.2> lookup mail.outYou mean: ip ro add default via 10.0.0.2 table mail.out Try this also: echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter Jarek P. PS: I hope you have this mail.out properly added (or replace this with a number e.g.: 100) and fwmark enabled in kernel config.
Possibly Parallel Threads
- [Bug 452] New: DNAT to internal network don't work with source routing and 2 uplinks
- Route certain trafic via a tinc node that is not directly connected.
- Routing squid to a different gateway
- How to balance OUTBOUND traffic by packet if..
- routing between 2 lines problem , after starting squid