Stuart Zilm wrote:
# this works - the source selected is $SRC
ip route add $DST dev eth0 src $SRC # implicit table main

# this fails - the source selected is chosen from main
ip route del $DST dev eth0 src $SRC # implicit table main - NOTE: if this route remains, this source address will be chosen (from table main!)
ip route add $SRC dev eth0 src $SRC table 1
ip rule add fwmark 1 table 1
iptables -t mangle -A OUTPUT -d $DST -j MARK --set-mark 1

The source address is chosen before netfilter sees the first packet,
so there is no mark to route by. Netfilter chooses a new route when
a packet is marked, but its too late to change the sockets source
address. You can use NAT to manually change the packets source.

Regards
Patrick
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to