I am running CentOS with a 2.6.38 kernel. The Linux box has an IP of 10.0.0.10 assigned to eth0, which is the only network adapter on the box. I have created a program that fake an additional IP 10.0.0.20 for this box. My program will respond to ARP request for 10.0.0.20 with the MAC of eth0, so to other hosts in the LAN, 10.0.0.20 has the same MAC as 10.0.0.10, and all traffic destined for 10.0.0.20 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 10.0.0.20, and other hosts can receive IP packets with a source address of 10.0.0.20 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 10.0.0.10, 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 10.0.0.20 is unreachable. I think this makes sense because my program is faking 10.0.0.20 at user space, and the OS has no idea where 10.0.0.20 is.
Can someone suggest how to eliminate these destination-unreachable messages? They are undesirable in my application.