Archive

Archive for the ‘Network’ Category

Viewing and changing netword card setting

July 5th, 2009 1 comment
Print Friendly, PDF & Email

Checking our network card current setting

There are two commands that we can use to check our current network card setting. The first command is “mii-tool”, it  has been around almost since the beginning of Linux and will be depreciated in the future version of Linux. If we don’t specify any parameter to the “mii-tool” command, we will get one line of information per network card. It will display the current speed of the network card, the duplex mode it’s using and if you have a link or not.  If we don’t have a link up (no link) and it is suppose to be, I suggest to verify that your cable is connected to the server and that the port on the network switch is activate.  If this is the case, you may want to try another network cable and see if the link come up.

# mii-tool
eth0: 100 Mbit, full duplex, link ok
eth1: 100 Mbit, full duplex, no link
#

If we add the verbose parameter (-v), we will get some additional information about each network card.

# mii-tool -v
eth0: 100 Mbit, full duplex, link ok
 product info: vendor 00:aa:00, model 50 rev 0
 basic mode:   100 Mbit, full duplex
 basic status: link ok
 capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
 advertising:  100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
eth1: 100 Mbit, full duplex, no link
 product info: vendor 00:10:18, model 23 rev 6
 basic mode:   100 Mbit, full duplex
 basic status: no link
 capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
 advertising:  100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
#

I would suggest using the “ethtool” command instead of the depreciated “mii-tool”. The “mii-tool” may not work with some of the newer network card and  may be excluded from future version of RedHat/Centos/Fedora. With the “ethtool” command,  we need to specify the name of the interface that we want to see the current state. In all of our example, we will use the interface “eth0”.

# 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
#

Read more…

Categories: Network

Adding and removing IP aliases

April 20th, 2009 No comments
Print Friendly, PDF & Email

You need to add an IP address on interface eth0 ? Use the following command to activate it.

ifconfig eth0:1 192.168.1.177 netmask 255.255.255.0

Now you want to delete it ? No problem, use the following command ;

ifconfig eth0:1 del 192.168.1.177

You can also create a file /etc/sysconfig/network-scripts/ifcfg-eth0:1 to have the IP automatically come up upon reboot.

# cat /etc/sysconfig/network-scripts/ifcfg-eth0:1
TYPE=Ethernet
# Device Name
DEVICE=eth0:1
# Boot Protocol none,bootp,dhcp
BOOTPROTO=none
# IP Address
IPADDR=192.168.1.177
# Netmask
NETMASK=255.255.255.0
# Normal user cannot activate/deactivate it
USERCTL=no
# IPv6 Actvated
IPV6INIT=no
# Use the parent interface
ONPARENT=yes
# yes = Modify /etc/resolv.conf if DNS directive is set
#       If using DCHP, then yes is the default
# no  = Do not modify /etc/resolv.conf
PEERDNS=no
Categories: Network

Identify what network port is eth0 ?

April 12th, 2009 2 comments
Print Friendly, PDF & Email

You have two network cables plug in the back of a server and you want to know which one is eth0? Use the following command and the interface light will start blinking (for 10 seconds) on the chosen adapter.

# ethtool -p eth0 10

This command can be run without disturbing the traffic on the interface.

Categories: Network