Network Interfaces not working

joshcristian

New Member
Aug 31, 2021
3
0
1
23
Hi everyone,

I've just set up my first Proxmox configuration with one Ubuntu VM.
Unfortunately, the networking on the VM is not working.
I've looked at the solutions in several posts for similar issues but some I just don't understand and most haven't solved my problem so I was hoping to get some advice on here.

This is my /etc/network/interfaces file:
Code:
auto ens1
iface ens1 inet static
    address 192.168.1.230
    netmask 255.255.255.0
    gateway 192.168.1.254

auto vmbr0
iface vmbr0 inet dhcp
#    address 192.168.1.231
#    netmask 255.255.255.0
#    gateway 192.168.1.254
    bridge-ports ens1
    bridge-stp off
    bridge-fd 0

Ideally I would like my VM to connect via DHCP to my router.

Thanks for any help!
 
you can't set ip address on ens1, if ens1 is in a bridge-ports. (it need to be set on vmbr0).
(you don't need inet dhcp on vmbr0 , to have dhcp working in your vm)
How would I configure it so that I can have ens1 with an IP (for the host) and vmbr0 with a seperate IP for the VM?
 
@spirit In my network interfaces file ens1 is the physical NIC that provides network access for my host OS. However, when I try to use this as a bridge for vmbr0 it doesn't work and I can no longer access the internet on the host machine and still can't access it on the VM. Do you have any idea as to what I have done wrong? All I need is for the VM and the host to have internet access - how would I achieve this?

Thanks
 
you just need

Code:
auto ens1
iface ens1 inet manual

auto vmbr0
iface vmbr0 inet static
    address 192.168.1.231
    netmask 255.255.255.0
    gateway 192.168.1.254
    bridge-ports ens1
    bridge-stp off
    bridge-fd 0


the vm networking is simply bridged, so if your vm is doing a dhcp request, the router will be able to respond without any problem.
 
you just need

Code:
auto ens1
iface ens1 inet manual

auto vmbr0
iface vmbr0 inet static
    address 192.168.1.231
    netmask 255.255.255.0
    gateway 192.168.1.254
    bridge-ports ens1
    bridge-stp off
    bridge-fd 0


the vm networking is simply bridged, so if your vm is doing a dhcp request, the router will be able to respond without any problem.

Hi, i switched from bridged network to routed network but my vms can't ping 1.1.1.1 or my gateway ip at hetzner. I can ping main machine ip though.

Can you tell me what's wrong with my config?

Code:
Code:
# network interface settings; autogenerated
# Please do NOT modify this file directly, unless you know what
# you're doing.
#
# If you want to manage parts of the network configuration manually,
# please utilize the 'source' or 'source-directory' directives to do
# so.
# PVE will preserve these directives, but will NOT read its network
# configuration from sourced files, so do not attempt to move any of
# the PVE managed interfaces into external files!

source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

auto enp8s0
iface enp8s0 inet static
        address 157.90.xxx.27
        netmask 255.255.255.255
        pointopoint 157.90.xxx.1
        gateway 157.90.xxx.1
auto vmbr0
iface vmbr0 inet static
        address 157.90.xxx.27
        netmask 255.255.255.255
        bridge_ports none
        bridge_stp off
        bridge_fd 0
        up ip route add 157.90.xxx.5/32 dev vmbr0
        up ip route add 157.90.xxx.6/32 dev vmbr0
        up ip route add 157.90.xxx.7/32 dev vmbr0
        up ip route add 157.90.xxx.8/32 dev vmbr0
        up ip route add 157.90.xxx.9/32 dev vmbr0
        up ip route add 157.90.xxx.10/32 dev vmbr0

#       address 157.90.xxx.27/32
#       gateway 157.90.xxx.1
#       bridge-ports enp8s0
#       bridge-stp off
#       bridge-fd 1
#       pointopoint 157.90.xxx.1
#       bridge_hello 2
#       bridge_maxage 12

auto vmbr1
iface vmbr1 inet static
        address 157.90.xxx.129/29
        bridge-ports none
        bridge-stp off
        bridge-fd 0
#Subnet-route
 
My interfaces file has none of those items (up ip route) but all my hosts get their ip from my dhcp server. My proxmox host gets the same ip from dhcp based on its mac address. The containers and vms are the same way...mac addresses used to set the static ip from my dhcp server (router).
 
My interfaces file has none of those items (up ip route) but all my hosts get their ip from my dhcp server. My proxmox host gets the same ip from dhcp based on its mac address. The containers and vms are the same way...mac addresses used to set the static ip from my dhcp server (router).
Can i see the interfaces config?
 
Code:
# network interface settings; autogenerated
# Please do NOT modify this file directly, unless you know what
# you're doing.
#
# If you want to manage parts of the network configuration manually,
# please utilize the 'source' or 'source-directory' directives to do
# so.
# PVE will preserve these directives, but will NOT read its network
# configuration from sourced files, so do not attempt to move any of
# the PVE managed interfaces into external files!

source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

iface enp4s0 inet dhcp

auto vmbr0
iface vmbr0 inet dhcp
        bridge-ports enp4s0
        bridge-stp off
        bridge-fd 0

My interface contents (above) allow me to have my hosts (vm, lxc, proxmox) get their IP via dhcp auto assign or dhcp static map. If you try this route and your proxmox host and vm still can't get internet access you might need to look at your router (or dhcp server) config.
 
Last edited:

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!