Wednesday, December 30, 2009

aliased ip not recognized by router

We had to manually assign an aliased ip to a failover host, call him jeeves, to replace a failed server, call him bertie. Assume bertie's ip is bbb.bbb.bbb.bbb.

(Note: to add an ip onto an interface, say eth0, use something like:
/sbin/ifconfig eth0:1 inet bbb.bbb.bbb.bbb netmask 255.255.248.0 broadcast bbb.bbb.ccc.255 up)

Previously, this had been all we'd had to do, but this time, we were only able to access the ip behind the router, not from hosts outside the local network.

The trick was to send a manual arp request to the router from jeeves, after co-opting bertie's ip:
/sbin/arping -c 2 -s bbb.bbb.bbb.bbb rrr.rrr.rrr.0
(where rrr.rrr.rrr.0 is the router ip)

Normally, this arp request goes to the router when you restart an interface, but aliasing on an ip does not necessarily cause your host to talk to the router. So you may need to do it manually.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.