Network Diagnostics: Finding and fixing problems

Ian! D. Allen – www.idallen.com

Winter 2014 - January to April 2014 - Updated 2018-04-09 10:04 EDT

1 Introduction – Host O/S and VMware usersIndexup to index

This file helps resolve these problems:

The first two sections of this document apply to your host O/S networking. The remainder of the file is for VMware users.

As a system technician you will need to know what kinds of network problems cause what kinds of errors. This is made more complex in a Virtual Machine environment, since problems can occur in both the host machine and in the Virtual Machine as well as the guest O/S, and in the connections between them.

Start with your host machine (the machine running the software that runs your nested Virtual Machines) and work in from there.

2 Check Host Computer NetworkingIndexup to index

Make sure your host machine has a working network connection before you try to fix the network in your virtual machines:

  1. Plug your host computer into a wall socket and disable your host computer wireless network. Wireless is not reliable at Algonquin College.
  2. Make sure your host network cable is plugged in and the Link light (if you have one) is on.
  3. Use a browser on your host to open web pages both on- and off-campus. (Make sure your browser is not simply showing you cached pages! Use SHIFT+Refresh to re-load each page you test.) Use various known host names, e.g. idallen.com, idallen.org, google.ca, gnu.org, youtube.com, etc. Make sure that your system can resolve these names. If you get “unknown host” or “host not found” errors, your host computer DNS is not working and you need to fix that, first. Consult the manual for your host computer and get that working.

2.1 Connecting to Algonquin WirelessIndexup to index

Algonquin College wireless often causes problems. Avoid it. For best results, wire your host machine into the campus network and disable wireless when you are at Algonquin College.

If you must use wireless at Algonquin College, make sure your host computer is connected to the ACSecure wireless network. The Guest network will not let you access everything and connections will abort or time out.

The settings to connect a machine to the Algonquin College ACSecure wireless network are these:

Connection Name (SSID): ACSecure
Wireless Security: WPA & WPA2 Enterprise
Authentication: PEAP (Protected EAP)
CA certificate: none
PEAP version: automatic
Inner authentication: MSCHAPv2
Username: abcd0001       # use your own Algonquin network userid and password
Password: ************

On a Linux machine, the network properties box may look similar to this:

Algonquin College ACSecure


The rest of this file is for debugging VMware and virtual machine problems.



3 Check Host Computer VMware Virtual Wireless AdaptersIndexup to index

If your host computer can load web pages from various places, you know your host computer networking is mostly working. Continue with this section.

If you run a Microsoft Windows O/S, make sure you have enabled all the VMware network adapters in your Network Settings, e.g. vmnet0,vmnet1, vmnet2, vmnet8 (and any others, if present).

Start VMware and open the VMware Virtual Network Editor (in the Edit menu) and confirm that you have both a bridged vmnet0 and a NAT vmnet8 network adapter:

VMware Virtual Network Editor

You may have to pause your virtual machines and restart VMware after making changes to the Windows network adapters. If this doesn’t work, consult a Windows guru.

Use VMware to open the Network Adapter for your virtual machine and make sure it is set to “Connect at power on” and uses a Network Connection of NAT (preferred) or Bridged:

VMware Network Adapter

NAT is preferred, since it lets your Linux machine keep the same IP address no matter to which network your host computer is connected. Using Bridged networking requires you to restart your Linux networking every time you move your computer to a new host network.

4 Check VM IP addressIndexup to index

*This document uses the traditional interface names such as eth0. It doesn’t apply to Linux installations using systemd that use much more complex interface names and different commands to manipulate them.**

Once your host machine has a working network connection, proceed to troubleshooting your Virtual Machine(s) and the virtual Network Adapters.

Before you can use networking, your Linux network adapter (usually called eth0) needs an IP address. Make sure your Virtual Machine has been given an IP address by running ifconfig and looking at the eth0 network device. You are looking for a valid IP address beside inet addr:, e.g.

# ifconfig eth0
eth0  Link encap:Ethernet  HWaddr 00:04:75:8d:6e:52
      inet addr:192.168.9.250  Bcast:192.168.9.255  Mask:255.255.255.0
...

If you don’t have an eth0 visible, check your system log messages and find out which adapter Linux is using. It might be eth1 or some other higher number if you have copied your virtual machine. (See below how to fix your VM to use eth0 again.)

Does the IP address given to your machine seem reasonable for the network your host computer is on? (If you are using NAT networking, the address will be a private one unrelated to your host computer’s network.)

If the address is missing or incorrect, try restarting the network by running (as root): service network restart

5 Refresh VM Networking: Bridged / NATIndexup to index

When you resume a Linux Virtual Machine or change locations, you may need to refresh the network settings for your new location by running (as root): service network restart

If restarting the network doesn’t give you an IP address, try changing your Bridged/NAT networking type and then restarting again.

You must be able to ping your own IP address (the one attached to eth0) successfully:

# ifconfig eth0 | grep 'inet addr'
      inet addr:192.168.9.250  Bcast:192.168.9.255  Mask:255.255.255.0

