No network access outside of VM/LXC

Discussion in 'Proxmox VE: Networking and Firewall' started by Stephen Gibson, Aug 11, 2019.

  1. Stephen Gibson

    Stephen Gibson New Member

    Joined:
    Aug 11, 2019
    Messages:
    5
    Likes Received:
    0
    I have Promox running in Virtualbox on a windows machine before I move onto replacing my current single system server.

    Currently the Virtualbox config for the network adapter is bridged and I have full access to network and internet in the host. I can ping the LXC from the host and I can even ping the LXC from my windows machine

    However, trying to run a Ubuntu 18.04 container I can not access anything outside. The container does show up in my router devices but no IPv4 address is assigned.

    I currently have a machine acting as my Pihole and DNS server, at address 192.168.1.100.

    My host /etc/network/interfaces:

    auto lo
    iface lo inet loopback

    iface enp0s9 inet manual

    auto vmbr0
    iface vmbr0 inet static
    address 192.168.1.44
    netmask 255.255.255.0
    gateway 192.168.1.254
    bridge_ports enp0s9
    bridge_stp off
    bridge_fd 0

    My LXC /etc/netplan/config.yaml:

    network:
    version: 2
    renderer: networkd
    ethernets:
    eth0:
    addresses: [192.168.1.69/24]
    gateway4: 192.168.1.254
    nameservers:
    addresses: [192.168.1.100]
    bridges:
    vmbr0:
    dhcp4: false
    interfaces: [eth0]
     
  2. Stoiko Ivanov

    Stoiko Ivanov Proxmox Staff Member
    Staff Member

    Joined:
    May 2, 2018
    Messages:
    1,399
    Likes Received:
    132
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Stephen Gibson

    Stephen Gibson New Member

    Joined:
    Aug 11, 2019
    Messages:
    5
    Likes Received:
    0
    I attached some images, can't embed them directly due to new account.
     

    Attached Files:

  4. Stoiko Ivanov

    Stoiko Ivanov Proxmox Staff Member
    Staff Member

    Joined:
    May 2, 2018
    Messages:
    1,399
    Likes Received:
    132
    For ubuntu PVE uses systemd-networkd as network configuration - check the files in `/etc/systemd/network`
    Also post the output in code tags of:
    * `ip link`
    * `ip address`
    * `ip route`
    inside the container once it's started

    can you ping the default gateway (192.168.1.254) of the container?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Stephen Gibson

    Stephen Gibson New Member

    Joined:
    Aug 11, 2019
    Messages:
    5
    Likes Received:
    0
    Thanks for helping but I seemed to have magically fixed it...kind of.

    I think there was some conflict between Proxmox network and netplan.

    And my other configuration has not changed.

    What I did was, remove the adaptor from the network tab and re-add it. Deleted all the devices added to my routers devices by dhcp and restarted everything. Working flawlessly now.
     
    #5 Stephen Gibson, Aug 12, 2019
    Last edited: Aug 12, 2019
  6. Stephen Gibson

    Stephen Gibson New Member

    Joined:
    Aug 11, 2019
    Messages:
    5
    Likes Received:
    0
    I also just spun up another container entering only the config stuff into the network setup step, didn't touch netplan.yaml. All working good.
    Do I just not need netplan? That's just what I used on my bare metal server running ubuntu 18.04, so assumed I had to do the same.
     
  7. Stoiko Ivanov

    Stoiko Ivanov Proxmox Staff Member
    Staff Member

    Joined:
    May 2, 2018
    Messages:
    1,399
    Likes Received:
    132
    * As said, in general PVE takes care of configuring the network of a container, if it knows how to do it (i.e. the 'ostype' is set).
    * For Ubuntu (and most distributions which support it) we use systemd-networkd for network-configuration and skip the way through netplan (which afaik renders a fitting systemd-networkd file).
    This follows the idea that it would make setting the network configuration quite cumbersome if you need to both set it in the hypervisor and inside the container...

    hope this explains it!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. Stephen Gibson

    Stephen Gibson New Member

    Joined:
    Aug 11, 2019
    Messages:
    5
    Likes Received:
    0
    It does. Thank you! I shall have a wee peek in the systemd-networkd file to see what's going on there.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice