SUSE Conversations


Hard-Code Speed and Duplex Settings for NICs



By: coolguys

April 20, 2006 12:00 am

Reads:3,061

Comments:2

Score:Unrated

Print/PDF

PROBLEM: Permanently forcing the link speed and duplex settings of a network card in SUSE.

SOLUTION: For a system that will be network attached long term it is best practice to hard code the link speed and duplex setings on the nic(s) in the system to match the switch port settings. This prevents allignment errors, runts, FCS and other errors from occuring on the switch when the system autonegotiates network settings.

To turn off autosensing and permanently force the link speed and duplex of a network card in SUSE:

Edit the file /etc/sysconfig/network/ifcfg-eth-id-<MAC Address of NIC>.

For systems with multiple NIC’s there will be a file for each card with it’s MAC address integrated in to the file name. Each has to be edited for the settings to be permanent, per card.

Open the file(s) for editing and add the following line to the bottom of the file.

POST_UP_SCRIPT=settings-id-<MAC Addresses of the NIC>

Save the file.

Next, create a small script in the /etc/sysconfig/network/scripts directory:

Call it whatever you like and save it with a .sh extension. It will be executed whenever the system is started.

For example to force 100/FULL add the following to the script.

#!/bin/bash
ethtool –s eth0 duplex full speed 100 autoneg off
#end

One script with multiple lines is adequate to activate the settings for each card. eth0 is for the first NIC, eth1 would be for the second, etc..

Remember everything is case sensitive. Reboot the server, and have the switch port checked. it should be free of autonegotiation errors.

0 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 5 (0 votes, average: 0.00 out of 5)
You need to be a registered member to rate this post.
Loading...Loading...

Categories: Uncategorized

Disclaimer: As with everything else at SUSE Conversations, this content is definitely not supported by SUSE (so don't even think of calling Support if you try something and it blows up).  It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.

2 Comments

  1. By:Anonymous

    To my humble opinion, there is an easier way to hard-code the settings for an interface:
    in the file: /etc/sysconfig/network/ifcfg-eth-id-“MAC address”
    put a variable ETHTOOL_OPTIONS and assign the necessary settings
    e.g.
    ETHTOOL_OPTIONS=’autoneg off speed 100 duplex full’

    Like this there is no hassle with extra scripts.

    Greetings
    Ph. Vervoort

  2. By:Anonymous

    Is there a white paper or something to reference this best practice? I thought that the only “standard” was autoneg. There was never a specific “how” for vendors to implement hardcoded speed/duplex, unlike autoneg, which was clearly defined for vendors.

Comment

RSS