Network Connectivity Checking Procedures and Techniques
Network Connectivity Checking Procedures and Techniques
Objectives
▪Connect network segments that use different media types (for instance, thin coax and
unshielded twisted pair [UTP])
▪Segment the network to reduce traffic without dividing the network into separate IP
subnets
Discussion
Telnet
Telnet is a good command to start your network connectivity tests. Open a command prompt on your
server (e.g. cmd.exe or Powershell on Windows and a console or SSH session in Unix) and execute
the following:
Note for Windows 7 users, you may have enable the Telnet client/command. To enable telnet on Windows
7, search in the start menu for “Turn Windows features on or off”. Click into that menu item and turn on
the “Telnet client”.
$ telnet justintung.wordpress.com 80
If there is connectivity from the source server to the destination, the telnet session should begin. On
Windows and Unix, a blank screen or area should appear with a prompt. If there is no connectivity, it
will just hang after the telnet command like the following:
Connecting To <destination_server>…
Routing issues – Try a ping to the destination server (ping <destination>). Hopefully the ping is
successful, if not check the netstat -rn to examine gateways used for routing. It could be that a
static/alternatve route needs to be created to the destination server using an alternative gateway.
Network infrastructure down – It is possible a piece of the network on the path to your destination
server is down.
Incorrect information in telnet command – Make sure the IPs or fully qualified domains you are
using in telnet are correct.
Terminology
<source_server> is the server we are coming from and where the command is being executed on
the operating system. The firewall should be opened from the source server and its source
ports to the destination server and its destination ports.
<destination> is the destination server IP or fully qualified domain name (FQDN). The IP should work
whether you are using an IPv4 or IPv6 address. However, if you are testing IPv6 connectivity, it is
likely you will use a FQDN due to the long length of IPv6 addresses.
<destination_port> is the port on the destination server you are trying to get to. The destination
server should be listening on this port. The following command (netstat -a) can be used on the
destination server to check if the port is listening and you should be looking for the port after the IP
address and whether its state is listening:
$ netstat -a
b. If telnet fails:
Check if static routing is done in source server routing table. Make sure routing goes to the correct
default gateway and ping default gateway to check if it works.
/usr/sbin/traceroute
to destination server and check for default gateway (assuming devices along the way do not have
ICMP blocked).
The use of Wireshark, TCPdump, or similar tools for network protocol and packet analysis on the
source and/or destination servers and firewalls will aid in the troubleshooting by checking for
abnormalities or errors in packets.
Analyzing application logs
If you are working with applications that need the network connectivity, you can enable verbose
logging on the application. When testing web services, you can enable logging for protocol level
APIs. For example, if a Java application is a web service client and is connecting to the web service
endpoint, we could enable logging of the HTTP implementation in Java via JVM arguments or look at
the verbose logging of the Java SSL or Java Secure Socket Extension (JSSE) APIs.
Ping
USING PING TEST ON MICROSOFT WINDOWS
Pinging a2s78.a2hosting.com
[216.119.143.98] with 32 bytes of data:
To use the ping program on Mac OS X and Linux, follow these steps:
3. ping example.com
4. Press Ctrl+C to stop ping after a few tests run, and then interpret the
output:
tracert example.com
3. Interpret the output from tracert:
Trace complete.
You can examine the times between each hop to look for places
where the connection “hangs”. In some cases, tracert may also
time out, which is indicated by an asterisk (*).
USING TRACEROUTE ON APPLE MAC OS X AND LINUX
3. traceroute example.com
4. Interpret the output from traceroute:
To list out all vailable switches of netstat command run the following command:
netstat -h
Output:
netstat -at
Output:
netstat -au
Output:
netstat -a
Output:
The above command shows you all connections from different protocols like tcp, udp
and unix sockets.
netstat -l
Output:
Output:
netstat -lu
Output:
Output:
netstat -i
Output:
The above command displays information in a very raw format. To get more information
run the following command:
netstat -ie
Output:
##Displaying RAW Network Statistics You can use the following command to display
the raw network statistics:
Output:
Ip:
72893 total packets received
0 forwarded
0 incoming packets discarded
72888 incoming packets delivered
83458 requests sent out
8 outgoing packets dropped
16 dropped because of missing route
Icmp:
493 ICMP messages received
0 input ICMP message failed.
ICMP input histogram:
destination unreachable: 493
927 ICMP messages sent
0 ICMP messages failed
ICMP output histogram:
destination unreachable: 927
IcmpMsg:
InType3: 493
OutType3: 927
UdpLite:
IpExt:
InNoRoutes: 4
InMcastPkts: 161
OutMcastPkts: 177
InBcastPkts: 366
OutBcastPkts: 355
InOctets: 36976311
OutOctets: 10651904
InMcastOctets: 21555
OutMcastOctets: 22195
InBcastOctets: 60984
OutBcastOctets: 57358
InNoECTPkts: 72893
netstat -g
Output:
netstat -c
Output:
netstat -nlpt
Output:
You can also list process name with uid by running the following command:
netstat -ltpe
Output:
The above command is very useful to get the username/uid owning that particular
process. It is also contains the username and inode of the process. This is a very useful
command for network administrators.
Disable Reverse DNS Lookup for
Faster Output
When you run the netstat command, it tries to find out the hostname of each ip address
in the connection by doing a reverse dns lookup, this will slows down the output. If you
need to know only ip address then ignore the hostname lookup by running the following
command:
netstat -ant
Output:
netstat -na
Output:
To display only active connections to the server on port 80, run the following command:
Output:
If you want to find out how many active SYNC_REC are occurring on the server, run the
following command:
You can also detect a single flood by allowing you to recognize many connections
coming from one IP by running the following command:
To list out all the unique IP addresses of the attacker that is sending SYN_REC
connections, run the following command:
sudo netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
To calculate and count the number of connections each IP address makes to the server,
run the following command:
sudo netstat -anp |grep 'tcp|udp' | awk '{print $5}' | cut -d: -f1 | sort |
uniq -c | sort -n
TO list out the number of connections the IPs are connected to the server using TCP or
UDP protocol, run the following command:
sudo netstat -ntu | grep ESTAB | awk '{print $5}' | cut -d: -f1 | sort | uniq
-c | sort -nr
You can also list out only ESTABLISHED connections instead of all connections, and
displays the connections count for each IP by running the following command:
The first step is to power cycle everything and checks your other devices. It
might be as simple as rebooting your device so it can reconnect with the
network. Restarting your device can fix many issues. If you played video
games when you were younger (or maybe you’re like myself and still do),
I’m sure you tried turning your gaming system off and on when it wasn’t
working, and somehow magically it worked after that. This should be your
first plan of action when troubleshooting.
Once you’ve restarted your device, try connecting another device as well. If
you are having trouble connecting other devices, it could be an equipment
issue or your Internet service provider. If you find that it’s just one device
that’s having problems, you can start narrowing down the problem from here.
Next, check your firewall settings to see if it’s blocking the Internet
connection. Running an anti-virus scan can also confirm your computer does
not have any malware affecting the connection. Lastly, try using a different
Internet browser to see if something wrong with your default browser.
The second step is to check your physical connections. If you are still having
network problems after rebooting your system, the next step is just as easy
and simple. Make sure your physical connections are still plugged in and
aren’t damaged. If you are using an Ethernet cable to connect your router,
there might be a physical wireless switch, make sure that is switched to on.
At this point, make sure all the lights are flashing the way they should (many
routers and modems have a green flashing light indicating it’s connected
properly. If the lights aren’t blinking the correct color (or no color at all),
your device may be dead. If the light is red, it may be a problem with the ISP.
The third step is to run the Windows network troubleshooter program. There
are built-in troubleshooter programs that are included in Windows. These
programs can automatically search for and fix issues within your system. Try
running the program, and if it finds and fixes the problem, it will let you
know. If it does, try connecting to the network again. Some of the best
network troubleshooting programs are free and easy to use.
The fourth step is to check for a valid IP address. If you’ve gone through all
of these steps and you are still having trouble connecting to the network, you
will need to specifically locate the exact spot where the connection is failing.
In this step, make sure your device isn’t set to any abnormal IP settings.
Under Settings, to go Network & Internet Status. At the bottom of the menu,
click on Change adapter options and click on the name of your network.
When the status box appears, click on the Properties button. After you have
done this, click on Internet Protocol Version 4. Make sure the Obtain an IP
address automatically and Obtain DNS server addresses automatically are
both checked. Follow these same steps for Internet Protocol Version 6 as
well.
After these steps, review the validity of your IP Address. Type “cmd” into the
start menu to open the Command prompt window and enter “ipconfig.” Next,
look for Ethernet adapter or Wireless LAN adapter. If it says you are not
receiving a valid IP address from your router, and it says 169.x.x.x, there are
two commands that will release your computer’s current IP address and
request a new one—ipconfig / release and ipconfig / renew.
If this doesn’t work after a couple of attempts, try connecting your computer
directly to the modem by an Ethernet cable. If this works and you are online,
the problem is your router.
The fifth step will be trying to Ping and Trace its Route. If your IP doesn’t
begin with 169 (when you run ipconfig), you know you have a valid IP
address from your router. This means the failure is happening between the
router and the Internet. Pinging and tracing the route will be the next step.
The sixth and final step is to contact your Internet Service Provider. If
you’ve reached this step, this means your equipment is working fine, and you
have a valid IP address from the router. You have also confirmed that the
issue is happening outside of the network for multiple devices. While you are
contacting your ISP, you can also check an outage map on your smartphone
by going to downtector.com. This may give you information if there are
known problems in your area.
Once you have contacted your ISP, waiting until they fix the problem may be
your only choice left. You have completed all the steps and can confirm the
problem isn’t something you can fix so all you can do is wait.
Conclusion
Problems connecting to your network can be one of the most frustrating
things, especially if you are working on the computer often. Understanding
the common connectivity issues can be beneficial when it comes to
troubleshooting. There are some good tools you can use to narrow down your
network problems. And if you are still having trouble getting yourself online,
follow the steps above to get your computer back up and running.
Evaluation
True or False
1. When you run the netstat command, it tries to find out the hostname of
each ip address in the connection by doing a reverse dns lookup.
3. To list out all listening port run the following command: use this netstat -3
4. If you have exhausted the steps outlined above and there is still no
connectivity … you may have to use logging tools and applications traces.
8. Running an anti-virus scan can also confirm your computer does not
have any malware affecting the connection
9. If you are working with applications that need the network connectivity
10. The fifth step will be trying to Ping and Trace its Route
Answer Key
1. True
2. False
3. False
4. True
5. False
6. False
7. True
8. True
9. True
10. True
Reference
https://www.colocationamerica.com/blog/network-troubleshooting-steps
https://hostpresto.com/community/tutorials/netstat-command-line-tips-and-tricks/
https://www.a2hosting.com/kb/getting-started-guide/internet-and-networking/troubleshooting-network-
connectivity-with-ping-and-traceroute
https://justintung.com/2010/12/03/network-connectivity-troubleshooting-step-by-step-with-commands/
https://www.sciencedirect.com/topics/computer-science/network-connectivity