4.21.2015

Moderating Network speeds in LINUX




Linux gives you the scope of moderating the Speeds of the LINUX OS

First we need check for our card if it is suitable attaining the sped we are about to set. Wrong settings may lead you to getting hardware problems.

configuration files:

/etc/sysconfig/network-scripts/ifconfig-eth0 (your NIC card)

we can use

1. MII TOOL
2 .ETHTOOL

 use # ethtool eth0  -> to get network speed info

we can use  MII TOOL for moderating speeds

In computingmii-tool is a Unix command which allows users to query and modify Network Interface Controller (NIC) parameters.

Setup eth0 negotiated speed with mii-tool
Disable autonegotiation, and force the MII to either 100baseTx-FD, 100baseTx-HD, 10baseT-FD, or 10baseT-HD:# mii-tool -F 100baseTx-HD
# mii-tool -F 10baseT-HD
Setup eth0 negotiated speed with ethtool# ethtool -s eth0 speed 100 duplex full
# ethtool -s eth0 speed 10 duplex half




Ethtool command has successfully replaced the mii-tool command. Using command you can find out all details about the interface given as its argument.
# ethtool eth0
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: No
Speed: 100Mb/s
Duplex: Full
Port: MII
PHYAD: 1
Transceiver: internal
Auto-negotiation: off
Supports Wake-on: g
Wake-on: g
Current message level: 0x00000007 (7)
Link detected: yes
In above output we can see interface eth0 not doing autonegotiation and set to a speed of 100 Mbps, full duplex. A list of supported modes is also provided at the top of the output.
NIC speed and duplex can be set as:
# ethtool –s eth0 speed 100 duplex full
# ethtool –s eth0 speed 10 duplex half
To have these setting during next boot, you need to set them with ETHTOOL_OPTS variable as follows:
# Vi /etc/sysconfig/network-scripts/ifconfig-eth0
DEVICE=eth0
IPADDR=192.168.100.11
NETMASK=255.255.255.0
BOOTPROTO=static
ONBOOT=yes
ETHTOOL_OPTS="speed 100 duplex full autoneg off"
You can test the settings by shutting down the interface and then activating it again with ifup and ifdown commands.
You can also change speed and duplex mode using –s option as follows:
# ethtool –s eth0 speed 100 duplex full autoneg on


0 comments:

Post a Comment