Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I would like to manually set up routing to subnet through IP which is an alias: IP alias is set up like that:

 /sbin/ifconfig eth0:0 netmask broadcast

At the beginning i tried something like that:

route add -net netmask gw dev eth0

and everything worked just fine, until i got an email from my datacenter that IP address is sending wrong ARP packets:

Wed Jun 6 08:07:15 2012 : arp who-has tell
Wed Jun 6 08:37:13 2012 : arp who-has tell
Wed Jun 6 09:07:19 2012 : arp who-has tell

Conversation with their support went to nothing and now i'm still trying to fix that. Another setup which worked (but still was sending these wrong ARP packets) was:

ip route add via

i think this one internally worked just the same.

Next i tried configuring routing through iptables and SNAT. I enabled ip-forwarding and tried different crazy stuff like:

iptables -t nat -A POSTROUTING -s -o eth0 -j SNAT --to-source
iptables -t nat -A POSTROUTING -s -o eth0 -j SNAT --to-source
iptables -t nat -A POSTROUTING -s -o eth0 -j SNAT --to
iptables -t nat -A PREROUTING -p tcp -d -j DNAT --to-destination

None of these changed routing. Could anyone give me any sort of advice how to change route to this subnet without sending spare/wrong ARP packets?

share|improve this question
I don't understand what you're trying to do. Where would you like packets bound for to go? (Your machine is sending the ARP packets because it has no idea which machine to send those packets to. How is it supposed to know?) Is assigned to this machine? – David Schwartz Jul 29 '12 at 11:20

2 Answers 2

As I understand your question, is the IP address of some machine on your LAN that you want to route packets bound for to. If that's correct, either of your two route statements will do the job. Just get rid of the aliased eth0:0 interface. That's for local IP addresses assigned to this machine.

share|improve this answer
If i undestand you correctly, you suggest removing the alias... I can't do that because this alias is one of my additional IP addresses ("ip failover" technology of OVH - – WMP Jul 29 '12 at 19:04
Oh, then it should be assigned to a loopback interface, not an Ethernet interface. – David Schwartz Jul 29 '12 at 19:27
up vote 0 down vote accepted
ip addr add brd dev eth0
ip route add src via
ip neigth flush

Where is gateway

share|improve this answer

Your Answer


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

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