[SOLVED] Ubuntu VM can't reach internet network

Virgine

New Member
Mar 3, 2024
2
1
3
Hello!

I'm trying to run an Ubuntu VM, but I can't figure how to access internet from inside the VM...

Proxmox network is setup by default by my server provider as follow (didn't change it, seemed fine to me) :
Code:
auto lo
iface lo inet loopback

iface enp5s0f0 inet manual

auto vmbr0
iface vmbr0 inet static
  address xxx.xxx.20.55/24
  gateway xxx.xxx.20.254
  bridge-ports enp5s0f0
  bridge-stp off
  bridge-fd 0
  hwaddress A0:42:3F:41:6E:56


And on the VM side, i configured netplan as follow :
Code:
network:
    version: 2
    renderer: networkd
    ethernets:
      ens18:
        dhcp4: no
        addresses: [xxx.xxx.20.55/24]
        gateway4: xxx.xxx.20.254
        nameserver:
          addresses: [8.8.8.8,8.8.4.4]
        dhcp6: no

And

Code:
ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 gqdisc noqueue state UNKNOWN group default glen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
Valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
Valid_lft forever preferred_lft forever
2: ens18: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 56:1b:dd:22:681:e8 brd ff:ff:ff:ff:ff:ff
inet xxx.xxx.20.55/24 brd xxx.xxx.20.255 scope global ens18
Valid_lft forever preferred_lft forever
inet6 fe80::541b:ddff:fe22:81e8/64 scope link
valid_lft forever preferred_lft forever

ip route
default via xxx.xxx.20.254 dev ens18 proto static
xxx.xxx.20.0/24 dev ens18 proto kernel scope link src xxx.xxx.20.55

ping 127.0.0.1 => OK
ping xxx.xxx.20.55 => OK
ping xxx.xxx.20.254 => NOK
ping google.fr => NOK


What am I missing?
 
Hi,

you cannot assign the same IP address to both the host machine and the VM, in your case the xxx.xxx.20.55.

If you have more than one IPv4 address available, you can assign the VM another one from the appropriate range, see also our guide on a routed configuration.
Otherwise, you will have to set up a NAT, either manually as detailed in the guide or using SDN directly in the web UI! :)
 
Hello!

Thanks for your answer, I went with the masquerade way, and it's working now!
I set the post as solved
 
  • Like
Reactions: cheiss

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!