I just resolved an issue when bringing up an interface, but I'm at a loss to explain why it worked. So I'm looking for someone with more knowledge of the linux networking stack to explain this to me.
This machine has two Broadcom gigabit nics, using the tg3 driver. OS is CentOS 5.7. These nics are onboard.
One was already configured and working. I attached a cable into the second one, with the other end in a gigabit switch.
ethtool eth0 (the one that worked) showed a link, full duplex, auto negotiated, gigabit speed. So no change there.
ethtool eth1, however, showed no link. The link lights were on, although the link lights on the switch showed that it wasn't negotiating correctly. So, I figured that it was some sort of autonegotiation issue, and used ethtool -s eth1 autoneg off speed 100 duplex full
to try to get a link. This failed - ethtool reporting "cannot set new settings invalid argument".
After much mucking about and hard thinking, I was at a loss, and I finally got around to checking the ifcfg-eth1 file. This had DHCP set to on, although it was set to ONBOOT=no. There is no DHCP server on this net.
Also, I'll add that I tried, during this process, bringing the card up and down several times, and when I made the following changes, the card was down.
I removed the BOOTPROTO=dhcp line, and set ONBOOT to yes, as well as giving it a valid IP and the other usual settings. ifup eth1
and amazingly, link was achieved.
What I'm confused about is that I would have thought that ethtool would be able to manage a card, and detect a link, without any reference to the os network settings for that device. In past experience, even if an ethernet card isn't configured, or "up", ethtool will show a link when there is a physical link to the card.
But, obviously, at least in this case, my assumptions are incorrect.
Does anyone have an explanation as to why this behavior exhibited itself?