On a CentOS 5.8 machine, I needed to keep the default gateway route through eth0, even though both eth0 and eth1 were receiving DHCP. It took a suprisingly long time to Google that in CentOS, you can simply use GATEWAYDEV=eth0 in /etc/sysconfig/network rather than mucking with /etc/sysconfig/network-scripts/, etc.
It is a little annoying that although CentOS will pick up the hostname from the first dhcp upped interface (eth0 in this case), it will set the default route through the last dhcp upped interface (eth1 in this case).
Showing posts with label routing. Show all posts
Showing posts with label routing. Show all posts
Wednesday, June 13, 2012
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.
(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.
Subscribe to:
Posts (Atom)