Search code examples
network-programmingportpingubuntu-18.04esxi

Interface blocking connections after random amount of time in Ubuntu 18.04 (Guest on ESXi 6.7)


This week I was very busy deploying a new server for our Webapp. It is dedicated Hardware with VMWare ESXi 6.7u1 running on it. I'm not having any connectivity issues with the host system.

Now, I have installed a Guest-Host with Ubuntu Server 18.04.3 and set everything up. I did install all needed components for the webapp and also configured the network.

This works just fine for a few minutes or hours. I can ping, I can reach external Network. The server also can be pinged and responds as it should.

I can access the webapp via the browser and https (Port 443), I can access the server via SSH (Port 22). So really, everything is just working as it should.

But....

Occasionally, the server closes all connections on all ports. I still can ping it and get responses as it should, but I can't connect to the server or webapp anymore.

There is no firewall running (ufw inactive) and iptables is set to accept connections as it does by default.

$ sudo ufw status
Status: inactive

$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target   prot opt source     destination

Chain FORWARD (policy ACCEPT)
target   prot opt source     destination

Chain OUTPUT (policy ACCEPT)
target   prot opt source     destination

I also pretty much can rule out, that the ESXi Host is blocking anything, since I did setup a second Guest with Windows 10 and put it in the same VMNetwork as the Ubuntu Server. Once this blocking happens, I can't reach the server from the Windows-Guest either. Neither can I from an outside network.

The strange thing is, that after a few minutes, suddenly, connecting is possible again and the webapp responds as well. This does not happen every time. I then have to restart the interface on the server and everything starts working again as it is supposed to.

$ sudo ip link set ens160 down && sudo ip link set ens160 up #After this command, the server is responding on Ports 22, 80 and 443 again.

I really tried a lot and just can't determine the issue. I thought of packet collisions, but I couldn't find any.

(Just to mention: I tried to set up 3 different Ubuntu-Servers and all of them had Network issues. These do not occur on the windows machine.)


Solution

  • I have a dedicated server hosted through a provider. They gave me only one IPv4-address and did not tell me, that there were other devices in the same network as me. Since their communication wasn't very good, I thought, they gave me multiple IP-addresses. I then configured my server with the same IP as someone elses device in the subnet, which lead to IP conflicts.

    Now, I ordered a couple more and the issue should not appear anymore. This also explains these random connectivity issues and intermittent network. And also why I always received responses on pinging but not on the webapp (since both servers responded to ping but not to the webapp via Port 80 or Port 443).

    Following post got me on the right track: https://unix.stackexchange.com/questions/211931/intermittent-network-disconnection-ubuntu-troubleshooting

    After some scanning with nmap I was able to find the issue.