VMs cant reach internet

midka

Member
Aug 5, 2022
6
0
6
Hi, i have dedicated server with netplan as the host and ive made a vm and cant get internet to it. Im trying to assign a public ip to the container since i have 5 public ips.

Current netplan config:
YAML:
network:
  version: 2
  renderer: networkd
  ethernets:
    enp1s0f0:
      addresses:
        - 204.44.125.23/24
        - 204.44.125.11/24
        - 204.44.125.43/24
      gateway4: 204.44.125.1
      nameservers:
         addresses:
            - "1.1.1.1"
            - "8.8.8.8"
  bridges:
    vmbr1:
      gateway4: 204.44.125.1
      addresses: [204.44.125.39/24, 204.44.125.44/24]
      interfaces: [enp1s0f0.101]
  vlans:
    enp1s0f0.101:
      link: enp1s0f0
      id: 101
      accept-ra: no

Current proxmox network (not used because of netplan)
1659713958741.png

VM ip ad:
1659714058496.png

Host ip ad
1659714088383.png

Also if i listen on the host with tcpdump -i vmbr1 i just get a lot of ARP messages so i assume the VM cannot reach the gateway
 
I think that the problem might be that you assigned the IP *.*.*.39 to the host as well as to the VM, that can't work. You would need to remove it from the host.
 
You already assigned 204.44.125.39 to vmbr1 on the host. How would packets travel to the VM when the host interface sees them first?

You are using a VLAN 101 for the VM but you are also assigning addresses from 204.44.125.0/24 to the base interface. Is this correct in your network environment?
 
How does it then know to forward that address to the vm?
vmbr0 is a bridge interface, it acts more or less like a switch, so your VM is plugged into a virutal switch that is connected to a network port.

I removed it from the host and nothing changed.
did you apply the configuration? it is gone from ip a on the host?
 
vmbr0 is a bridge interface, it acts more or less like a switch, so your VM is plugged into a virutal switch that is connected to a network port.
Ah i see
did you apply the configuration? it is gone from ip a on the host?
Yea i did, but now restarted and its back. I ran netplan try -> netplan generate -> netplan apply and it was gone until i restarted
 
Ah i see

Yea i did, but now restarted and its back. I ran netplan try -> netplan generate -> netplan apply and it was gone until i restarted
Fixed netplan problem by adding netplan apply to crontab on reboot