From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gerardo Arceri Date: Fri, 18 Feb 2005 21:16:48 +0000 Subject: [LARTC] Route away packets addressed to the machine itself w/iproute and Message-Id: <42165B40.20905@elfarto.com.ar> MIME-Version: 1 Content-Type: multipart/mixed; boundary="------------050701030605050207020101" List-Id: To: lartc@vger.kernel.org This is a multi-part message in MIME format. --------------050701030605050207020101 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I have a box with only 1 IP (lets say 10.0.0.1) which has an ipip tunnel to another machine (lets say 10.2.0.1)(different networks) i wan't all packets coming to 10.0.0.1 destination port 80 be routed thru the tunnel device and be answered by 10.2.0.2 (which has an interface configured with 10.0.0.1). It works if the incoming ip address is not configured on the receiving machine (but is configured to be arpproxied) but not with the "main" ip address. This is what i did to test on 10.0.0.1 ifconfig eth0: main interface tunnel2: ipip tunnel interface to 10.2.0.2 /etc/iproute/rt_tables added: 100 myroute iptables -A PREROUTING -t mangle -d 10.0.0.1 -p tcp --dport 80 -j MARK --set-mark 99 ip route add table test dev tunnel2 ip rule add fwmark 99 table test in 10.0.0.2 ifconfig eth0:101 10.0.0.1 netmask 255.255.255.255 What i'm doing wrong ? Thanks! --------------050701030605050207020101 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I have a box with only 1 IP (lets say 10.0.0.1) which has an ipip tunnel to another machine (lets say 10.2.0.1)(different networks)  i wan't all packets coming to 10.0.0.1 destination port 80 be routed thru the tunnel device and be answered by 10.2.0.2 (which has an interface configured  with 10.0.0.1).
It works if the incoming ip address is not configured on the receiving machine (but is configured to be arpproxied) but not with the "main" ip address.
This is what i did to test
on 10.0.0.1
ifconfig
eth0: main interface
tunnel2: ipip tunnel interface to 10.2.0.2

/etc/iproute/rt_tables
added:
100   myroute


iptables -A PREROUTING -t mangle -d 10.0.0.1 -p tcp --dport 80 -j MARK --set-mark 99
ip route add table test dev tunnel2
ip rule add fwmark 99 table test


in 10.0.0.2
ifconfig eth0:101 10.0.0.1 netmask 255.255.255.255

What i'm doing wrong ?
Thanks!
 
--------------050701030605050207020101-- _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/