User avatar
malakai
Posts: 1383
Joined: Sat Sep 15, 2012 10:35 am
Contact: Website

Trying to set eth0 to 100 full duplex no autonegotiate

Tue Oct 02, 2012 8:35 pm

Below is the setup but at the end I append /etc/network/interfaces and run sudo ethtool eth0 and it still says auto yes

I used this line in the file:
up sleep 5; ethtool -s eth0 autoneg off speed 100 duplex full

If I run ethtool -s eth0 autoneg off speed 100 duplex full

Then run sudo ethtool eth0

It says auto is off any ideas anyone?

INSTALL SETUP

Install mii-tool and ethtool tools

Install both of these package with following command:

# sudo apt-get install ethtool net-tools
Task: Get speed and other information for eth0

Type following command as root user:

# sudo ethtool eth0

Output:

Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: MII
PHYAD: 32
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: d
Current message level: 0x00000007 (7)
Link detected: yes

Setup eth0 negotiated speed with ethtool:

# sudo ethtool -s eth0 speed 100 duplex full
# sudo ethtool -s eth0 speed 10 duplex half

Putting this into /etc/network/interfaces so it will always be set to 100 full duplex:

# sudo nano /etc/network/interfaces

My file looks like this:

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

add the following at the end:

up sleep 5; ethtool -s eth0 autoneg off speed 100 duplex full

up sleep 5; tells it to wait for the autonegotiation to complete then sets the speed.

Save and quit.
http://www.raspians.com - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)

ski522
Posts: 394
Joined: Sun Sep 30, 2012 2:22 pm

Re: Trying to set eth0 to 100 full duplex no autonegotiate

Wed Oct 03, 2012 5:12 pm

You're probably having the problem because you don't have the full path of where ethtool is located...but that's not really the best way to do that. Do this instead

Code: Select all

cd 
1) sudo nano /etc/init.d/autoneg

#!/bin/bash
/sbin/ethtool -s eth0 autoneg off speed 100 duplex full
exit
[save file]

2) chmod a+x  /etc/init.d/autoneg

3) Run at startup by typing at shell prompt
update-rc.d -f  /etc/init.d/autoneg defaults
I haven't tested this on the Pi, but believe this will do what you're looking for

Nehemoth
Posts: 23
Joined: Tue Apr 02, 2013 1:29 am

Re: Trying to set eth0 to 100 full duplex no autonegotiate

Tue Apr 02, 2013 1:30 am

Did not work for me.

Nehemoth
Posts: 23
Joined: Tue Apr 02, 2013 1:29 am

Re: Trying to set eth0 to 100 full duplex no autonegotiate

Tue Apr 02, 2013 2:04 am

In Debian (also Raspberry pi) this is the way to do it as per document
/usr/share/doc/ethtool/README.Debian

iface eth0 inet dhcp
link-speed 100
link-duplex full
ethernet-autoneg off

works like a charm

Return to “Beginners”

Who is online

Users browsing this forum: No registered users and 49 guests