0

I have installed Ubuntu 18 in a baremetal server. As the interfaces are in ens3, ens4 etc..I mapped them to eth0,eth1 etc by following steps from google creating a file along with mac addresses in it.

nano /etc/udev/rules.d/70-persistent-net.rules

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", 
ATTR{address}=="xxxxxxxxxxxxx", NAME="eth0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", 
ATTR{address}=="xxxxxxxxxxxxx", NAME="ext_br"

etc.netplan/01-config

ethernets:
    eth0:
    dhcp4: no
    dhcp6: no
    addresses:
    # - 192.168.5.116/16
        - 2001:bc8:454:2000::16/48
    #gateway4: 192.168.5.1
    #nameservers:
    #addresses: [8.8.8.8]

bridges:
    ext_br:
    interfaces: [eth0]
    addresses: [192.168.5.116/16]
    gateway4: 192.168.5.1
    nameservers:
    addresses: [8.8.8.8]
    parameters:
        stp: true
    dhcp4: no
    dhcp6: no

I can see ext_br displayed with ip with no eth0

root@:/etc/netplan# ifconfig ext_br
ext_br: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.2.116  netmask 255.255.0.0  broadcast 192.168.255.255
        inet6 fe80::21d:9ff:fe1b:de57  prefixlen 64  scopeid 0x20<link>
        ether 00:xx:xx:xx:Xx:Xx  txqueuelen 1000  (Ethernet)
        RX packets 4103146  bytes 5348057568 (5.3 GB)
        RX errors 0  dropped 74  overruns 0  frame 0
        TX packets 2625831  bytes 1011504018 (1.0 GB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

if I give brctl show command I am not able to see the bridge listed.

I am trying to create a vm where it has to reach the internet via same bridge interface.

Can someone help? What am I missing? Thanks for your help.

  • Have you installed Ubuntu Core 18? (as specialist releases like Ubuntu core use the yy format) or the Ubuntu Server 18.04 (server and desktop releases use yy.mm) as it's best if you're specific rather than a non-existent release like Ubuntu 18. – guiverc Mar 6 at 5:22
1

It is not necessary to rename interfaces using udev rules, as the default names used are already persistent without any udev rules. Unless you have other software which has to be able to refer to your interface as eth0 (unlikely since you're adding it to a bridge rather than configuring it for ip traffic directly), it is recommended to use the default names of ens3, etc.

This would also more clearly expose a problem in your config, which is that you appear to be renaming a physical interface to ext_br via udev and treating it as a bridge. Bridges don't work this way, they are purely virtual devices that you add physical interfaces to only via the interfaces: key.

It is unclear if the ifconfig is actually the result of the netplan config you've posted, since that config shows several indentation errors, differences in IP addresses, etc. It is likely that the state of the ext_br interface is the result of some earlier iteration of your config, and the current configuration fails to apply.

You should delete the udev rule that renames an interface to ext_br, reboot, and try your netplan config again.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.