How to change network card speed and duplex settings in ubuntu

Sponsored Link
If you want to change speed and duplex of your network card you have to use ethtool or mii-tool.

ethtool can be used to query and change settings such as speed, auto- negotiation and checksum offload on many network devices, especially Ethernet devices.

In ubuntu if you want to use mii-tool you have to install net-tools package.

Net-tools package includes the important tools for controlling the network subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp, nameif and route. Additionally, this package contains utilities relating to particular network hardware types (plipconfig, slattach, mii-tool) and advanced aspects of IP configuration (iptunnel, ipmaddr).

In the upstream package ‘hostname' and friends are included. Those are not installed by this package, since there is a special "hostname*.deb".

Install required packages

sudo apt-get install ethtool net-tools

First you need to find the existing network card speed for this you can use the following command

ethtool eth0

Once you have the current speed and duplex details you can change using the following commands

If you want to setup eth0 10 or 100 or 1000 speed with ethtool try this

sudo ethtool -s eth0 autoneg off speed 10 duplex half

sudo ethtool -s eth0 autoneg off speed 100 duplex full

sudo ethtool -s eth0 autoneg off speed 1000 duplex full

If you want to make it permanent you have to add following lines to /etc/network/interfaces file

gksudo gedit /etc/network/interfaces

Add the following line

pre-up /usr/sbin/ethtool -s $IFACE autoneg off 100 duplex full

Save and exit the file

You need to restart networking services using the following command

sudo networking restart

Sponsored Link

You may also like...

5 Responses

  1. Jerad says:

    Funny that this comes along a month after we had to manually set negotiation, duplex, and speed after the Cisco Router we use didn’t let the firewall auto-detect.

  2. Lvcoyote says:

    Wont work here, I get the following when running ethtool eth0 in terminal…….and I did check that my wired connection is indeed eth0.

    Settings for eth0:
    Cannot get device settings: Operation not permitted
    Cannot get wake-on-lan settings: Operation not permitted
    Current message level: 0x00000033 (51)
    Cannot get link status: Operation not permitted

  3. Cosmin says:

    @Lvcoyote type sudo ethtool eth0, and then enter your sudo password.

  4. shan says:

    thanx for howto but does not work for me on 14.04 maybe my NIC is damaged

    in any case

    sudo service network-manager restart

    is now the way to restart; the older way no longer works

  5. Eglefino says:

    eglefino@EglefinoPC:~$ ethtool enp6s0
    Settings for enp6s0:
    Supported ports: [ TP ]
    Supported link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    Supported pause frame use: No
    Supports auto-negotiation: Yes
    Advertised link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    Advertised pause frame use: Symmetric Receive-only
    Advertised auto-negotiation: Yes
    Speed: 1000Mb/s
    Duplex: Full
    Port: Twisted Pair
    PHYAD: 0
    Transceiver: internal
    Auto-negotiation: on
    MDI-X: Unknown
    Cannot get wake-on-lan settings: Operation not permitted
    Current message level: 0x00000033 (51)
    drv probe ifdown ifup
    Link detected: yes

    Is there a command to tell the Unix distro (Ubuntu for me) to get wake-on-lan working as it belongs and tell me what is the problem as it is working as now. Where can I find more information, because more people have the same problem as I, but I found no examples to get the right solution. This error I have maybe for 3-years now.

Leave a Reply

Your email address will not be published. Required fields are marked *