[Networkmanager] nic sub-interface
Greg Oliver
oliver.greg at gmail.com
Mon May 8 16:56:12 UTC 2023
On Mon, May 8, 2023 at 10:50 AM Robin Becker <robin at reportlab.com> wrote:
> On 08/05/2023 15:04, Thomas Haller wrote:
> > Hi,
> >
> >
> .........
> >
> > Why? After moving the port to the bridge, the "new" configuration is
> > supposed to work. Just add the IP addresses (or `ipv4.method=auto`) on
> > the bridge profile, instead of the eno1 profile from before.
> .......
> I am almost certain this is right, but perhaps my router is interfering.
>
> I will try again and perhaps I need to clear my head around what's talking
> to what. Since the router assigns using a mac
> address perhaps I need to force the bridge and/or the nic to be more
> specific and just fix the addresses.
>
> > It's not clear to me what a "sub interface eno1.1" is. Where does this
> > recommendation come from?
>
> I get this from
>
> https://linuxconfig.org/how-to-use-bridged-networking-with-libvirt-and-kvm
>
> under "Adding a physical ethernet interface to the bridge"
>
> On our old servers in /etc/network/interfaces we have sections like
>
> # The primary network interface
> auto eno1
> iface eno1 inet static
> address yy.yy.yy.yy
> netmask 255.255.240.0
>
>
> auto eno1:0
> iface eno1:0 inet static
> address xx.xx.xx.xx
> netmask 255.255.240.0
>
> so I assumed I could do something similar with NM and have two connections
> using the same physical device.
>
> I am no networking genius though
I use NM to do exactly what you are trying with the exception of setting a
fixed MAC on the bridge interface. I configured it all with
nm-connection-editor, but I will be more than happy to share the generated
config files with you (hope it helps) and by the way I use bridge0 as the
interface in Qemu/LibVirt/Boxes, etc..
[greg at carbon-x1--g10 ~]$ ip a
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master
bridge0 state UP group default qlen 1000
link/ether 00:e0:4c:68:07:d2 brd ff:ff:ff:ff:ff:ff
altname enp0s13f0u3u1
4: bridge0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state
UP group default qlen 1000
link/ether 00:e0:4c:68:07:d2 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.10/24 brd 192.168.1.255 scope global dynamic
noprefixroute bridge0
valid_lft 78669sec preferred_lft 78669sec
eth0 is my wired dongle (assigned to "bridgeo port 1")
bridge0 is the bridge
You should just be able to tell the bridge after it is created to preserve
eth0's MAC address.
[greg at carbon-x1--g10 ~]$ nmcli connection
NAME UUID TYPE
DEVICE
bridge0 fafed9b3-8dad-4552-b1b4-0f620d985eb3 bridge
bridge0
bridge0 port 1 2b7a76c4-4bef-4c46-a5e8-3129b6361582 ethernet
eth0
Wired - LenovoBed Dongle 3ba19fca-63e3-3975-b5e3-69bb6b56ea5c ethernet
--
connection.id: Wired - LenovoBed Dongle
connection.uuid: 3ba19fca-63e3-3975-b5e3-69bb6b56ea5c
connection.stable-id: --
connection.type: 802-3-ethernet
connection.interface-name: eth0
connection.autoconnect: yes
connection.autoconnect-priority: -999
connection.autoconnect-retries: -1 (default)
connection.multi-connect: 0 (default)
connection.auth-retries: -1
connection.timestamp: 1682522928
connection.read-only: no
connection.permissions: --
connection.zone: --
connection.master: --
connection.slave-type: --
connection.autoconnect-slaves: -1 (default)
connection.secondaries: --
connection.gateway-ping-timeout: 0
connection.metered: unknown
connection.lldp: default
connection.mdns: -1 (default)
connection.llmnr: -1 (default)
connection.dns-over-tls: -1 (default)
connection.mptcp-flags: 0x0 (default)
connection.wait-device-timeout: -1
connection.wait-activation-delay: -1
802-3-ethernet.port: --
802-3-ethernet.speed: 0
802-3-ethernet.duplex: --
802-3-ethernet.auto-negotiate: no
802-3-ethernet.mac-address: 00:E0:4C:68:07:D2
802-3-ethernet.cloned-mac-address: preserve
802-3-ethernet.generate-mac-address-mask:--
802-3-ethernet.mac-address-blacklist: --
802-3-ethernet.mtu: auto
802-3-ethernet.s390-subchannels: --
802-3-ethernet.s390-nettype: --
802-3-ethernet.s390-options: --
802-3-ethernet.wake-on-lan: default
802-3-ethernet.wake-on-lan-password: --
802-3-ethernet.accept-all-mac-addresses:-1 (default)
ipv4.method: auto
ipv4.dns: --
ipv4.dns-search: --
ipv4.dns-options: --
ipv4.dns-priority: 0
ipv4.addresses: --
ipv4.gateway: --
ipv4.routes: --
ipv4.route-metric: -1
ipv4.route-table: 0 (unspec)
ipv4.routing-rules: --
ipv4.replace-local-rule: -1 (default)
ipv4.ignore-auto-routes: no
ipv4.ignore-auto-dns: no
ipv4.dhcp-client-id: --
ipv4.dhcp-iaid: --
ipv4.dhcp-timeout: 0 (default)
ipv4.dhcp-send-hostname: yes
ipv4.dhcp-hostname: --
ipv4.dhcp-fqdn: --
ipv4.dhcp-hostname-flags: 0x0 (none)
ipv4.never-default: no
ipv4.may-fail: yes
ipv4.required-timeout: -1 (default)
ipv4.dad-timeout: -1 (default)
ipv4.dhcp-vendor-class-identifier: --
ipv4.link-local: 0 (default)
ipv4.dhcp-reject-servers: --
ipv4.auto-route-ext-gw: -1 (default)
ipv6.method: disabled
ipv6.dns: --
ipv6.dns-search: --
ipv6.dns-options: --
ipv6.dns-priority: 0
ipv6.addresses: --
ipv6.gateway: --
ipv6.routes: --
ipv6.route-metric: -1
ipv6.route-table: 0 (unspec)
ipv6.routing-rules: --
ipv6.replace-local-rule: -1 (default)
ipv6.ignore-auto-routes: no
ipv6.ignore-auto-dns: no
ipv6.never-default: no
ipv6.may-fail: yes
ipv6.required-timeout: -1 (default)
ipv6.ip6-privacy: -1 (unknown)
ipv6.addr-gen-mode: stable-privacy
ipv6.ra-timeout: 0 (default)
ipv6.mtu: auto
ipv6.dhcp-duid: --
ipv6.dhcp-iaid: --
ipv6.dhcp-timeout: 0 (default)
ipv6.dhcp-send-hostname: yes
ipv6.dhcp-hostname: --
ipv6.dhcp-hostname-flags: 0x0 (none)
ipv6.auto-route-ext-gw: -1 (default)
ipv6.token: --
proxy.method: none
proxy.browser-only: no
proxy.pac-url: --
proxy.pac-script: --
[greg at carbon-x1--g10 ~]$ nmcli connection show bridge0
connection.id: bridge0
connection.uuid: fafed9b3-8dad-4552-b1b4-0f620d985eb3
connection.stable-id: --
connection.type: bridge
connection.interface-name: bridge0
connection.autoconnect: yes
connection.autoconnect-priority: 0
connection.autoconnect-retries: -1 (default)
connection.multi-connect: 0 (default)
connection.auth-retries: -1
connection.timestamp: 1683556900
connection.read-only: no
connection.permissions: --
connection.zone: --
connection.master: --
connection.slave-type: --
connection.autoconnect-slaves: -1 (default)
connection.secondaries: --
connection.gateway-ping-timeout: 0
connection.metered: unknown
connection.lldp: default
connection.mdns: -1 (default)
connection.llmnr: -1 (default)
connection.dns-over-tls: -1 (default)
connection.mptcp-flags: 0x0 (default)
connection.wait-device-timeout: -1
connection.wait-activation-delay: -1
802-3-ethernet.port: --
802-3-ethernet.speed: 0
802-3-ethernet.duplex: --
802-3-ethernet.auto-negotiate: no
802-3-ethernet.mac-address: --
802-3-ethernet.cloned-mac-address: --
802-3-ethernet.generate-mac-address-mask:--
802-3-ethernet.mac-address-blacklist: --
802-3-ethernet.mtu: auto
802-3-ethernet.s390-subchannels: --
802-3-ethernet.s390-nettype: --
802-3-ethernet.s390-options: --
802-3-ethernet.wake-on-lan: default
802-3-ethernet.wake-on-lan-password: --
802-3-ethernet.accept-all-mac-addresses:-1 (default)
ipv4.method: auto
ipv4.dns: --
ipv4.dns-search: --
ipv4.dns-options: --
ipv4.dns-priority: 0
ipv4.addresses: --
ipv4.gateway: --
ipv4.routes: --
ipv4.route-metric: -1
ipv4.route-table: 0 (unspec)
ipv4.routing-rules: --
ipv4.replace-local-rule: -1 (default)
ipv4.ignore-auto-routes: no
ipv4.ignore-auto-dns: no
ipv4.dhcp-client-id: --
ipv4.dhcp-iaid: --
ipv4.dhcp-timeout: 0 (default)
ipv4.dhcp-send-hostname: yes
ipv4.dhcp-hostname: --
ipv4.dhcp-fqdn: --
ipv4.dhcp-hostname-flags: 0x0 (none)
ipv4.never-default: no
ipv4.may-fail: yes
ipv4.required-timeout: -1 (default)
ipv4.dad-timeout: -1 (default)
ipv4.dhcp-vendor-class-identifier: --
ipv4.link-local: 0 (default)
ipv4.dhcp-reject-servers: --
ipv4.auto-route-ext-gw: -1 (default)
ipv6.method: disabled
ipv6.dns: --
ipv6.dns-search: --
ipv6.dns-options: --
ipv6.dns-priority: 0
ipv6.addresses: --
ipv6.gateway: --
ipv6.routes: --
ipv6.route-metric: -1
ipv6.route-table: 0 (unspec)
ipv6.routing-rules: --
ipv6.replace-local-rule: -1 (default)
ipv6.ignore-auto-routes: no
ipv6.ignore-auto-dns: no
ipv6.never-default: no
ipv6.may-fail: yes
ipv6.required-timeout: -1 (default)
ipv6.ip6-privacy: -1 (unknown)
ipv6.addr-gen-mode: stable-privacy
ipv6.ra-timeout: 0 (default)
ipv6.mtu: auto
ipv6.dhcp-duid: --
ipv6.dhcp-iaid: --
ipv6.dhcp-timeout: 0 (default)
ipv6.dhcp-send-hostname: yes
ipv6.dhcp-hostname: --
ipv6.dhcp-hostname-flags: 0x0 (none)
ipv6.auto-route-ext-gw: -1 (default)
ipv6.token: --
bridge.mac-address: --
bridge.stp: no
bridge.priority: 32768
bridge.forward-delay: 15
bridge.hello-time: 2
bridge.max-age: 20
bridge.ageing-time: 300
bridge.group-forward-mask: 0
bridge.multicast-snooping: yes
bridge.vlan-filtering: no
bridge.vlan-default-pvid: 1
bridge.vlans: --
proxy.method: none
proxy.browser-only: no
proxy.pac-url: --
proxy.pac-script: --
GENERAL.NAME: bridge0
GENERAL.UUID: fafed9b3-8dad-4552-b1b4-0f620d985eb3
GENERAL.DEVICES: bridge0
GENERAL.IP-IFACE: bridge0
GENERAL.STATE: activated
GENERAL.DEFAULT: yes
GENERAL.DEFAULT6: no
GENERAL.SPEC-OBJECT: --
GENERAL.VPN: no
GENERAL.DBUS-PATH:
/org/freedesktop/NetworkManager/ActiveConnection/2
GENERAL.CON-PATH:
/org/freedesktop/NetworkManager/Settings/2
GENERAL.ZONE: --
GENERAL.MASTER-PATH: --
IP4.ADDRESS[1]: 192.168.1.10/24
IP4.GATEWAY: 192.168.1.254
IP4.ROUTE[1]: dst = 192.168.1.0/24, nh = 0.0.0.0,
mt = 425
IP4.ROUTE[2]: dst = 0.0.0.0/0, nh =
192.168.1.254, mt = 425
IP4.DNS[1]: 192.168.1.254
IP4.DOMAIN[1]: attlocal.net
DHCP4.OPTION[1]: dhcp_client_identifier =
01:00:e0:4c:68:07:d2
DHCP4.OPTION[2]: dhcp_lease_time = 86400
DHCP4.OPTION[3]: dhcp_server_identifier =
192.168.1.254
DHCP4.OPTION[4]: domain_name = attlocal.net
DHCP4.OPTION[5]: domain_name_servers = 192.168.1.254
DHCP4.OPTION[6]: expiry = 1683643300
DHCP4.OPTION[7]: ip_address = 192.168.1.10
DHCP4.OPTION[8]: requested_broadcast_address = 1
DHCP4.OPTION[9]: requested_domain_name = 1
DHCP4.OPTION[10]: requested_domain_name_servers = 1
DHCP4.OPTION[11]: requested_domain_search = 1
DHCP4.OPTION[12]: requested_host_name = 1
DHCP4.OPTION[13]: requested_interface_mtu = 1
DHCP4.OPTION[14]:
requested_ms_classless_static_routes = 1
DHCP4.OPTION[15]: requested_nis_domain = 1
DHCP4.OPTION[16]: requested_nis_servers = 1
DHCP4.OPTION[17]: requested_ntp_servers = 1
DHCP4.OPTION[18]:
requested_rfc3442_classless_static_routes = 1
DHCP4.OPTION[19]: requested_root_path = 1
DHCP4.OPTION[20]: requested_routers = 1
DHCP4.OPTION[21]: requested_static_routes = 1
DHCP4.OPTION[22]: requested_subnet_mask = 1
DHCP4.OPTION[23]: requested_time_offset = 1
DHCP4.OPTION[24]: requested_wpad = 1
DHCP4.OPTION[25]: routers = 192.168.1.254
DHCP4.OPTION[26]: subnet_mask = 255.255.255.0
IP6.GATEWAY: --
[greg at carbon-x1--g10 ~]$ nmcli connection show "bridge0 port 1"
connection.id: bridge0 port 1
connection.uuid: 2b7a76c4-4bef-4c46-a5e8-3129b6361582
connection.stable-id: --
connection.type: 802-3-ethernet
connection.interface-name: eth0
connection.autoconnect: yes
connection.autoconnect-priority: 0
connection.autoconnect-retries: -1 (default)
connection.multi-connect: 0 (default)
connection.auth-retries: -1
connection.timestamp: 1683556900
connection.read-only: no
connection.permissions: --
connection.zone: --
connection.master: bridge0
connection.slave-type: bridge
connection.autoconnect-slaves: -1 (default)
connection.secondaries: --
connection.gateway-ping-timeout: 0
connection.metered: unknown
connection.lldp: default
connection.mdns: -1 (default)
connection.llmnr: -1 (default)
connection.dns-over-tls: -1 (default)
connection.mptcp-flags: 0x0 (default)
connection.wait-device-timeout: -1
connection.wait-activation-delay: -1
802-3-ethernet.port: --
802-3-ethernet.speed: 0
802-3-ethernet.duplex: --
802-3-ethernet.auto-negotiate: no
802-3-ethernet.mac-address: 00:E0:4C:68:07:D2
802-3-ethernet.cloned-mac-address: preserve
802-3-ethernet.generate-mac-address-mask:--
802-3-ethernet.mac-address-blacklist: --
802-3-ethernet.mtu: auto
802-3-ethernet.s390-subchannels: --
802-3-ethernet.s390-nettype: --
802-3-ethernet.s390-options: --
802-3-ethernet.wake-on-lan: default
802-3-ethernet.wake-on-lan-password: --
802-3-ethernet.accept-all-mac-addresses:-1 (default)
bridge-port.priority: 32
bridge-port.path-cost: 100
bridge-port.hairpin-mode: no
bridge-port.vlans: --
GENERAL.NAME: bridge0 port 1
GENERAL.UUID: 2b7a76c4-4bef-4c46-a5e8-3129b6361582
GENERAL.DEVICES: eth0
GENERAL.IP-IFACE: eth0
GENERAL.STATE: activated
GENERAL.DEFAULT: no
GENERAL.DEFAULT6: no
GENERAL.SPEC-OBJECT: --
GENERAL.VPN: no
GENERAL.DBUS-PATH:
/org/freedesktop/NetworkManager/ActiveConnection/1
GENERAL.CON-PATH:
/org/freedesktop/NetworkManager/Settings/1
GENERAL.ZONE: --
GENERAL.MASTER-PATH:
/org/freedesktop/NetworkManager/Devices/4
IP4.GATEWAY: --
IP6.GATEWAY: --
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/networkmanager/attachments/20230508/d564c854/attachment-0001.htm>
More information about the Networkmanager
mailing list