Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

If I have

>ip ro
192.168.14.0/24 dev eth0

another host can obtain my mac address. But if I flush routing info:

>ip ro flush table main

arp resolution doesn't work. Broadcast packets "Who has 192.168.14.149" reach eth0 but OS (Linux) doesn't respond despite eth0 has address 192.168.14.149. What connection exists between routing and arp resolution?

share|improve this question

migrated from stackoverflow.com Mar 23 '10 at 12:20

This question came from our site for professional and enthusiast programmers.

    
Belongs on ServerFault.com –  Brian Rasmussen Mar 23 '10 at 12:17
add comment

2 Answers

On Linux routes are created automatically for the local network when an interface is brought up.

So if you have assigned the ip address 192.168.14.12 to eth0 a routed should be created that looks like this.

192.168.14.0/24 dev eth0  proto kernel  scope link  src 192.168.14.12

If that link route does not exist you will not be able to send or receive packets.

By running the command ip ro flush table main you have removed all routes including the link routes from your main route table on the system. From that Linux box you can test things are seriously broken by simpling pinging another IP address. You will get a Network is unreachable error. With no route table at all Linux will not are or really do anything on the network.

You could use a command like this to remove assigned routes without removing the link routes.

ip ro flush table main scope global

This ability to manipulate the link routes does come in handy when you are trying to do something advanced like creating a psuedo-bridge with proxy arp.

share|improve this answer
add comment

The described behaviour matches that of an enabled /proc/sys/net/ipv4/*/arp_ignore. arp_filter and rp_filter could lead to similar behaviour under certain circumstances.

arp_ignore - INTEGER
    Define different modes for sending replies in response to
    received ARP requests that resolve local target IP addresses:
    0 - (default): reply for any local target IP address, configured
    on any interface
    1 - reply only if the target IP address is local address
    configured on the incoming interface
    2 - reply only if the target IP address is local address
    configured on the incoming interface and both with the
    sender's IP address are part from same subnet on this interface
    3 - do not reply for local addresses configured with scope host,
    only resolutions for global and link addresses are replied
    4-7 - reserved
    8 - do not reply for all local addresses

    The max value from conf/{all,interface}/arp_ignore is used
    when ARP request is received on the {interface}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.