I'm looking for a capability similar to Debian/Ubuntu's pre/post up/down network commands capability.
The problem: we've got a colo in which hosts talk directly to the hosting provider's router (through a bridging firewall) and hence our hosts MAC addresses are cached by the router.
We should be able to solve this by pinging the router directly when bringing up the interface, rather than waiting (a day) for the router's ARP cache to expire.
Yes, this means we're switching which hosts respond to a specific IP address, yes, we have to do this periodically.
An alternative would be to remap the MAC address, though pinging the router seems cleaner, and the MAC remap would /still/ have to run when the interface is brought up/down.
On 9/14/2011 1:26 PM, Edward Morbius wrote:
I'm looking for a capability similar to Debian/Ubuntu's pre/post up/down network commands capability.
If you look in /etc/sysconfig/network-scripts/ifup, you'll see that it will call /sbin/ifup-pre-local if it exists, before bringing up the network interface.
That script also calls .../network-scripts/ifup-post after bringing up the network interface, which in turn will call /sbin/ifup-local, if it exists, as its last step.
Neither is interface-specific, but they get the interface name passed to them, so if you needed to do something different for different interfaces, you could.
OK.
The next question becomes: how do we ensure that this happens for each defined IP, and that the ping is issued from a given IP address (routing/ etc.).
What we're hoping to accomplish is for the colo switch to get the correct ARP address for each defined IP address on the host. In some cases, we'll have multiple NICs on the same subnet, in others, IP aliases on the same NIC.
On Wed, Sep 14, 2011 at 2:14 PM, Warren Young warren@etr-usa.com wrote:
On 9/14/2011 1:26 PM, Edward Morbius wrote:
I'm looking for a capability similar to Debian/Ubuntu's pre/post up/down network commands capability.
If you look in /etc/sysconfig/network-scripts/ifup, you'll see that it will call /sbin/ifup-pre-local if it exists, before bringing up the network interface.
That script also calls .../network-scripts/ifup-post after bringing up the network interface, which in turn will call /sbin/ifup-local, if it exists, as its last step.
Neither is interface-specific, but they get the interface name passed to them, so if you needed to do something different for different interfaces, you could. _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On Wed, 14 Sep 2011 12:26:10 -0700 Edward Morbius wrote:
I'm looking for a capability similar to Debian/Ubuntu's pre/post up/down network commands capability.
If you're using networkmanager you can create a script in in /etc/NetworkManager/dispatcher.d/ to do pretty much anything you want it to do.
--On Wednesday, September 14, 2011 12:26:10 PM -0700 Edward Morbius dredmorbius@gmail.com wrote:
I'm looking for a capability similar to Debian/Ubuntu's pre/post up/down network commands capability.
[...]
We should be able to solve this by pinging the router directly when bringing up the interface, rather than waiting (a day) for the router's ARP cache to expire.
Have a look at arping(8) and it's -U flag in particular rather than ping.
Also read 'man ifup'. That refers you to /usr/share/doc/initscripts*/sysconfig.txt which talks about the ifup-post script. Looking at the end of ifup-post, we see the following:
if [ -x /sbin/ifup-local ]; then /sbin/ifup-local ${DEVICE} fi
So it's probably the case that you could create a /sbin/ifup-local that, based on the device name, may arping the gateway.
I was looking at my RHEL6 laptop when I was writing this, but C6 is almost certainly the same.
Devin
--On Wednesday, September 14, 2011 03:37:34 PM -0600 Devin Reade gdr@gno.org wrote:
Have a look at arping(8) and it's -U flag in particular rather than ping.
Sorry, I should have said the -A flag. FWIW, gratuitous ARP is the mechanism used by Linux-HA when dealing with IPs moving between nodes. For example: arping -A -c3 -I eth0 YOUR_IP
Devin
Thanks, that should do it.
On Wed, Sep 14, 2011 at 2:50 PM, Devin Reade gdr@gno.org wrote:
--On Wednesday, September 14, 2011 03:37:34 PM -0600 Devin Reade gdr@gno.org wrote:
Have a look at arping(8) and it's -U flag in particular rather than ping.
Sorry, I should have said the -A flag. FWIW, gratuitous ARP is the mechanism used by Linux-HA when dealing with IPs moving between nodes. For example: arping -A -c3 -I eth0 YOUR_IP
Devin
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos