On some networks, autonegotiation is not possible.
If you must set your interface's speed and duplex by hand, then some
trial and error may be required. Here are the basic steps:
- Install the ethtool and net-tools packages, so that you have the ethtool and mii-tool programs. One or both of these might work for your interface.
- Make sure you have a way to login to the system in case the network interface becomes nonfunctional. An ssh connection could be disrupted, so you should have a fallback strategy.
- Identify the interface in question (it will often be eth0). Adjust the remainder of these instructions accordingly.
- Try to determine what its current speed and duplex settings are. This is where it gets fun:
- As root, try ethtool eth0 first, and see whether the "Speed:" and "Duplex:" lines look valid. If not, the ethtool may not be supported by your device.
- As root, try mii-tool -v eth0 and see whether its output looks correct. If not, them mii-tool may not be supported by your device.
- If neither one is supported, you may have to set parameters directly on the kernel driver module. Identify which driver module you're using by reading the output of dmesg and lsmod. You can then try modinfo MODULENAME to see what parameters it accepts, if any. (You can use modinfo even on modules that are not loaded, for comparison.) ToDo: where does one set kernel module parameters?
- Next, try to change the settings of the interface while it's operating. You'll need to be root, of course. Either:
- ethtool -s eth0 autoneg off speed 100 duplex full (assuming 100 Mbps and full duplex)
- mii-tool -F 100baseTx-FD eth0 (same assumption)
- If one of these commands successfully set your NIC, then you can put it into /etc/network/interfaces so it runs when you bring the interface up (e.g. at boot time). However, before you do that, you should understand that some drivers and devices behave differently than others. When the driver module is loaded, the NIC may begin autonegotiation without any way to stop it (particularly with drivers that do not accept parameters). The settings from interfaces are applied at some point after that, which may be right in the middle of the negotiation. So, some people find it necessary to delay the ethtool or mii-tool command by a few seconds. Thus:
iface eth0 inet static address ... netmask ... gateway ... up sleep 5; ethtool -s eth0 ...
Or the analogous mii-tool command. - Reboot the machine to make sure it comes up correctly, and be prepared to intervene manually (e.g. Ctrl-Alt-Del and then boot into single-user mode from GRUB or LILO) if things don't work.
No comments:
Post a Comment