Tuesday, March 5, 2024

Network Manager CLI && KVM Guests support on openSUSE Tumbleweed (Leap)

UPDATE as of 03/07/24

I was able to reproduce procedure below on openSUSE_Krypton.x86_64-16.0-Build11.97 ( KDE Plasma 6.0.80 Development branch )




END UPDATE

This post gives a detailed description of procedure creating  network bridge via nmcli commands and virsh CLI. Same procedure was also tested with no issues on openSUSE Leap 15.5. Both tests have been performed in VENV and allow to avoid setup of Cockpit Web Console via  https://download.opensuse.org/repositories/systemsmanagement:cockpit/15.5/systemsmanagement:cockpit.repo

 boris@localhost:~> sudo nmcli connection add type bridge con-name bridge0 ifname bridge0

[sudo] password for root:  

Connection 'bridge0' (60025474-7c94-41fd-bf5b-3340ed0673da) successfully added.

boris@localhost:~> ip a

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000

   link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

   inet 127.0.0.1/8 scope host lo

      valid_lft forever preferred_lft forever

   inet6 ::1/128 scope host noprefixroute  

      valid_lft forever preferred_lft forever

2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000

   link/ether 52:54:00:0f:34:63 brd ff:ff:ff:ff:ff:ff

   inet 192.168.0.103/24 brd 192.168.0.255 scope global dynamic noprefixroute enp1s0

      valid_lft 27584sec preferred_lft 27584sec

   inet6 fe80::5054:ff:fe0f:3463/64 scope link noprefixroute  

      valid_lft forever preferred_lft forever

3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000

   link/ether 52:54:00:21:1f:52 brd ff:ff:ff:ff:ff:ff

   inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0

      valid_lft forever preferred_lft forever

4: bridge0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000

   link/ether 0e:3c:fe:fa:68:5e brd ff:ff:ff:ff:ff:ff

boris@localhost:~> sudo nmcli connection add type ethernet slave-type bridge  con-name 'Bridge connection 1' ifname enp1s0 master bridge0

Connection 'Bridge connection 1' (9ea502dc-838a-40a4-bc36-2605fe0436cb) successfully added.

boris@localhost:~> sudo nmcli connection up bridge0

Connection successfully activated (master waiting for slaves) (D-Bus active path: /org/freedesktop/NetworkManager

/ActiveConnection/5)

boris@localhost:~> sudo nmcli connection modify bridge0 connection.autoconnect-slaves 1

boris@localhost:~> sudo nmcli connection up bridge0

Connection successfully activated (master waiting for slaves) (D-Bus active path: /org/freedesktop/NetworkManager

/ActiveConnection/6)

boris@localhost:~> sudo reboot 

boris@localhost:~> cat  nwbridge.xml

<network>

 <name>nwbridge</name>

 <forward mode='bridge'/>

 <bridge name='bridge0'/>

</network>

boris@localhost:~> sudo virsh net-define nwbridge.xml

[sudo] password for root:  

Network nwbridge defined from nwbridge.xml

boris@localhost:~> sudo virsh net-start nwbridge

Network nwbridge started

boris@localhost:~> sudo virsh net-autostart nwbridge

Network nwbridge marked as autostarted

boris@localhost:~> sudo virsh net-list --all

Name       State    Autostart   Persistent

---------------------------------------------

default    active   yes         yes

nwbridge   active   yes         yes







































































































































No comments:

Post a Comment