[LARTC] problem with marking packets and sending them out

Linux Advanced Routing and Traffic Control

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

 



I have two interfaces and I want smtp to go out one of them so I did
the following:

iptables -t mangle -A OUTPUT -p tcp --dport 25 -j MARK --set-mark 1
ip rule add fwmark 1 table mail.out
ip route add default via ${GATEWAY} dev eth1 table mail.out
ip route add default via ${PPP_REMOTE}
iptables -t nat -A POSTROUTING -o eth1 -j SNAT    --to ${IPADDR}
iptables -t nat -A POSTROUTING -o ppp0 -j SNAT --to ${PPP_LOCAL}

where GATEWAY is the network for that interface, $IPADDR is the
corresponding local ip and the PPP_REMOTE and PPP_LOCAL work
similarly for ppp0.

Now what happens is that if a connection comes in on IPADDR things
work correctly (I have set up two tables already so packets go back
out correctly), but if I am in the router box and do telnet
<any host> 25  it just hangs -- I see packets coming back from the
host correctly, but somehow the telnet doesn't see them -- what am I
doing wrong here?

Any assistance would be appreciated.

-- 
         John Covici
         covici@xxxxxxxxxxxxxx


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