0

I'm trying to set up a bridged network locally for KVM.

I've tried to set it up with nmtui and manually creating a file. Both did not work.

ifconfig shows enp3s0 as my Ethernet with the following information.

enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.177  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::a2a8:afbd:18c5:d298  prefixlen 64  scopeid 0x20<link>
        ether a8:5e:45:54:f2:4a  txqueuelen 1000  (Ethernet)
        RX packets 1624  bytes 250056 (244.1 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 734  bytes 260192 (254.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

I've created a bridged network config as follow

TYPE=Bridge
BOOTPROTO=static
NAME=br1
UUID=8a50260f-19c9-4b59-be7a-15bc11a71d52
DEVICE=br1
ONBOOT=yes
IPADDR=192.168.1.90
PREFIX=24
GATEWAY=192.168.1.1
NETMASK=255.255.255.0
NM_CONTROLLED=no

When I reboot, I see a new network interface "br1" and it has an IP. The problem is that enp3s0 no longer gets an IP.

I'm pretty sure there must be an error, but I don't where to trace it.

How do I debug this problem and where do I begin?

Update 1 -- configuration of the primary interface

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=wired
UUID=26b55bc9-7a2f-483c-baa9-e7469a7c1bb4
ONBOOT=yes
BRIDGE=br1

Update 2 -- Followed Vignesh SP's suggestions

Listening on LPF/enp3s0/a8:5e:45:54:f2:4a
Sending on   LPF/enp3s0/a8:5e:45:54:f2:4a
Sending on   Socket/fallback
DHCPDISCOVER on enp3s0 to 255.255.255.255 port 67 interval 6 (xid=0x76390226)
DHCPREQUEST on enp3s0 to 255.255.255.255 port 67 (xid=0x76390226)
DHCPOFFER from 192.168.1.1
DHCPACK from 192.168.1.1 (xid=0x76390226)
bound to 192.168.1.177 -- renewal in 33774 seconds.

The primacy nic now has an IP, but it still can't connect to the internet.

Moon
  • 123
  • 4

1 Answers1

2

When your "primary" NIC is a member of the bridge, such that the bridge is your connectivity to the outside world. In this case, rather than assigning an ip address to (for example) eth0, you would assign it to the bridge device instead.

Source

The conf looks ok, you can troubleshoot this by trying to renew the IP of your primary interface manually.

sudo dhclient -r -v <intefacename>
sudo dhclient -v <intefacename>

This will give you the pointers of what is happening when your interface requests for an IP and what error occurs,

Vignesh SP
  • 308
  • 1
  • 11
  • What I don't understand is that I used to get IPs for both of them. That's why I'm trying to fix it and my internet connection does not work when this happen. – Moon May 08 '20 at 09:39
  • Can you post the conf of your primary interface too? – Vignesh SP May 08 '20 at 09:43
  • Updated the post with primary interface conf – Moon May 08 '20 at 09:48
  • Here's also a blog explaining in detail the behaviour change when an interface is set as a bridge port (see bullet 5): [Proper isolation of a Linux bridge - Vincent Bernat](https://vincent.bernat.ch/en/blog/2017-linux-bridge-isolation#bridge-processing "Bridge processing") (while dhclient itself is operating like tcpdump at bullet 2 so doesn't have issues) – A.B May 08 '20 at 12:57
  • @A.B Thank you for the link. I will read through. – Moon May 08 '20 at 13:53