Technology

Step By Step Guide To Troubleshoot One Way Ping Issues in Ubuntu 18.04

We came across a challenge in one of our deployments where we had provisioned the virtual machines and handed them over to the application team to work on deploying their application on the VMs. The issue that we faced is that VM – A was able to ping VM – B but it was happening the other way around.

In scenarios like these, you might think of N number of reasons which could be causing this issue, but we need a structured approach to move ahead with the troubleshooting activity. We faced this issue with an Ubuntu OS-based VM, we will cover the commands and steps used to keep Ubuntu OS in perspective.

Ubuntu

We will cover some commands which might come in handy in troubleshooting this kind of issue. In most of the scenarios, we suspect firewall in a situation like these now it could be either the physical firewall appliance or the OS level firewall. But before moving to the firewall we need to take a quick look at the OS.

Validate the IPv4 Settings

Open the console of the virtual machine which is not pinging and validate the IPv4 settings of the Ethernet interface. Ensure that the same IP address is not being used anywhere else in the network. Use the following command to check the IP addressing information of the VM:

“IP a”

                                                 

Restart the Network Services

If the VM has correct IP addressing information, then there might be an issue with the network services running on the virtual machine. You would want to check the status/start/restart the network services on your virtual machine using the following command:

“Sudo /etc/init.d/networking stop”

“Sudo /etc/init.d/networking start”

“Sudo systemctl status networking”

Reconfigure Netplan File

Ubuntu OS uses a netplan file to store its Ethernet interface networking information. If the netplan file is corrupt, there could be a possibility that it is not letting the virtual machine talk to other machines in the environment.

First, we need to remove the current netplan file that is configured for the virtual machine by following the below-mentioned commands:

“cat /etc/netplan/”

“Sudo -rm /etc/netplan/XYZ.Yaml”

After you have removed the netplan config file, now you need to create a new netplan file that the virtual machine will use for its IPv4 networking information. Use the following command to create a netplan file:

“Sudo nano /etc/netplan/01netcfg.yaml”

Use the following syntax in the netplan config file and enter the information accordingly:

Network:

          Version: 2

          Renderer: networkd

          ethernets: ens160

                DEVICE_NAME:

                       Dhcp4: yes/no

                       Addresses: [IP_Address/Netmask]

                       Gateway: Gateway_IP

                       Nameservers:

                                Addresses: [Nameserver_1, Nameserver_2]

Once the netplan file is created and the above parameters are added in the same format, run the following command to apply the netplan configuration.

Sudo netplan apply

Reinstall the NIC

If the networking service is running properly but the virtual machine is not able to ping another machine, try reinstalling the Network Interface Card on the virtual machine. Log in to the vCenter server and navigate to the virtual machine. Right-click the virtual machine, go to Edit Settings. Remove the current Network Interface Card and add a new NIC on the virtual machine, this might help if in case the NIC would have gone bad.

Verify Firewall Configuration

Another thing that you may want to verify is to check the configuration on your firewall, ensure that there is no specific policy that would stop the traffic to flow from your affected virtual machine to the target machine.

Verify UFW Configuration

Other important information to check in the virtual machine is to see if an Uncomplicated Firewall is in use. If you’re not using UFW then run the following command to check the status of UFW:

“Sudo ufw status”

If UFW is enabled, then run the following command to disable the UFW:

“Sudo ufw disable”

Verify OS Hardening Policies

There could be another reason which could be blocking one ping from one side, check with the application vendor team if they have configured any OS hardening policies which are making a virtual machine to drop all the ping requests.

To sum it up, above mentioned are the high-level steps to resolve one-way ping issues in Ubuntu operating system. If you are looking for infrastructure services deployment as per best practices in your environment then, Zindagi Technologies have a large team of Solution Architects / SMEs who possesses expertise in Planning / Designing / Implementing enterprise scale data centers on SDDC, HCI solutions, etc. For any consulting service to transform your data center reach us now or give us a call at +919773973971.

Author
Sumit Yadav
Data Center Consulting Engineer

Author

Team ZT