simple source policy routing not working

Linux Advanced Routing and Traffic Control

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

 



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@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

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