| 2 comments ]

Basic Ethernet Tools and Troubleshooting

Basic tools which generally span across all versions of Linux.

Before I try anything, why are command line commands metioned here ?

Command lines in Linux are not needed these days but are still very powerful for many reasons. Many of the commands here will require you to become root, administrator user. The steps are as follows:

  1. Right mouse click on the desktop and select the option "Open Terminal" (or locate the terminal icon from the menu)
  2. Switch to the "administrator" account using the following su - command:
    su -
    Password ********


What are the absolute hardware basics needed for a connection?

In order for Ethernet to work properly, your card must be functional by havig driver loaded into memory, a hardware link to a network device (i.e. router), and an assigned IP Address. For Wireless connections it is only slightly different, the hardware connection is being made over the air opposed to cable which requires that your radio device be turned on, being within range of a network device (i.e. WAP), and an assigned IP address. Another difference with wireless is that it is usually protected from unwarrented use with encryption codes, this information would have to be obtained from the person who administrates the device.

A good way to visually determine if the basics are working is to at the very least check for blinking green/orange lights where the Ethernet cable is plugged into the computer or that the Wireless lights are blinking. If neither of these show any activity, it may be prudent to confirm there are no hardware problems with your system or the network device before looking into any other potential issues.

A couple of hardware related commands are:
Networking Command Example(s) Details
ethtool ethtool -i eth0 Print the driver being used for eth0
mii-tool mii-tool eth0 Shows connectivity details between PC and network device over Ethernet cabling
ip ip link show List network interfaces, and connection status
iwconfig iwconfig will list wireless information showing if it is functional or not
iwlist iwlist scan List wireless networks in range


What is eth0, How do I figure out which device is what ?

Each device is assigned a name, for example the first Ethernet card configured is called eth0, the next card eth1, and so forth. In many Laptop systems, the Ethernet wired port is eth0 and the Wireless port is either eth1. However, the wireless connections can have other names such as ath0 (for atheros cards), wlan0, etc. etc. to read all of the devices on your system, use the following commands:

Commands which will show interface name and other information:

Networking Command Example(s) Details
ip ip addr show List addresses for interfaces
ifconfig ifconfig List addresses for interfaces


How do I find my IP Address ?

The IP Address is your system's "mailing address" for the Internet and is usually managed by a networking device which hands it to your system seamlessly. The protocol for that is called DHCP, as in "my DHCP address".

Taskbar - Using the Network taskbar icon.

  1. Right mouse click on Network Icon available on task bar (Dialogue box will open)
  2. Click on the Connection Information option:
  3. Dialogue box "Connection Information" will popup containing the relevant information.

Command line - Using the terminal session to obtain IP information

Networking Command Example(s) Details
ip ip addr show List addresses for interfaces
ifconfig ifconfig List addresses for interfaces


My Wired Ethernet connection does not seem to be functioning, what can I do?

In some cases the network manager which handles networking could fail to operate in some way, other times DHCP servers fail to hand out addresses. The easiest thing to do is to try to get an address or reboot the machine:

Useful address acquiring commands:
Networking Command Example(s) Details
ifdown ifdown eth0 Brings down a device if running
ifup ifup eth0 Brings up an interface and IP
dhclient dhclient eth1 Assign an IP Address via DHCP to eth1
service network restart service network restart Restarts the major networking components
service NetworkManager restart service NetworkManager restart restarts the main networking manager


How do I test my Network connection properly ?

Most of the time users will simply see if a website works such as http://www.google.com/. If that fails, a more comprehensive testing method would involve pinging local subnet IPs first such as DNS servers, then using ping to see if your system can handle hostnames, then trying to ping an external website.

