Re: source based routing help needed



Jack Snodgrass a écrit :

Thanks... I kind of sort of came up with something that works... I added
a 100 tunnel entry to my /etc/iproute2/rt_tables file and then I use:

iptables -t mangle -A OUTPUT -p tcp --src 10.10.3.2 --sport 80 -j MARK --
set-mark 0x2
iptables -t mangle -A OUTPUT -p tcp --src 10.10.3.2 --sport 25 -j MARK --
set-mark 0x2
ip rule add fwmark 0x2 table tunnel
ip route add default via 10.10.3.1 table tunnel

and that seems to do the trick. I really only want to do this for web and mail so specifying the individual ports is fine.... anything that comes in for those ports from my tunnel get marked and routed back out
the tunnel.

This is not what the above rules do. They just mark locally generated outgoing packets matching specific source address and port. They do not take on which interface the original packets came from into account. This would require the use of the iptables 'CONNMARK' target, e.g. :

# mark incoming connections received on tun1
iptables -t mangle -A PREROUTING -i tun1 -m state --state NEW,RELATED \
-j CONNMARK --set-mark 0x2
# copy the connection mark to outgoing packets
iptables -t mangle -A OUTPUT -j CONNMARK --restore-mark
.



Relevant Pages

  • Re: my list of junkie thinking and how to change it
    ... /me walking in a tunnel until she finds the light. ... "Cindy Murray" wrote in message ... healthy breakfast or a healthy snack? ... Or keep a little tally on the bulletin board and every time you work out you mark it. ...
    (alt.support.stop-smoking)
  • Re: Elliott Carter on Bridge Records
    ... Mark & Steven Bornfeld DDShttp://www.dentaltwins.com ... we somehow found ourselves on the subway platform at the ... platform, peering down rather dangerously, looking into the tunnel on ...
    (rec.music.classical.recordings)
  • Re: exchange 2000 port fixieren
    ... > Walser Mark wrote: ... > Laßt ihr durch den VPN Tunnel nicht alles durch? ... > Such mal nach RPC End Point Mapper. ...
    (microsoft.public.de.german.exchange2000.general)
  • Re: [PATCH 00/03][RESUBMIT] net: EtherIP tunnel driver
    ... On Monday 25 September 2006 13:57, Joerg Roedel wrote: ... The tunnel provides an MTU of 1500. ... DF flag in outgoing packets. ...
    (Linux-Kernel)