Cannot access internet in VM

xwu

New Member
Jan 12, 2022
3
0
1
39
In a fresh installed Debian VM, I can ping the gateway or any public DNS server, but I cannot ping any other hosts (including hosts within the same LAN). I tried to turn off the firewall, using either dhcp or static ip for the vm, but still not working. Any idea please?
 
hi,

I can ping the gateway or any public DNS server, but I cannot ping any other hosts (including hosts within the same LAN)
have you checked for conflicting IP addresses on the LAN?

does DNS work?
 
have you checked for conflicting IP addresses on the LAN?

does DNS work?
Thanks for your reply.

The IP was allocated from the gateway running DHCP service, which assign fix IP to different MACs, so the IP should be good, IMO. It has certain rules preventing me from manually change the IP, which is odd, but such centralized IP allocation should means conflict is unlikely. I tried changing '/etc/network/interfaces.d' from 'dhcp‘ to 'static', with allocated IP, correct gateway and netmask, but still not working.

DNS is working fine, as the entire institute is using it. If I ping a domain name within the Debian VM, it can also be resolved correctly.

I can ping from any host in the LAN (including the host running PVE) to the VM; the VM can ping the gateway, any DNS server (public or default), but not any other host or internet.
 
I can ping from any host in the LAN (including the host running PVE) to the VM; the VM can ping the gateway, any DNS server (public or default), but not any other host or internet.
interesting...

is it only ICMP that's not working? can you still reach public websites, or HTTP servers in your LAN, from inside the VM?

also could you post your /etc/network/interfaces file?
 
thanks for your quick reply.

The Debian VM basically cannot access any public address, including official deb package servers.

I would very like to post the entire file, but copy-paste using the web console is really a pain. Basically, default after installation looks like:

Code:
... (loopback section)

# The primary network interface
allow-hotplug ens18
iface ens18 inet dhcp

After install the VM, I found the problem and also noticed that the allocated IP seems bound to MAC.

I also checked the 'ip addr': inet 218.199.1.11/21, so I tried changed it to static:

Code:
... (loopback section)

# The primary network interface
allow-hotplug ens18
#iface ens18 inet dhcp
iface ens18 inet static
    address 218.199.1.11
    netmask 255.255.248.0
    gateway 218.199.7.254
    dns-nameservers 211.67.48.8 8.8.8.8

gateway is found using 'ip route'; the first dns server is the default.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!