# ping -c 4 192.168.9.250
PING 192.168.9.250 (192.168.9.250) 56(84) bytes of data.
64 bytes from 192.168.9.250: icmp_req=1 ttl=64 time=0.036 ms
64 bytes from 192.168.9.250: icmp_req=2 ttl=64 time=0.067 ms
64 bytes from 192.168.9.250: icmp_req=3 ttl=64 time=0.057 ms
64 bytes from 192.168.9.250: icmp_req=4 ttl=64 time=0.053 ms
--- 192.168.9.250 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 2997ms
rtt min/avg/max/mdev = 0.036/0.053/0.067/0.012 ms

If you don’t have a working IP address, nothing else will work. You must have an IP address.

6 Missing network interface eth0Indexup to index

If you move or copy a Virtual Machine, VMware will invent a new virtual network interface for the machine, with a new MAC address. This new MAC will cause a Linux virtual machine to think you are using a new network adapter, so it will create a new device such as eth1 for the new MAC, instead of using the default eth0. Since everything has been set up in Linux to use eth0, your networking may break.

To find out which network adapter(s) Linux has found, use:

$ netstat -ia | grep eth
eth2 1500 0 53217 0 0 0 38282 0 0 0

If you see a higher number than eth0, you must follow this link to rename your Linux network interface. (If you use systemd, you have a different network problem, not covered here.)

When you are finished, make sure that ifconfig eth0 doesn’t give any errors.

7 Check VM default gatewayIndexup to index

Once you have a valid IP address on your eth0 network interface for the network you are on, check your default gateway. Run the command ip route and look at the gateway address in the line that begins with default, e.g.

# ip route | grep default
default via 192.168.9.254 dev eth0

Try using ping on that default gateway on eth0:

# ping -c4 192.168.9.254
PING 192.168.9.254 (192.168.9.254) 56(84) bytes of data.
64 bytes from 192.168.9.254: icmp_req=1 ttl=64 time=0.882 ms
64 bytes from 192.168.9.254: icmp_req=2 ttl=64 time=0.760 ms
64 bytes from 192.168.9.254: icmp_req=3 ttl=64 time=0.615 ms
64 bytes from 192.168.9.254: icmp_req=4 ttl=64 time=0.663 ms
--- 192.168.9.254 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3001ms
rtt min/avg/max/mdev = 0.615/0.730/0.882/0.102 ms

(Note that Algonquin College, ping may be blocked from working, so you can’t use it reliably on-campus to test a bridged connection. It should work fine on a NAT connection.)

If you don’t have a working default gateway, nothing else will work. You must have a working gateway.

8 Check DNS resolutionIndexup to index

If you have an IP address and a working gateway, but see failure in name resolution or other DNS-related error, then your system is not able to use a DNS to turn host names into IP addresses.

# host google.ca
;; connection timed out; no servers could be reached

If you can’t ping the DNS servers, your DNS won’t work and you can’t use host names. Try restarting your networking or switching from Bridged to NAT networking. Don’t use wireless!

9 Appendix I – Windows VMware Network Adapter VMnet8Indexup to index

This is from Kevin Jimena: Here are the steps I took to be able to SSH into my CentOS 6.5 using puTTy on Windows 7:

Step 1: From Network and Sharing Center, click the highlighted item (VMware Network Adapter VMnet8).

Windows VMware Network Adapter VMnet8

Step 2: A window called VMware Network Adapter VMnet8 Status appears. Click on the highlighted item (Properties).

Windows VMware Network Adapter VMnet8 Properties

Step 3: Double-click on the highlighted item (Internet Protocol Version 4 (TCP/IPv4)).

Windows VMware Network Adapter VMnet8 IPv4

Step 4: A window called Internet Protocol Version 4 (TCP/IPv4) Properties appears. If “Use the following IP address:” and “Use the following DNS server addresses:” are selected, this is wrong and you must change it:

Windows VMware Network Adapter VMnet8 – Use Address

Step 5: Select “Obtain an IP address automatically” and “Obtain DNS server address automatically”, then click the highlighted item (OK).

Windows VMware Network Adapter VMnet8 – Obtain Address

Hopefully this helps those who are having problems SSH into CentOS 6.

10 Appendix II – Windows VMware Network Adapters: VMnet?Indexup to index

In your Windows host O/S, open up networking and find your VMware Network Adapters with names such as vmnet0 through vmnet8 and make sure none of them are listed as Disabled. Enable them.

Author: 
| Ian! D. Allen, BA, MMath  -  idallen@idallen.ca  -  Ottawa, Ontario, Canada
| Home Page: http://idallen.com/   Contact Improv: http://contactimprov.ca/
| College professor (Free/Libre GNU+Linux) at: http://teaching.idallen.com/
| Defend digital freedom:  http://eff.org/  and have fun:  http://fools.ca/

Plain Text - plain text version of this page in Pandoc Markdown format

Campaign for non-browser-specific HTML   Valid XHTML 1.0 Transitional   Valid CSS!   Creative Commons by nc sa 3.0   Hacker Ideals Emblem   Author Ian! D. Allen