CentOS DHCP with a slow cisco switch

I had a problem recently with a CentOS host that is DHCPing off a older Cisco switch that takes several seconds to do link negotation.

The problem was that Ubuntu would give up on DHCPing and take the ethernet interface down before the Cisco switch got around to negotiating the link.

Is there some easy way to put a DHCP timeout in interfaces? does anyone know?

For now, what I did was put the following in rc.local (yes, this really does work):

echo -n “Activating godawful hack to get ethernet up despite very slow Cisco POS switch…”
/sbin/ip -o link set dev eth0 up
sleep 25
echo “Done”
/etc/sysconfig/network-scripts/ifup eth0

Leave a Reply