Linux network interfaces take so long to come up

linuxnetworking

When any of the network interfaces on my x86 server comes up (1GbE port with igb driver, or 10GbE port with ixgbe driver), whether it's been done using ifup or by enabling the switch ports it's connected to, it takes on the order of 30 seconds before the interface is working (ping out or in).

They are configured with simple static IP addresses in /etc/network/interfaces, so I feel that they should become active immediately.

iface ge0 inet static
    address 10.63.4.20
    netmask 255.255.255.0
    gateway 10.63.4.1

I've searched the web extensively, but can't find a thing. tcpdump shows the port receiving broadcast ARP requests, but not replying to them or sending any other packets. After the ~30 seconds elapses, it sends out an ARP reply and ICMPs start flowing. Might it be pausing to detect duplicate IP addresses?

This is a problem because my manufacturing scenario involves reconfiguring and restarting the network several times. Other than this issue, the process would take seconds instead of minutes.

Best Answer

30 seconds is pretty much how long it takes for a default spanning tree port configuration to start forwarding traffic.

The port will go through different states (e.g. listening while it listens for BPDUs or learning when it's learning MAC addresses) until it gets to a forwarding state and starts, you guessed it, forwarding traffic.

Depending on your switch's vendor and model you should be able to tweak it. Please bear in mind that if you just disable spanning tree you're at risk of network loops that could bring your whole infrastructure down. It is not recommended to get rid of it on non-controlled or non-isolated networks.