Generic testing:
  1. ping an external website: ping www.google.com, if that fails,
  2. Based off of your assigned IP (i.e. 192.168.0.18) ping a local LAN ip address on you subnet: ping 192.168.0.1 or another machine or known device.
    • If these local IP based pings fail, your system is configured incorrectly for this subnet. Try to obtain an ipaddress again using ifdown/ifup, or dhclient commands.
  3. If you are able to ping IP's, try pinging your DNS Servers:
    • Get your DNS servers from an administrator, another system, or by tying the following command:
      cat /etc/resolv.conf
      nameserver 9.0.4.1
      nameserver 9.0.3.1
    • Try pinging with : ping 9.0.4.1
    • This infers that you can ping systems by IP address outside of your current subnet, things are looking good. If this fails then you don't have a problem with you IP address but your routing information is incorrect.

  4. Finally try pinging Internal and External Websites: ping w3.ibm.com, ping www.google.com
    • From here you can tell if it's a network issue getting to the Internet or something. Basically at this point if there are problems, it's most likely out of your hands, contact networking support and provide details.


My Wireless applet is missing, how do I get it back?

  • Check to see if the applet is running with: ps -ef | grep nm-applet , if it returns "nm-applet --sm-disable" then it is running. If not try issuing the command 'nm-applet --sm-disable' to start it again.
  • Restart the networking services:
    Networking Command Example(s) Details
    service NetworkManager restart service NetworkManager restart restarts the main networking manager
    service network restart service network restart Restarts the major networking components


Is there a way to setup wireless from the command line ?

Usually the graphical wireless applet running on the task bar is sufficient, sometimes for testing purposes using the command line can help. For instance, you could use iwlist scan to look for networks, and iwconfig to setup the SSID, encryption, and password.

Useful Wireless commands:
Networking Command Example(s) Details
iwconfig iwconfig eth1 Show status of wireless interface eth1
iwconfig eth1 rate 1Mb/s fixed Manually set wireless interface speed
iwconfig eth1 essid linksys Manually set the wireless network SSID to linksys
iwconfig eth1 enc feedfeedfe Manually set the encryption to the 64-bit HEX key feedfeedfe
iwlist iwlist scan List wireless networks in range
Example - Setting up a network called home-linux, with 64-bit Hex encryption:
iwlist scan    (optional)
iwconfig eth1 essid home-linksys
iwconfig eth1 enc feedfeedfe
ifup eth1 (or) dhclient eth1


What configuration files are associated with basic networking?

There are basically 4-5 configuration files in a Linux system, these files can be looked at and configured manually if need be with a text editor such as: gedit .

File Name Location Details Example
hosts /etc/hosts Hosts contains the system's hostname entry. When setting
up a hostnamefor your system, include an entry for it
in the hosts file.
# Hostname set to HELLO
127.0.0.1 localhost.localdomain localhost
127.0.0.1 HELLO.fishkill.ibm.com HELLO
resolv.conf /etc/resolv.conf contains the DNS nameservers, usually automatically assigned
by a DHCP server.
# example for fishkill.ibm.com subnet
search fishkill.ibm.com ibm.com
nameserver 9.0.4.1
nameserver 9.0.3.1
network /etc/sysconfig/network Usually sets the hostname value, and some other info. # example network file:
HOSTNAME=HELLO.fishkill.ibm.com
ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0 sets up the interface for DHCP or static addressing #example DHCP config
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=dhcp
HWADDR=00:1c:25:7c:xx:xx


I've installed a new Ethernet Card or put my Linux install into a new system and the Ethernet does not work ?

Each Ethernet card has a Unique MAC address given to it, what you will need to do is manually remove the old MAC address from the configuration. This can be done using the graphical network utility or from the command line:

  1. Open the file:
    su -
    gedit /etc/sysconfig/network-scripts/ifcfg-eth0 &
  2. Then locate the line which contains HWADDR=xx:xx:xx:xx:xx:xx and either remove this line or replace the MAC address with the one from the new card.
  3. Save and close the file. Restart the network.

2 comments

deepak singh said... @ November 25, 2016 at 11:21 PM

Thanks for providing this informative information you may also refer.
http://www.s4techno.com/blog/2016/07/12/fix-grub-issue-of-dual-boot-between-linux-and-windows/

deepak singh said... @ November 26, 2016 at 12:37 AM

Thanks for providing this informative information you may also refer.
http://www.s4techno.com/blog/2016/07/12/fix-grub-issue-of-dual-boot-between-linux-and-windows/

Post a Comment