1

Ubuntu 20.04 server with multiple NICs and KVM server installed on it.

Created a bridge with netplan:

enp0s31f6:
 dhcp4: no
 addresses: []

bridges:
 netbr0:
  addresses: [192.168.14.20/24]
  dhcp4: no
  interfaces:
    - enp0s31f6
  nameservers:
    addresses:
      - 192.168.14.1
      - 8.8.8.8
      - 8.8.4.4
      - 1.1.1.1
  parameters:
    stp: false
    forward-delay: 0

enp0s31f6 is connected to the router port (VLAN14). 192.168.14.1 is the router's VLAN14 address.

A VM's NIC is connected to this bridge. VM's IP address is manually set to 192.168.14.25/24 with the gateway 192.168.14.1 and DNS servers to 8.8.8.8,8.8.4.4

I can ping external IP addresses but can't ping www.google.com. So name resolution obviously is not working.

(Ubuntu 20.04 VM):

nslookup www.google.com
;; connection timed out; no servers could be reached


resolvectl status
    
    Link 2 (enp3s0)
          Current Scopes: DNS    
    DefaultRoute setting: yes    
           LLMNR setting: yes    
    MulticastDNS setting: no     
      DNSOverTLS setting: no     
          DNSSEC setting: no     
        DNSSEC supported: no     
      Current DNS Server: 8.8.8.8
             DNS Servers: 8.8.8.8
              DNS Domain: ~.  

On the server:

ping -I 192.168.14.20 www.google.com 

works.

When I connect a computer to the router (192.168.14.1), the name resolution works.

I can't figure out what causes this issue.

lk7777
  • 243
  • 2
  • 10

1 Answers1

0

I have tried the following:

  enp5s0:
  addresses: [10.10.5.15/24, 10.10.5.90/24, 10.10.5.110/24]
  gateway4: 10.10.5.1
  dhcp4: no
  match:
    macaddress: 1c:1b:0d:9a:43:d0
  mtu: 1500  
  nameservers:
    addresses:
      - 10.10.5.1
      - 8.8.8.8
      - 8.8.4.4
    search: []
bridges:
 netbr0:
  addresses: [192.168.14.20/24]
  dhcp4: no
  interfaces:
    - enp0s31f6
  mtu: 1500
  nameservers:
    addresses:
      - 8.8.8.8
      - 8.8.4.4
      - 1.1.1.1
      - 192.168.14.1
    search: []
  routes:
    - to: 0.0.0.0/0
      via: 192.168.14.1
      metric: 100
      table: 801
  routing-policy:
    - from: 192.168.14.0/24
      table: 801
      priority: 301
  parameters:
    stp: false
    forward-delay: 0

The following worked for the bridge:

dig www.google.com @8.8.8.8 -b 192.168.14.20

But the name resolution still didn't work in the guest machines.

For the test purpose, I have tried to use NAT and routed networks connected to the enp0s31f6 with no network bridge configured in netplan. Didn't work. VMs connected to the enp5s0 worked with no issues. What could cause this problem libvirt, netplan, my multi-NIC setup? I do not know.

The only solution that worked for me flawlessly was using Host device enp0s31f6 - macvtap in a bridge mode. To communicate with the host I have created an isolated network and added a second NIC (connected to this network) to the guest vm.

lk7777
  • 243
  • 2
  • 10