ICMP Redirect
Kindly help me in understanding the observation of following experiment :-
-------- -------- | | | | | H1 |---------| H2 | | | | | -------- --------
H1 and H2 are two Linux host.
IP of H1 = 10.0.0.1
MAC of H1 = 00:00:00:00:00:01
IP of H2 = 10.0.0.2
MAC of H2 = 00:00:00:00:00:02
Now I did the following configurations.
1) In host H1
-------------
I added a static arp entry in the arp cache of the host H1
as arp -s 10.0.0.3 00:00:00:00:00:02.
(ie) the mac address for 10.0.0.3 as H2's mac address.
2) In host H2
-------------
Enabled IP forwarding.
Then from host H1, I made a ping 10.0.0.3. Here I found that ICMP request from host H1 reaches host H2,
and host H2 sends the following as ICMP redirect messages.
From 10.0.0.2: icmp_seq=1 Redirect Host (New nexthop:
10.0.0.3)
From 10.0.0.2: icmp_seq=2 Redirect Host (New nexthop:
10.0.0.3)
From 10.0.0.2: icmp_seq=3 Redirect Host (New nexthop:
10.0.0.3)
The above behaviour is of Linux functionality. Here the redirect uses the next-hop address as 10.0.0.3. What is the reason of it ?
It seems confusing because the ping was send just to that address.
- R. Rajasekaran.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Quoted 2 lines · R. Rajasekaran
IP of H1 = 10.0.0.1
IP of H2 = 10.0.0.2
[...]
Quoted 2 lines
Quoted 1 line
From 10.0.0.2: icmp_seq=1 Redirect Host (New nexthop:
10.0.0.3)
[...]
Quoted 3 lines
The above behaviour is of Linux functionality.
Here the redirect uses the next-hop address as
10.0.0.3. What is the reason of it ?
Because your network setting is just wrong. The smallest network mask you can set on this type of link is /30, i.e. 10.0.0.0/30. Then you have :
10.0.0.0 as network address 10.0.0.3 as broadcast address 10.0.0.1 and 10.0.0.2 as host addresses
If you send a packet from H1 to H2 destined to 10.0.0.3, H2 will complain because he's not the best router for H1 to reach 10.0.0.3. As describe by network mask, H1 should reach 10.0.0.3 directly on link, without using H2 as a router, thus you gety an ICMP Redirect.
This is still true if network mask is wider than /30, because then, 10.0.0.3 will be a host address belonging to H1 and H2 local link. Then there's not reason for H1 to go through H2 to reach it, and you get an ICMP redirect again.
Set your network as 10.0.0.0/30 and try to ping 10.0.0.5 instead. BTW, there's nothing related to Netfilter in this behaviour.
Signature · 2 lines
http://sid.rstack.org/ PGP KeyID: 157E98EE FingerPrint: FA62226DA9E72FA8AECAA240008B480E157E98EE
Quoted 2 lines
Quoted 2 lines
Hi! I'm your friendly neighbourhood signature virus. Copy me to your signature file and help me spread!