Lab 1: Network Troubleshooting Tools Name:

Subject: Network Troubleshooting Tools Approved Lecturer: Jirawat Thaenthong Organization: Faculty of Technology and Environment, PSU, Phuket Campus. Date: 19/5/60 Version: 1.0

Objective: 1. Trainees study and practice network troubleshooting tools. 2. Trainees study case studies and discuss with the others.

Instructions& Prerequisites:

- Trainees should have basic skill of commands. - Linux virtual machine (VirtualBox/VMware)

Task 1: Practice basic network troubleshooting tools

1. Link detection/verification with ‘ethtool’

With this command, we can do much as follows:

• Auto-negotiation • The speed of the device • Display all NIC settings • Display auto-negotiation, RX, and TX settings • Display network statistics for a specific NIC • Troubleshoot ethernet connections • Blink the LED of a specific NIC

1.1. Install ‘ethtool’ package. If you have already, skip this step.

------

$ ethtool –h ß Please verify if you have it or not.

$ apt install ethtool ßInstall ethtool

------

Ubuntu Networking Part I Page 1

Lab 1: Network Troubleshooting Tools Name:

1.2. Verify how many network interfaces you have.

------

$ –a ßList all network interfaces

------

1.3. Detect which network interface connected to LAN

------

$ ethtool enp0s3 ßAssume this interface is connected to LAN.

------

You will see ‘Link detected:

Ubuntu Networking Part I Page 2

Lab 1: Network Troubleshooting Tools Name:

1.4. Show the NIC statistics

------

$ ethtool –S enp0s3

------

If you ethtool reporting-specific errors on a card, there's a problem.

1.5. Locating a specific NIC

------

$ sudo ethtool –p enp0s3 15 ßLED blinking on the specific NIC.

------

It is useful if you have a server with multiple NICs, but you do know which one is correct.

Ubuntu Networking Part I Page 3

Lab 1: Network Troubleshooting Tools Name:

1.6. Testing your NIC

------

$ sudo ethtool –t enp0s3 online

------

Online - tests nvram and a link

Offline - tests register, memory, loopback, interrupt ß Some NIC does not support function

Practice by yourself

Ubuntu Networking Part I Page 4

Lab 1: Network Troubleshooting Tools Name:

2. IP addressing 2.1. When you assign network configuration with ifconfig and route command, If you no longer use temporary network configuration, you can remove or purge with command

------

$ sudo ip addr flush enp0s3

------

2.2. Release IP address assigned by DHCP server

------

$ sudo dhclient –r

------

2.3. Renew IP address from DHCP server

------

$ sudo dhclient enp0s3 ß Assume your computer get IP address on this interface.

------

2.4. Sdf

3. Wi-Fi Troubleshooting 3.1. Wireless connection troubleshooter 3.1.1. lshw command (H/W list)

------

$ lshw

------

3.1.2. lspci command (Wireless PCI)

------

$ lspci

------

Ubuntu Networking Part I Page 5

Lab 1: Network Troubleshooting Tools Name:

3.1.3. lsusb command (Wireless USB adapter)

------

$ lsusb

------

3.2. Increase Wi-Fi Signal Strength. Try this if you have Ubuntu host (not virtual machine). 3.2.1. Install Wireless Tool

------

$ sudo apt install wireless-tools

------

3.2.2. Verify your wireless NIC info.

------

$ ifconfig

------

3.2.3. Increase Wi-Fi signal strength.

------

$ iw reg set BO

$ iwconfig wlan0 txpower 30 ß Assume you have wireless NIC ‘wlan0’

------

Let try

------

$ ifconfig wlan0 down

$ iw reg set BO

$ ifconfig wlan0 up

$ iwconfig wlan0 channel xx ß if needed

$ iwconfig wlan0 txpower 30

------

Ubuntu Networking Part I Page 6

Lab 1: Network Troubleshooting Tools Name:

4. Network monitoring and troubleshooting Normally, we use ‘’ program to overview all the processes or threads running in the system. However, it just the program from the old-style. We have some list of monitoring tools that works for admin as follows: 4.1.

Htop is essentially an enhanced version of top. It comes with visual-style and built-in commands are needed for admin.

4.1.1. Try ‘htop’

------

$ sudo apt install htop

$ htop

------

4.1.2. Test ‘htop’ with F1 – F10

Ubuntu Networking Part I Page 7

Lab 1: Network Troubleshooting Tools Name:

4.2. Try ‘atop’, ‘powertop’, ‘iotop’, and ‘apachetop’

Make your own note.

4.3.

iftop is similar to top, but it concerns only to network traffic on selected network interfaces and displays a table of current usage. You can find the answer why your Internet is very slow sometime.

4.3.1. Try ‘iftop’

------

$ sudo apt install iftop

$ sudo iftop

------

Ubuntu Networking Part I Page 8

Lab 1: Network Troubleshooting Tools Name:

4.3.2. Toggle ‘t’ to see what’s happening?

Ubuntu Networking Part I Page 9

Lab 1: Network Troubleshooting Tools Name:

4.4. nethogs

Nethogs display network traffic per protocol or per subnet.

4.4.1. Try ‘nethogs’

------

$ sudo apt install nethogs

$ sudo nethogs

------

4.5. Try ‘ntopng’ and ‘jnettop’,

Make your own note.

Ubuntu Networking Part I Page 10

Lab 1: Network Troubleshooting Tools Name:

4.6. Bmon

Bmon monitors and helps you debug networks. You can also interact with bmon through curses or through scripting.

4.6.1. Try ‘bmon’

------

$ sudo apt install bmon

$ sudo bmon

------

, toggle with ‘d’, ‘l’, and ‘i’ to see more details on screen.

Ubuntu Networking Part I Page 11

Lab 1: Network Troubleshooting Tools Name:

4.7.

MTR combines the functionality of and the ping tool into a single network diagnostic tool. It keep repeats every second to monitor the path between source and destination host.

4.7.1. Try ‘mtr’

Normally, you don’t need to install. It should come with your current Ubuntu version (16.04)

------

$ mtr www.google.com

------

Ubuntu Networking Part I Page 12

Lab 1: Network Troubleshooting Tools Name:

Task 2: Discussion and sharing experiences

Self-Study:

You have to repeat all tasks in lab sheet several times to understand the solution. down your own report and share with your friends.

Remark: Do activity by yourself. Good Luck

Ubuntu Networking Part I Page 13