Re: Is this correct?

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

 



> > iptables -t nat -I PREROUTING -i eth0 -d 10.0.0.1 -J DNAT \
> > 	--to 192.168.0.1
> 
> 	Ummm .
>              Where is 10.0.0.1? (since the network is /24)
> 	   If eth0's ip is 10.0.0.250 why would any packets for 10.0.0.1 end up 
> there?  Unless there is an *external* routing reference that puts 10.0.0.1 
> through 10.0.0.250 this cannot work.  If there is such a routing, the rule 
> should work.

My scenario was bogus. Sorry! It's probably more accurate to say that
some host "10.23.4.209" is going to try to reach 10.0.0.1, and
10.0.0.250 is the last hop on the way there, and should DNAT those
packets to 192.168.0.1.

The problem with my original scenario was that since the hosts needing
to reach 10.0.0.1/24 (which is really 192.168.0.1) were on the
10.0.0.1/24 network themselves. Why would they need to look up a route
for a host that's supposed to be on the same network as them?

So, others were saying to assign 10.0.0.1 to linux-router/eth0:1 (I
guess) so the host would actually get all the packets intended for
10.0.0.1. I guess it's surprising to me if this works, because at what
point does linux-router decide if a packet if to be forwarded or
accepted as it's own? If eth0 has 10.0.0.1, would DNATing the packet to
192.168.0.1 keep linux-router from owning the packet?

Hmmm...


[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux