For a LAN, instead of a switch, I have built a topology where each machine is connected to a router. Each host is assigned an IP address from 10/8. Here are the interface details:


Lets say I ping from this host. The routing table of has been configured to use the router ( as the default gateway. But since the destination IP address ( is in the same subnet it sends out an ARP broadcast. I want to disable this behavior of sending an ARP broadcast and instead force it to use the routing table. How do I accomplish this?

  • Why are you changing ARP's behavior? How is this useful? – Mike Pennington Jun 18 '12 at 4:07

There are two ways to achieve this. The first is very abnormal and likely to cause weirdness, so the second is better.

Method 1 (NOT recommended)

The typical routing table looks something like this:

% ip route dev wlan0  proto kernel  scope link  src
default via dev wlan0  proto static 

Which tells the kernel that destinations in are directly connected to wlan0, and everything else must go via the router at It's this first route which tells the kernel to do an ARP request and send the packet directly. If you remove it then everything should go via the router. This route is configured by default though, so you'll need to explicitly remove it somewhere. Your eventual routing table should look something like this:

% ip route
default via dev wlan0  proto static 

Method 2 (recommended)

The better method is to place each machine on its own subnet, so that each subnet is an Ethernet domain (as it usually should be). You would do this by allocating each machine a /30 subnet, with the router taking one of those IPs. Your network would look something like this:

(machine1)   <-------> (router)  <--------> (machine2)
  • +1 on this - there's no good reason to put all of these hosts onto a single router with overlapping subnets. Use /30's or set up bridging. – rnxrx Jun 18 '12 at 1:08
  • @mgorven: I had removed the first route from the kernel routing table but the host machine still sends a broadcast. – Bruce Jun 18 '12 at 1:16
  • @Bruce As I said, it's likely to cause weirdness. Use the second method. – mgorven Jun 18 '12 at 1:26
  • 2
    I would not even mention option 1. RFC-792: If G2 and the host identified by the internet source address of the datagram are on the same network, a redirect message is sent to the host. The redirect message advises the host to send its traffic for network X directly to gateway G2 as this is a shorter path to the destination. – Patrick Jun 18 '12 at 1:30
  • @Patrick That's specifically about to ICMP redirects, so I don't see why it's directly relevant? – mgorven Jun 18 '12 at 2:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.