ip route nat problem

Linux Advanced Routing and Traffic Control

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

 



After upgrading our router from  redhat 7.3 (linux 2.4.18 ) to mandrake 10.0 
(linux 2.6.3)  some of our routing scripts failed.  This configuration worked 
properly before we changed distributions.  

X.X.X.2 is supposed to recieve traffic for X.X.X.6 and nat that to Z.Z.Z.46


ip addr list |grep 'eth[0123]'
2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    inet X.X.X.2/28 brd X.X.X.15 scope global eth0
3: eth1: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    inet Z.Z.Z.7/24 brd Z.Z.Z.255 scope global eth1
4: eth2: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    inet Y.Y.Y.5/24 brd Y.Y.Y.255 scope global eth2
5: eth3: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    inet W.W.W.74/29 brd W.W.W.79 scope global eth3

My current routing table is:
W.W.W.72/29 dev eth3  scope link
X.X.X.0/28 dev eth0  scope link
Y.Y.Y.0/24 dev eth2  scope link
Z.Z.Z.0/24 dev eth1  scope link
127.0.0.0/8 dev lo  scope link
default via W.W.W.73 dev eth3

When i try adding these rules:
ip route add default via X.X.X.1 dev eth0 table 200
ip route add nat X.X.X.6 via Z.Z.Z.46
ip rule add from Z.Z.Z.46 nat X.X.X.6 table 200

the second route causes this error: "RTNETLINK answers: File exists"
i have also tried changing the command to "append" rather than "add" the 
route, but this has had no effect.

i have also tried this:
ip route add default via X.X.X.1 dev eth0 table 200
ip route append nat X.X.X.6 via Z.Z.Z.46 table 201
ip rule add to X.X.X.6 table 201
ip rule add from Z.Z.Z.46 nat X.X.X.6 table 200
That seems to work at first, however "ip route get 209.167.89.6"
returns the following error: RTNETLINK answers: Invalid argument

Any help would be greatly appreciated



-- 
Sincerely,
Michael Harris
_______________________________________________
LARTC mailing list / LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

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