brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: netplan bridges move the IP address from the NIC to the bridge

Netplan
~/tips/tip-netplan-bridge-address-on-bridge

network: {version: 2, ethernets: {enp3s0: {}}, bridges: {br0: {interfaces: [enp3s0], dhcp4: true}}}

Builds a bridge in netplan and gives the address to the bridge.

A bridge for VMs or containers is a common first reason to edit netplan files. The usual mistake is leaving the address on the physical port.

# /etc/netplan/61-bridge.yaml
network: {version: 2, ethernets: {enp3s0: {}}, bridges: {br0: {interfaces: [enp3s0], dhcp4: true}}}

The NIC is listed under ethernets with no addressing, and the bridge gets dhcp4 or a static address. Every interface in the bridge list must also be defined in the netplan configuration. Use netplan try for the change, since the connection drops while the address moves. Remove any old address or DHCP setting on enp3s0 in other files, because files merge and the old setting would stay active.

Further reading: Netplan YAML configuration reference

More Netplan tips – to: 192.168.3.0/24 hidden: true lacp-rate: fast link-local: [] wakeonlan: true All Netplan tips (21) All topics

Link