Ubuntu Container: Network not working

neur0mancer

New Member
Nov 23, 2023
19
1
3
Hey

I installed a fresh Proxmox VE 8.0.3 to a Gigabyte Brix Pro (I mention this because I read that there could be a problem with the two 2.5 GBit Ethernet ports?).

I created a container using the Ubuntu templates (I actually tried all from 20.x to 23.x).

ip a returns me the following setup, so eth1 basically seems to be configured correctly:

Code:
2: eth0@if32: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 11:22:33:ff:bb:aa brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 192.168.178.102/24 brd 192.168.178.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 11:22:33:ff:bb:aa/64 scope link
       valid_lft forever preferred_lft forever


When I try to ping my router, I get a "Destination Host Unreachable":

Code:
root@abc:~# ping 192.168.178.1
PING 192.168.178.1 (192.168.178.1) 56(84) bytes of data.
From 192.168.178.102 icmp_seq=1 Destination Host Unreachable

So, it looks like a problem with the routing, but I don't know where to look next.

Any help appreciated

cheers
 
Last edited:
Hello
This depends on the network configuration of your host as well,
can you show your /etc/network/interfaces of your host and container ?
 
Hey Hannes

This is the host's interfaces file (right now only eno2 has a physcial connection, enp174s0 is not connected)

Code:
auto lo
iface lo inet loopback

auto eno2
iface eno2 inet static
        address 192.168.178.100/24
        gateway 192.168.178.1

auto vmbr0
iface vmbr0 inet static
        address 192.168.178.150/24
        gateway 192.168.178.1
        bridge-ports enp174s0
        bridge-stp off
        bridge-fd 0

auto enp174s0
iface enp174s0 inet static
        address 192.168.178.200/24
        gateway 192.168.178.1

iface wlo1 inet manual

The container has no "interfaces" file, instead the config from /etc/systemd/network/net1.network

Code:
[Match]
Name = net1

[Network]
Description = Interface net1 autoconfigured by PVE
DHCP = yes
IPv6AcceptRA = false

and /etc/systemd/network/eth0.network
Code:
[Match]
Name = eth0

[Network]
Description = Interface eth0 autoconfigured by PVE
Address = 192.168.178.102/24
Gateway = 192.168.178.1
DHCP = ipv6
IPv6AcceptRA = false
 
So it does show inet 192.168.178.103/24 in your first post, but Address = 192.168.178.102/24 in your second post for the ip address of your container which does not seem correct ?
How exactly have you configured the network for your container (IPv4, IPv6, DHCP) and have you changed something manually in the config files in the container ?
And is your host able to reach the internet ? (ping 8.8.8.8)
 
>So it does show inet 192.168.178.103/24 in your first post, but Address = 192.168.178.102/24 in your second post for the ip address of your container which does not seem correct ?

It's .102 right now, I was playing around with the host's address and set up different containers. I changed it in the first post.

That's the configuration from the Web UI for the container.

1700822409354.png


Interesting, the host itself has no access to the internet, I was under the assumption it has, because I can SSH into it and the WebUi is working fine.

Code:
root@proxmox:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 192.168.178.150 icmp_seq=1 Destination Host Unreachable
From 192.168.178.150 icmp_seq=2 Destination Host Unreachable

But the host can ping the router. That's wild.. so it's more a routing problem of the host!?
 
Last edited:
adding: name lookup is working on the host:

Code:
root@proxmox:~# nslookup google.de
Server:         192.168.178.1
Address:        192.168.178.1#53

Non-authoritative answer:
Name:   google.de
Address: 142.250.181.195
Name:   google.de
 
OK, I guess I found, though I dont understand why this is a problem. I switch both network interfaces to:

Code:
auto eno2
iface eno2 inet manual

auto enp174s0
iface enp174s0 inet manual

Now it is working... but why does it not work with providing IP adress et al manually?
 
OK, I guess I found, though I dont understand why this is a problem. I switch both network interfaces to:
Did this fix both issues or did you fix your internet connection problem of your host in the first place ?

I can imagine that the problem was, that you had multiple ip addresses for your machine in the same network ?
You should only have a single IP address per machine in a network.

I assume your configuration does look like this now:
Code:
auto lo
iface lo inet loopback

auto eno2
iface eno2 inet manual

auto vmbr0
iface vmbr0 inet static
        address 192.168.178.150/24
        gateway 192.168.178.1
        bridge-ports enp174s0
        bridge-stp off
        bridge-fd 0

auto enp174s0
iface enp174s0 inet manual

iface wlo1 inet manual
This creates a bridge with the outward-facing ip address 192.168.178.150 bridging over enp174s0 to your router, so it is clear that all the traffic goes through this connection.
If in your previous setip both ip addresses were in the same network (which i did not recognize earlier), it is not clear which ip address should be used.
I'd recommend reading our network config guide [1].

[1] https://pve.proxmox.com/wiki/Network_Configuration
 
Yes, network is working fine now, I really only changed from "inet static" to "inet manual".

But thanks for that hint: I did not reckoginized, that both interfaces should not be in the same network!

(Also have to mention: Only one port was physically connected to the router!)
 

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!