Mailing List Archive

Support open source code!


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

Re: tlug: icmp redirects



On Tue, Jul 21, 1998 at 10:22:25AM +0900, Scott Stone wrote:
> 
> how do you send an icmp redirect to a host?

This is one of those things that's a lot easier to explain on a white
board than in words, but here goes:

An ICMP redirect is basically one machine saying "you sent this packet
for X to me, but you should have sent it to Y which is a much better
route".

AFAIK there is no way to explicitly cause a redirect to be sent -- if
someone is forwarding packets through you when your machine knows a
better route, the redirect should be sent automatically.

If for some testing reason you want to ensure that redirects are
generated, you'll need two single-homed hosts and another multihomed
host or router and two networks:

    Host A: system under test, the one that should *receive* ICMP
            redirects.  IP: 10.0.0.1/24

    Host B: system generating ICMP redirects.  IP: 10.0.0.2/24

    Host R: router between the two networks.  IPs: 10.0.0.3/24 and
                                                  10.0.1.1/24

	    (note: ip_forwarding needs to be *on*, of course)


Host A, Host B, and one interface on Host R are all on the same network.

Now, on host B, set up a default route to Host R: 

    hostB# route add -net default gw 10.0.0.3

Host B should now be able to ping any of the 4 IP addresses listed above
(10.0.0.1, 10.0.0.2, 10.0.0.3, and 10.0.1.1).

Next, on Host A, set up a default route pointing to Host *B*:

    hostA# route add -net default gw 10.0.0.2

Now if you ping the router interface on the other network from Host A,
Host B will send an ICMP redirect telling A that it should have sent the
packet to R to begin with.  The easiest way to see this is probably with
traceroute:

    hostA# traceroute -nv 10.0.0.3

Hope this helps.

Regards,
-- 
Rex
--------------------------------------------------------------
Next Meeting: 8 August, Tokyo Station Yaesu central gate 12:30
featuring Linux on multiple platforms:
i386, Sparc, PA-Risc, Amiga, SGI, Alpha, PalmPilot, ...
Next Nomikai: September, 19:30 Tengu TokyoEkiMae 03-3275-3691
--------------------------------------------------------------
Sponsor: PHT, makers of TurboLinux http://www.pht.co.jp


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links