Welcome to Server Circle. It's a friendly site and all levels of experience are welcome. Be aware that we use cookies for your login.
Server Circle - Ask questions about Servers and get answers from experts.
Beta (0.08 sec)
Ethtool question

Isn't there a more graceful way of setting NIC speed and duplex parameters at boot time than with ethtool in an init.d script ?
Asked by:
TomPating
1355 points
 Report Abuse
 Share Page - Category: Fedora Linux - Tags: ethtool question
 Enter your response
Please use Pastie.org to paste lengthy code or to fix formatting issues with code
  • Responses in reverse (2)

Debian or Ubuntu Linux permanent settings

Under Debian or Ubuntu Linux just create a script as follows:

# vi /etc/init.d/100Mbs

OR

$ sudo vi /etc/init.d/100Mbs

Append following lines:

#!/bin/sh

ETHTOOL="/usr/sbin/ethtool"

DEV="eth0"

SPEED="100 duplex full"

case "$1" in

start)

echo -n "Setting eth0 speed 100 duplex full...";

$ETHTOOL -s $DEV speed $SPEED;

echo " done.";;

stop)

;;

esac

exit 0Save and close the file. Setup executable permission:

# chmod +x /etc/init.d/100MbsOR$ sudo chmod +x /etc/init.d/100Mbs

Now run script when Debian or Ubuntu Linux boots up. Use update-rc.d command install System-V style init script links:# update-rc.d 100Mbs defaultsOR# sudo update-rc.d 100Mbs defaults Output:

Adding system startup for /etc/init.d/100Mbs ...

/etc/rc0.d/K20100Mbs -> ../init.d/100Mbs

/etc/rc1.d/K20100Mbs -> ../init.d/100Mbs

/etc/rc6.d/K20100Mbs -> ../init.d/100Mbs

/etc/rc2.d/S20100Mbs -> ../init.d/100Mbs

/etc/rc3.d/S20100Mbs -> ../init.d/100Mbs

/etc/rc4.d/S20100Mbs -> ../init.d/100Mbs

/etc/rc5.d/S20100Mbs -> ../init.d/100Mbs

Reboot the system to take effect or just type script name:

# /etc/init.d/100Mbs startOR$ sudo /etc/init.d/100Mbs start

Response by:
jalal
3623 points
Assuming you want eth0 to be 100 meg full duplex ...

in /etc/sysconfig/network-scripts/ifcfg-eth0

add/ammend:

ETHTOOL_OPTS="speed 100 duplex full autoneg off"

Response by:
_SteveWilson ...
4290 points


  • Related Questions
About Us : Contact Us : Etiquette : Terms : CDN Failover : ShorterURL : CDN Fallback : © 2013 Server Circle