Ubuntu VM' is does not have network access

Lakshitha

New Member
May 9, 2022
7
0
1
Hi

We have installed Proxmox on a BareMetal server and configured few VM's on top of it. Our Network configurations of the Proxmox installation as follows. with these configs i can't ping the gateway also doesn't have internet from the ubuntu machine.

Note: i have checked these configs with Windows and Centos 7 and its all working fine. but not with ubuntu. Could you please help me to identify why this is not working for ubuntu. ubuntu version is Ubuntu 20.04.4

Also when creating adding network device in ubuntu i have tried with network with Paravirtualized and Intel E1000 but didn't found any luck

#########Proxmox Host System info#############

root@SRV107:~# hostnamectl
Static hostname: SRV107
Icon name: computer-desktop
Chassis: desktop
Machine ID: c5d7375e56884faaaa63336f0caa09fc
Boot ID: 308106e6150e436f90960cd376961db7
Operating System: Debian GNU/Linux 11 (bullseye)
Kernel: Linux 5.13.19-6-pve
Architecture: x86-64
root@SRV107:~# uname -a
Linux SRV107 5.13.19-6-pve #1 SMP PVE 5.13.19-15 (Tue, 29 Mar 2022 15:59:50 +0200) x86_64 GNU/Linux




##########Network####################
auto lo
iface lo inet loopback

iface lo inet6 loopback

auto enp4s0
iface enp4s0 inet static
address xx.xx.240.39/26
gateway xx.xx.240.1
up route add -net xx.xx.240.0 netmask 255.255.255.192 gw xx.xx.240.1 dev enp4s0

iface enp4s0 inet6 static
address xxxx:4f8:272:xxx::2/64
gateway fe80::1

auto enp4s0.4001
iface enp4s0.4001 inet static
address 10.0.1.7/24
mtu 1400
up ip route add 10.0.0.0/16 via 10.0.1.1 dev enp4s0.4001
down ip route del 10.0.0.0/16 via 10.0.1.1 dev enp4s0.4001

auto vmbr0
iface vmbr0 inet static
address xx.xx.240.39/32
bridge-ports none
bridge-stp off
bridge-fd 0
bridge_maxwait 0
pre-up brctl addbr vmbr0

iface vmbr0 inet6 static
address xxxx:4f8:272:xxx::2/64

up ip route add xx.xx.240.59/32 dev vmbr0
up ip route add x.x.196.1/32 dev vmbr0
up ip route add x.x.196.2/32 dev vmbr0
up ip route add x.x.196.3/32 dev vmbr0
up ip route add x.x.196.4/32 dev vmbr0
up ip route add x.x.196.5/32 dev vmbr0
up ip route add x.x.196.6/32 dev vmbr0
up ip route add xx.xx.140.225/32 dev vmbr0
up ip route add xx.xx.140.226/32 dev vmbr0
up ip route add xx.xx.140.227/32 dev vmbr0
up ip route add xx.xx.140.228/32 dev vmbr0



auto vmbr1
iface vmbr1 inet static
address 192.168.100.0/24
bridge-ports none
bridge-stp off
bridge-fd 0

auto vmbr2
iface vmbr2 inet static
address 10.0.1.7/24
bridge-ports none
bridge-stp off
bridge-fd 0
bridge-vlan-aware yes
bridge-vids 2-4094
up ip route add 10.0.1.40/24 dev vmbr2
up ip route add 10.0.1.41/24 dev vmbr2
up ip route add 10.0.1.42/24 dev vmbr2


######Ubuntu VM Configs######


network:
version: 2
ethernets:
enp0s3:
dhcp4: false
addresses: [xx.xx.140.228/32]
gateway4: xx.xx.240.39
nameservers:
addresses: [8.8.8.8, 8.8.4.4]
 
Last edited:
Hi,
just a basic check. Can you call within the VM:
Bash:
ip addr
# and
ip route
 
Could you explain your network setup? I'm having trouble trying to understand your config file...
 
Could you explain your network setup? I'm having trouble trying to understand your config file...
As you can see we have a network of xx.xx.240.39/26 and x.x.196.1/29 network. Our gateway IP is xx.xx.240.1. so we have routed both network through xx.xx.240.1. vmbr1 and vmbr 2 are just two private local networks
 
According to "ip route" there is no default gateway configured on that VM. Could you try to set a gateway within the Ubuntu VM?
 
pve host:
gateway xx.xx.240.1

ubuntu vm:
gateway4: xx.xx.240.39

Maybe I'm wrong, but should the ubuntu vm also have 240.1 as gateway......
 
As you can see we have a network of xx.xx.240.39/26 and x.x.196.1/29 network. Our gateway IP is xx.xx.240.1. so we have routed both network through xx.xx.240.1. vmbr1 and vmbr 2 are just two private local networks

you have your public IP and gateway on enp4s0 *but* you also have this IP assigned to vmbr0 (...ok....) but then vmbr0 is not linked to a physical NIC *and* then you seem to be routing via vmbr0 ?????

as I said, your config is not making any sense to me.....
 
you have your public IP and gateway on enp4s0 *but* you also have this IP assigned to vmbr0 (...ok....) but then vmbr0 is not linked to a physical NIC *and* then you seem to be routing via vmbr0 ?????

as I said, your config is not making any sense to me.....
Hi

Please refer to the below. we have done something similar to routed configuration since most hosting providers do not support bridging setup

https://pve.proxmox.com/wiki/Network_Configuration
 
Hi

Please refer to the below. we have done something similar to routed configuration since most hosting providers do not support bridging setup

https://pve.proxmox.com/wiki/Network_Configuration
But you're not enabling ip forwarding
post-up echo 1 > /proc/sys/net/ipv4/ip_forward

and you're not routing via a 'real' interface - e.g
post-up iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o eno1 -j MASQUERADE
 
But you're not enabling ip forwarding
post-up echo 1 > /proc/sys/net/ipv4/ip_forward

and you're not routing via a 'real' interface - e.g
post-up iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o eno1 -j MASQUERADE
I'll try that. but it wonder how centos and windows works with these configurations but not Ubuntu
 

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!