Bridged VM has no internet but only able to ping host machine. Host and VM both have separate public IP addresses.

yongsiklee

New Member
Mar 4, 2023
22
0
1
I needed to edit my post because I was not careful posting IPv4s, etc.

Below contains my real ipaddr and gateway:

Host's interface:

iface eth0 inet manual

auto vmbr0
iface vmbr0 inet static

address XX.XX.65.139/22
gateway XX.XX.64.1
bridge-ports eth0
bridge-stp off
bridge-fd 0

VM interfaces:

device=eth0
onboot=yes
bootpronto=none
ipaddr=XX.XX.66.37
netmask=255.255.252.0
gateway=XX.XX.64.1
dns1=8.8.8.8
dns2=8.8.4.4

*VM can ping to the host's ip only.

Any suggestion, pls?
 
Last edited:
*I just corrected my mistyped netmask for vm: it should be 255.255.252.0.

Apparently they are not in the same subnet and that's how this provider has given to me.
And I tried to use host's gateway for this VM, it still didn't work.
My understanding is Proxmox bridge is acting like a switch and if a VM has proper network setup on its own, it has to work.
If this VM is a stand-alone machine, this network setting works fine even with a different subnet gateway.

What alternative way I can get in this situation?
 
Last edited:
Can you ping the VM's default gateway from within the VM?
The provider now says both IPs share one gateway XX.XX.64.1 (....65.1 for the host's machine still worked strsangely so I did not complain in the first place anyway). But I still cannot ping the gateway from within VM (LXC container).
 
Can you ping the VM's default gateway from within the VM?
I configured the host machine with the 2nd IP and it worked. I can ping gateway and the world.

So both the IPs work fine on its own- it does not work on VM though.

I attached the original network interfaces when I installed debian and proxmox. Please, take a look at it.
 

Attachments

  • original creek-1.PNG
    original creek-1.PNG
    197.2 KB · Views: 9
Can you ping the VM's default gateway from within the VM?
/etc/network/interfaces (guest lxc) :

auto lo
iface lo inet loopback

dns-nameservers 8.8.8.8

auto eth0
iface eth0 inet static
address xx.xx.65.139/32
gateway xx.xx.66.37
pointopoint xx.xx.66.37

/etc/network/interfaces (Proxmox hostnode):

auto lo
iface lo inet loopback

iface eth0 inet manual

auto vmbr0
iface vmbr0 inet static
address xx.xx.66.37/22
gateway xx.xx.64.1
bridge-ports eth0
bridge-stp off
bridge-fd 0
post-up ip route add xx.xx.65.139/32 dev vmbr0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up echo 1 > /proc/sys/net/ipv4/conf/eth0/proxy_arp
Pinging from the guest:

root@creek-1:~# ping yahoo.com
^Xping: yahoo.com: Temporary failure in name resolution

root@creek-1:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From XX.XX.66.37: icmp_seq=1 Redirect Host(New nexthop: XX.XX.64.1)
From XX.XX.66.37: icmp_seq=1 Redirect Host(New nexthop: XX.XX.64.1)
From XX.XX.66.37: icmp_seq=1 Redirect Host(New nexthop: XX.XX.64.1)
From XX.XX.66.37: icmp_seq=1 Redirect Host(New nexthop: XX.XX.64.1)
^C
--- 8.8.8.8 ping statistics ---
11 packets transmitted, 0 received, 100% packet loss, time 10223ms
 
Does your provider use a MAC filter on the switch?
The provider says: " The mac address is for the interface. The virtual interface is 1 per vps."
My VPS has two ip addresses in it and this mac address is for the VPS.

For reference, the following network configuration is created by default by the provider when installing Devian fresh on the VPS:

auto eth0
iface eth0 inet static
address XX.XX.66.37
netmask 255.255.252.0
gateway XX.XX.64.1


auto eth0:0
iface eth0:0 inet static
address XX.XX.65.139
netmask 255.255.252.0
gateway XX.XX.64.1
 

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!