All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] ip route nat problem
@ 2004-09-22 15:34 Michael Harris
  2004-09-23  4:17 ` Patrick McHardy
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Harris @ 2004-09-22 15:34 UTC (permalink / raw)
  To: lartc

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@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [LARTC] ip route nat problem
  2004-09-22 15:34 [LARTC] ip route nat problem Michael Harris
@ 2004-09-23  4:17 ` Patrick McHardy
  0 siblings, 0 replies; 2+ messages in thread
From: Patrick McHardy @ 2004-09-23  4:17 UTC (permalink / raw)
  To: lartc

Michael Harris wrote:

>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
>  
>
IP_ROUTE_NAT is broken on 2.6 and was removed in 2.6.9-rc1, you
should switch to netfilter NAT. Apparently there is also a stateless
NAT target floating around somewhere, although I've never seen it.

Regards
Patrick
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-09-23  4:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-22 15:34 [LARTC] ip route nat problem Michael Harris
2004-09-23  4:17 ` Patrick McHardy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.