I am running CentOS with a 2.6.38 kernel. The Linux box has an IP of assigned to eth0, which is the only network adapter on the box. I have created a program that fake an additional IP for this box. My program will respond to ARP request for with the MAC of eth0, so to other hosts in the LAN, has the same MAC as, and all traffic destined for will be routed to my Linux box and delivered to my program. My program will handle these IP packets and replies if needed.

So far my program is working good: it can receive IP packets with a destination address of, and other hosts can receive IP packets with a source address of from my Linux box.

However, I noticed that sometime my Linux OS will send out some ICMP destination unreachable (host unreachable) messages to other hosts. These ICMP destination unreachable messages have a source address of, the real IP of my Linux box. I examined the ICMP messages, and it seems that my Linux OS tries to notify other hosts that is unreachable. I think this makes sense because my program is faking at user space, and the OS has no idea where is.

Can someone suggest how to eliminate these destination-unreachable messages? They are undesirable in my application.

  • Would it be an option to assign as second IP address to your eth0? – bidifx Jul 23 '15 at 7:17
  • You can try to use iptables to prevent those ICMP messages from getting out. I'm not certain if this works but it's worth the try. :) – bidifx Jul 23 '15 at 7:22
  • Yeah, can't you just add that as an additional IP? ip addr add dev eth0 – slm Jul 23 '15 at 7:22
  • As to the iptables suggestion, they show how to block it via a FW: security.stackexchange.com/questions/3290/…. – slm Jul 23 '15 at 7:25

Your Answer

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

Browse other questions tagged or ask your own question.