LARTC
[Top] [All Lists]

[LARTC] simple source policy routing not working

To: lartc@mailman.ds9a.nl
Subject: [LARTC] simple source policy routing not working
From: Markus <lartc@ethen.de>
Date: Wed, 21 Feb 2007 13:42:04 +0100
Delivered-to: sp-com-lists@consult.net
Delivered-to: lartc-list@securepoint.com
Delivered-to: lartc@outpost.ds9a.nl
List-archive: <http://mailman.ds9a.nl/pipermail/lartc>
List-help: <mailto:lartc-request@mailman.ds9a.nl?subject=help>
List-id: "Mailinglist of the Linux Advanced Routing &amp; Traffic Control project" <lartc.mailman.ds9a.nl>
List-post: <mailto:lartc@mailman.ds9a.nl>
List-subscribe: <http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc>, <mailto:lartc-request@mailman.ds9a.nl?subject=subscribe>
List-unsubscribe: <http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc>, <mailto:lartc-request@mailman.ds9a.nl?subject=unsubscribe>
Sender: lartc-bounces@mailman.ds9a.nl
User-agent: KMail/1.9.4
Hi,

my box is connected to 3 networks, eth0 eth1 wlan0. I want "my" traffic to go 
via wlan0 and everything from eth1 NATed to eth0:
eth0 192.168.1.10/24
eth1 172.16.1.1/12
wlan0 192.168.10.190/24

I first tried this with two single hosts:

iptables -A POSTROUTING -j MASQUERADE -o eth0 -t nat
iptables -A POSTROUTING -j MASQUERADE -o wlan0 -t nat

echo 200 Forw >> /etc/iproute2/rt_tables

ip rule add from 172.30.230.230 table Forw

ip route add 192.168.1.99 via 192.168.10.1 dev wlan0 table main
ip route add 192.168.1.99 dev eth0 table Forw

ip -statistics route flush cache

ip route get 192.168.1.98 from 172.30.230.230 iif eth1
#    192.168.1.98 from 172.30.230.230 dev eth0  src 172.16.1.1 
#    cache <src-direct>  mtu 1492 advmss 1452 fragtimeout 64 iif eth1
ip route get 192.168.1.99 from 172.30.230.230 iif eth1
#    192.168.1.99 from 172.30.230.230 dev eth0  src 172.16.1.1 
#    cache <src-direct>  mtu 1492 advmss 1452 fragtimeout 64 iif eth1
ip route get 192.168.1.98
#    192.168.1.98 dev eth0  src 192.168.1.10 
#    cache  mtu 1492 advmss 1452 fragtimeout 64
ip route get 192.168.1.99
#    192.168.1.99 via 192.168.10.1 dev wlan0  src 192.168.10.190 
#    cache  mtu 1500 advmss 1460 fragtimeout 64

Before 172.30.230.230 was able to ping 192.168.1.99 and 192.168.1.98, after 
192.168.1.99 was unreacheable.

What's wrong? Please help...

Markus

_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

<Prev in Thread] Current Thread [Next in Thread>