[SOLVED] Issue with virtual machines losing internet access

sondrelassen

New Member
Feb 10, 2022
7
1
3
20
Hello!
I'm having a strange issue with my virtual machines losing internet access after a couple hours. the only "fix" i have found so far has been to remove the network and adding another one (essentially ripping out the network card and placing it back inside).
I first noticed this problem on a vm running a minecraft server, where it would just suddenly lose internet access. Therefore i made another vm to test that it wasn't just me who had messed something up. However this issue is still appearing in the new vm. What's even more strange is that both of the virtual machines can ping each other and the host machine, but still not reach the outer internet even though the host machine can. To me, this indicates that there is connection between the host and the vm, so there shouldn't be any issues, but here we are.

I have tried looking for solutions, but i haven't found anything of great help. I have also tried to get help from my IT teacher, but this problem was entirely foreign to him.

The pveversion command tells me that im running pve-manager/7.1-10/6ddebafe (running kernel: 5.13.19-2-pve)

Any help appreciated!
-Sondre
 
The virtual machine is running Ubuntu 20.04.3. I dont quite understand what you mean by the configuration, so if you would be a little more specific about what you want to know that would be very helpful
 
Wihout information on physical/virtual NICs used, hosts network configuration, guests network configuration and so on its hard to guess what could cause problems.

For example for host:
ip addr, ip route, cat /etc/network/interfaces, qm config <VMIDofYourVM>

And for the guest:
ip addr, ip route, cat /etc/network/interfaces

And are there any firewall rules active? Did you verify that no IP is used twice and no host/guest got two IPs in the same subnet? Your server is using ethernet and no wifi? Did you also ping remote servers or did you just try to visit a website wich wasn'T working (in which case it could be a DNS problem)?

When you think you are offline again you could run this:
dig google.com, ping 8.8.8.8, ip addr
 
Last edited:
here are the outputs i got. uploaded to other sites to prevent unnecessary spam here

output from the host:
https://pastebin.com/Dx1bqv9S

output from the guest:
https://imgur.com/a/J1cswJf

I have no firewall rules setup, and i have confirmed there should be no ip conflicts. I'm not sure what you mean by two IPs, but the host and guest are on the same subnet. Server is connected to a router i have reversed to get ethernet to it. I'm currently trying to connect to it to change some settings which may cause issues.
 
Last edited:
Did you install ubuntu with a desktop environment? In that case the network-manager is dynamically managing your network. You could try to give your VM a static IP, gateway, DNS server in case you are now using DHCP over the network-manager. Maybe the network-manager is doing something wrong and your guest looses the gateway or something like that.
 
Last edited:
I'm using ubuntu server. I have set up all the vm's to have static ip's, but if that isn't setup correctly that could be an issue for sure.
 
How did you setup your guests network? Because the /etc/network/interfaces was empty. Or did you create a file in the /etc/network/interfaces.d folder? So I guessed you used the network-manager instead.
 
Last edited:
It seems the issue was with the router i used as a network repeater was setup incorrectly. I reset the router and now it seems to work fine. Thanks for your help :)
 
  • Like
Reactions: freddybab