Trying a (dumb?) thing with Ubuntu LXC, not getting DNS

sadpanda

Member
Jul 7, 2020
5
0
6
46
Using mobo NIC to manage. Prox box is behind router, trying to connect LXC on second NIC back to 4 port ISP provided modem. Second NIC not being used by any other VM/LXC and DHCP/DNS work fine if I connect to a free port on my router. New Ubuntu 21.1 unprivileged LXC assigned eht0, IPv4 DHCP,IPv6 empty/static.


For background, on this LXC there is no yaml in /etc/netplan or any other spots, /etc/network only contains if-down.d and if-up.d , so it looks like everything is controlled via /etc/systemd/network

eth0.network:
Code:
[Match]
Name = eth0

[Network]
Description = Interface eth0 autoconfigured by PVE
DHCP = v4
IPv6AcceptRA = false

this does not work:

Code:
# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 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: eth0@if115: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 6e:92:74:da:e2:9b brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet6 fe80::6c92:74ff:feda:e29b/64 scope link
       valid_lft forever preferred_lft forever




On a whim I tried connecting my laptop to same port on modem with DHCP enabled, got an IP/dns etc so I tried spoofing its MAC ala old school self owned equipment days. DHCP works but no DNS. I tried using the laptop IP, no go. Finally I tried editing systemd resolve to match provided DNS, however I'm seeing this:


Code:
/etc/systemd# systemd-resolve --status

Global
           Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
    resolv.conf mode: foreign
  Current DNS Server: <router IP prox box is behind>
         DNS Servers: <router IP prox box is behind>
Fallback DNS Servers: 209.18.47.63 (roadrunner/charter DNS)
          DNS Domain: <local domain specified on my prox box>

Link 2 (eth0)
Current Scopes: none
     Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported



I wasn't expecting the 'Global' bits. Any way to change/remove/bypass?

Thanks.
 
Hi,

how does your /etc/network/interfaces look? Can you also post the config of the container pct config <container id>?
 
Hi,

how does your /etc/network/interfaces look? Can you also post the config of the container pct config <container id>?

Thanks for the reply, sorry for delay.

perhaps I was not clear, /etc/network/interfaces does not exist hence the question.

Code:
/etc/network# ls
if-down.d  if-up.d

arch: amd64
cores: 1
features: nesting=1
hostname: test
memory: 512
net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=56:ED:35:3F:3B:ED,ip=dhcp,type=veth
ostype: ubuntu
rootfs: local-lvm:vm-101-disk-0,size=8G
searchdomain: 9.9.9.9
swap: 512
unprivileged: 1
 
I think I forgot to say the Hosts /etc/network/interfaces config ;) not the one of the container.
 
I think I forgot to say the Hosts /etc/network/interfaces config ;) not the one of the container.
Code:
auto lo
iface lo inet loopback

auto enp4s0
iface enp4s0 inet manual
        ovs_type OVSPort
        ovs_bridge vmbr0
#internal nic

auto enp3s0
iface enp3s0 inet manual
        ovs_type OVSPort
        ovs_bridge vmbr1
        ovs_options vlan_mode=native-untagged
#intel 1gb single port nic

auto enp1s0
iface enp1s0 inet manual
        ovs_type OVSPort
        ovs_bridge vmbr2
#10gb 0

iface enp1s0d1 inet manual

auto mnmgmt
iface mnmgmt inet static
        address 192.168.69.20/24
        gateway 192.168.69.1
        ovs_type OVSIntPort
        ovs_bridge vmbr0

auto vmbr1
iface vmbr1 inet manual
        ovs_type OVSBridge
        ovs_ports enp3s0
        ovs_options vlan1
#1gb WAN port
auto vmbr2
iface vmbr2 inet manual
        ovs_type OVSBridge
        ovs_ports enp1s0
#10gb LAN port

auto vmbr0
iface vmbr0 inet manual
        ovs_type OVSBridge
        ovs_ports enp4s0 mnmgmt

auto vmbr3
iface vmbr3 inet manual
        ovs_type OVSBridge
#internal bridge
 
So when I created the container I originally disabled nesting and left the DNS blank. I created a new CT with nesting and specified my ISP domain/DNS and its working. However, this still left me with a few questions:

In my experimenting I found this: https://forum.proxmox.com/threads/h...hostsname-etc-resolv-conf-maybe-others.76186/ and gave the # touch /etc/.pve-ignore.hosts a shot but but with the period in there, it does not seem to do anything (typo?)

Should this command work on its own or do you have to also include ostype:unmanaged in the options tab as well? Would that enable full control within the container or would you still be forced to put something in DNS/domain in gui fields?

Why can't two interfaces use the same gateway? I tried manually entering an IP/gateway on the second interface and got:
Code:
Parameter verification failed. (400)
gateway: Default gateway already exists on interface 'mgmt'



any issue with these error messages?

Code:
root@test:~# service systemd-networkd status
* systemd-networkd.service - Network Service
     Loaded: loaded (/lib/systemd/system/systemd-networkd.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2022-06-15 10:21:42 UTC; 7min ago
TriggeredBy: * systemd-networkd.socket
       Docs: man:systemd-networkd.service(8)
   Main PID: 90 (systemd-network)
     Status: "Processing requests..."
      Tasks: 1 (limit: 18990)
     Memory: 2.5M
        CPU: 25ms
     CGroup: /system.slice/systemd-networkd.service
             `-90 /lib/systemd/systemd-networkd

Jun 15 10:21:42 test systemd[1]: Starting Network Service...
Jun 15 10:21:42 test systemd-networkd[90]: Failed to increase receive buffer size for general netlink socket, ignoring: Operation not permitted
Jun 15 10:21:42 test systemd-networkd[90]: /etc/systemd/network/eth0.network:6: DHCP=v4 is deprecated, please use DHCP=ipv4 instead.
Jun 15 10:21:42 test systemd-networkd[90]: Enumeration completed
Jun 15 10:21:42 test systemd[1]: Started Network Service.
Jun 15 10:21:42 test systemd-networkd[90]: eth0: Link UP
Jun 15 10:21:42 test systemd-networkd[90]: eth0: Gained carrier
Jun 15 10:21:42 test systemd-networkd[90]: eth0: DHCPv4 address xxxxxxxxxxxxxxxxx
Jun 15 10:21:42 test systemd-networkd[90]: Could not set hostname: Access denied
Jun 15 10:21:43 test systemd-networkd[90]: eth0: Gained IPv6LL
[/icode]