leap on two hosts connected via router and host vm's do not ping

Dear Community,
I have two hosts running opensuse 42.1 connected to a dlink router via eth0, accessible on 192.168.0.1 and using NetworkManager: - vboard/eth0 is assigned via router DHCP ip 192.168.0.199 - rihana/eth0 192.168.0.198
Using KVM on both hosts, I have two opensuse VMs ( vmvboard, vmrihana) one on each host.
I configured on both hosts a virbr0 network identically, in the range 192.168.100.0/24 and DHCP range 192.168.100.128-254 and NAT on any physical device.
Vm can ping its KVM host on both side, but VM’s cannot talk to each other across router network. This config used to work on opensuse 13.2, but not using network manager…
What am I doing wrong? >:(
Is there anyone to help me with that configuration: networking with 2 hosts, a router and 2 VM’s, one on each host ?
Thanks a lot in advance for your ideas.:nerd:

It’s been a long time since I’ve tested this configuration, but you <shouldn’t> be able to ping the other Guest if each Guest is configured in a NAT network… you can think of each NAT as a router, and you shouldn’t be able to route to another physical (in this case the virtual networks are separated like physical networks) network which has the same networkID.

You <can> connect to other Guests based on the same principles of physical networks… for instance…

  • Each Guest can be configured with a virtual network which bridges on to the physical network (no NAT). The virtual networks must have the same networkID or in some cases a subnet or supernet of the other. In this configuration, both Guests are part of the same physical network while configured with virtual networks.

  • Each Guest can be configured with a NAT network, but you then need to configure forwarding and routing in the virtual networks, allowing incoming connections, and appropriate configured routing tables in the Hosts, and each virtual network must have a different networkID. This should be not much different than setting up Hosts in two different physical networks separated by a network in the middle.

If you really believe that two Guests configured in NAT virtual networks using the same networkID were able to connect to each other, there are a number of possible causes, possibly including a more permissive ARP, a tiny but critically important detail in how the Linux Bridge Device(br, virbr) was configured, maybe something else… but shouldn’t really have been possible intentionally.

IMO,
TSU

Thanks Tsu,
I’ll write it down. I found this post about creating a bridge for the VMs using Network Manager. I am giving it a try and will post steps if any success comes down the road.

https://www.happyassassin.net/2014/07/23/bridged-networking-for-libvirt-with-networkmanager-2014-fedora-21/

Regarding your reference,
Yes, it is creating the first scenario I described.

Skip the section talking about setting up Network Manager and instead follow the steps described for using virt-manger (vm manager).

TSU

Well, I tried with NetworkManager Bridging according to the referenced link on Fedora distro and couldn make it work.

https://www.happyassassin.net/2014/07/23/bridged-networking-for-libvirt-with-networkmanager-2014-fedora-21/

I suspect suseFireWall2 being the trouble maker, but I didn’t feel to dig into the guts on SUSE firewall:http://susefaq.sourceforge.net/guides/fw_manual.html

Anyway, I could set it up successfully in a YAST or command line manner with Wicked (instead of NetworkManager) and opted for a static IP defined network.

I realized that some 18 months ago, I did struggle with the same topic but using Xen Hypervisor on 2 opensuse 13.1 hosts,
each running opensuse or windows vms.

https://forums.opensuse.org/showthread.php/499849-two-pysical-servers-two-xen-hypervisor-several-domU-communicating?highlight=xen+opensuse

I ended up adopting KVM, as Windows vm support turned up much better, and overall performance of virtualization as well.
And now, after a full night and day :open_mouth: with Leap 42.1, KVM and Wicked. All KVM packages with bridgeutils, dnsmask, ebtables just in case…
And libvirt updated from Virtualization repository.

Here are the steps:

1. Bridge Networking with KVM on Leap 42.1

One of the most common use of bridge networking is for Virtualization, should it be with Xen or KVM. Each linux distro is a bit different in the way it implements it (different file systems) or network daemons (wicked, NetworkManager), but the concepts are interoperable because of the libvirt API that will use the linux bridge created.

Goal: we set up a bridge for the two host’s connection to our router and configure virtual machines on both bare metal hosts to use that bridge, which allow them to connect to the router just as if they were real physical machines that were plugged to it , and virtual and metal servers can all talk to each other. This can be done dynamically (DHCP) or statically.
In this post, we will create everything statically, just because the number of servers (physical and virtual) is less than 32 and we want to avoid network address inumerous lookups.

Still, we will implement the bridge after stopping Network Manager and activating Wicked:
configuration files are accessible in
/etc/sysconfig/network , ie. ifcfg-br0

Actually we don’t want any other ifcfg-eth0 file to stay there, since eth0 will be enslaved to br0
bridge created.

For a general understanding on how networking with wicked works, use man wicked and the likes
as documented in the following document file on your opensuse 42.1 server:

cat /usr/share/doc/packages/sysconfig/Contents

1.0. Setting the Router to STATIC by connecting to the Dlink router:

1.0.0 After resetting router to factory default ( consult your router IP, usually written on the back of the router or in the User Manual)

1.0.1 In GNOME upper-right corner, select Wifi, then Wifi Settings

1.0.2 Plug the Ethernet Cables on LAN input/output ports on both sides, and notice that a Wired Connection appears, Click on the GearBox icon and uncheck in Identity submenu, “Connect automatically”

1.0.3 Wait for the IP adress of the Router and local eth0 interface to appear:

Network IP is 192.168.0.0
Router IP: 192.168.0.1
Eth0 IP: dynamically defined through IPv4 mask 255.255.255.0
ie. through a range of IP 192.168.0.1 -> 192.168.0.254 for 254 usable IPs
or expressed in notation 192.168.0.1/24
Gateway is also 192.168.0.1

1.0.4 Connect to Router via Chrome/Firefox URL 192.168.0.1 WebUI

Username:Admin
Password: <blank>

1.0.5 Change the password, since your router might transmit on Wifi > Save > Reboot

1.0.6. In Networking Settings, simply uncheck Enable DHCP

as we want to statically define the IPs of our connected servers

1.0.7 In Gnome NetworkManager, we now slide off the Wired Connection

1.1.STATIC Bridge Configuration between 2 physical servers and a Dlink Router

1.1.0 Disable NetworkManager and Clean old interfaces/connections

Yast > Goto Network Settings: say yes to the Applet question
“Network is currently handled by NetworkManager…”

Goto Global Options > Select Wicked in the DropDown (instead of NetworkManager), then in Overview, delete all eth0, br0 or other bridges interfaces there. They appear now as Not Configured.

Click OK and Quit

ifconfig

virbr0 appears ?

Goto Virtualization Manager > Click on QEMU/KVM > Edit Connections Details
Select Virtual Network > Stop > then Delete with X Icon.

and to check status Inactive and History of NetworkManager

systemctl status NetworkManager

or

systemctl status NetworkManager -l

NetworkManager.service - Network Manager
Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; disabled)
Active: inactive (dead) since Thu 2016-01-07 09:33:55 AZOT; 0h 10min ago
Main PID: 1465 (code=exited, status=0/SUCCESS)

systemctl stop NetworkManager

or

nm-connection-editor &

And Delete any connections/interfaces/bridges appearing there

Reason to not use Network Manager:it will end up override our settings but once we are confident enough, (and able to clean old configs) we can probably do the same with NM (next post).

1.1.1 Stop the suse default Firewall

/sbin/rcSuSEfirewall2 stop

( to start it back: # /sbin/rcSuSEfirewall2 start )

1.1.2 Check clean situation with

ifconfig

shows only lo interface:

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:146900 errors:0 dropped:0 overruns:0 frame:0
TX packets:146900 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:747985733 (713.3 Mb) TX bytes:747985733 (713.3 Mb)

lspci

returns for example
…]
Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 06)

1.1.3 Deprecated in opensuse 42.1: install biosdevname package
to discover after

biosdevname -d

This has changed with opensuse 42.1 interfaces don’t have alias anymore

1.1.4 Create the Linux Bridge, it can be done with

Option 1.

Yast > Network Settings(Global tab = Wicked)

In Yast > Network Settings Overview tab ( ) >

Select Add > Device Type Bridge > Configuration Name ie. br0 in case of a first bridge created.

Select Static, and Fill in the ip address of the first host
and fill 192.168.0.2 255.255.255.224 or /27 myhost.mysite.com
Remember:
\ Network IP: 192.168.0.0
Router IP: 192.168.0.1//

up to 30 usable IPs for your bare metal and vms servers.

In Devices Tab, enslave eth0 device by selecting its checkbox. Note if eth0 not available,
goto to the cleaning step above.

Click OK

Option 2.

#cd /etc/sysconfig/network

#ls ifcfg*
returns empty
or

rm /etc/sysconfig/network/ifcfg-eth0

rm /etc/sysconfig/network/ifcfg-br0

#cat > /etc/sysconfig/network/ifcfg-br0 << EOF
BOOTPROTO=‘static’

dlink router supports only IPV4

BRIDGE=‘yes’
BRIDGE_FORWARDDELAY=‘0’
BRIDGE_PORTS=‘eth0’
BRIDGE_STP=‘off’
BROADCAST=’’
ETHTOOL_OPTIONS=’’
IPADDR=‘192.168.0.2/27’
MTU=’’
NAME=’’
NETWORK=’’
REMOTE_IPADDR=’’
STARTMODE=‘auto’
NM_CONTROLLED=‘no’
EOF

#ls ifcfg*

returns
ifcfg-br0

1.1.5 Checking the Bridge Static Implementation:

wicked ifup br0

After a while, use following commands to show the bridge & its interface available (STP disabled )

brctl show

bridge name bridge id STP enabled interfaces
br0 8000.14dae9413349 no eth0

wicked show br0

br0 up
link: #15, state up, mtu 1500
type: bridge
config: compat:suse:/etc/sysconfig/network/ifcfg-br0
leases: ipv4 static granted
addr: ipv4 192.168.0.2/27 [static]

wicked show eth0

eth0 enslaved
link: #2, state up, mtu 1500, master br0
type: ethernet, hwaddr 14:da:e9:41:33:49
config: compat:suse:/etc/sysconfig/network/ifcfg-br0

ping 192.168.0.2

PING 192.168.0.2 (192.168.0.2) 56(84) bytes of data.
64 bytes from 192.168.0.2: icmp_seq=1 ttl=64 time=0.075 ms
64 bytes from 192.168.0.2: icmp_seq=2 ttl=64 time=0.082 ms
64 bytes from 192.168.0.2: icmp_seq=3 ttl=64 time=0.081 ms
^C
— 192.168.0.2 ping statistics —
3 packets transmitted, 3 received, 0% packet loss, time 1998ms
rtt min/avg/max/mdev = 0.075/0.079/0.082/0.007 ms

1.1.6 Backing Up the bridge configuration:

mkdir -p /etc/sysconfig/network/bak

cp ifcfg-br0 bak/ifcfg-br0-static.bup

1.1.7 Deprecated:

Routes to directly connected network are created automatically (Linux

#kernel 2.4 and later) as soon as the IP address is assigned to the
#interface.

rm /etc/sysconfig/network/ifroute-br0

cat > /etc/sysconfig/network/ifroute-br0 << EOF

insert:

IPv4

default 192.168.0.30 - br0
EOF

1.1.8 Summary of usefull command lines:

/sbin/rcSuSEfirewall2 stop
/sbin/rcSuSEfirewall2 start
systemctl stop wicked
systemctl start wicked
wicked ifup br0
wicked ifstatus br0
wicked ifdown br0
nm-connection-editor &
nmcli con show (Error: NetworkManager is not running)
service NetworkManager stop
service wicked start
brctl delbr br0
brctl addbr br0
ip addr add 192.168.0.199/27 dev br0
service libvirtd reload (Restart the libvirt daemon.)

1.2. Repeat the steps above for your second bare metal host
assigning static address 192.168.0.10

#cat > /etc/sysconfig/network/ifcfg-br0 << EOF
BOOTPROTO=‘static’

dlink router supports only IPV4

BRIDGE=‘yes’
BRIDGE_FORWARDDELAY=‘0’
BRIDGE_PORTS=‘eth0’
BRIDGE_STP=‘off’
BROADCAST=’’
ETHTOOL_OPTIONS=’’
IPADDR=‘192.168.0.10/27’
MTU=’’
NAME=’’
NETWORK=’’
REMOTE_IPADDR=’’
STARTMODE=‘auto’
NM_CONTROLLED=‘no’
EOF

wicked ifup br0

1.3.STATIC Bridge Usage for Virtual Machines

1.3.1 Check that no Virtual Network are set-up :

virsh net-list

returns empty

otherwise

virsh net-destroy <network name>

This means that the Linux Bridge is not visible in Virtual Machine Manager or virsh-net,
as it would be the case for a regular NAT Virtual Network Interface.
For transparency reason, we could create it as follow, but as it is “transient”, it would have to be done after shutting down the Virtualization.

1.3.2. Create the br0 Transient Virtual Network with virsh and xml ?

cd /run/libvirt/network

#ls
nwfilter.leases virbr0.pid

Check ls output and remove any leftover

#rm virbr0.pid

#rm eth0_br0.xml

cat > eth0_br0.xml <<EOF

<network>
<name>eth0_br0</name>
<forward mode=“bridge”/>
<bridge name=“br0”/>
</network>
EOF

virsh net-list

virsh net-create eth0_br0.xml

virsh net-list

virsh net-info eth0_br0

Name: eth0_br0
UUID: dc025476-2e49-46e7-888b-f633b33e09d5
Active: yes
Persistent: no
Autostart: no
Bridge: br0

virt-manager

Click Connect on QEMU/KVM - Not Connected > Virtual Networks

eth0_br0 now appears there.

virsh net-dumpxml eth0_br0 > eth0_br0.bup.xml

vboard:/run/libvirt/network # cat eth0_br0.bup.xml
<network>
<name>eth0_br0</name>
<uuid>dc025476-2e49-46e7-888b-f633b33e09d5</uuid>
<forward mode=‘bridge’/>
<bridge name=‘br0’/>
</network>

1.3.3 Adjust the Vm Network Controller in Vm :

Select Vm and Open > Click the Lamp Icon, then Select NIC :xx:xx:xx
Click Remove button on the Right

Option 1: Virtual Network has been created via step 1.3.2:

Add Hardware > Network > Network Source > Select eth0_br0 in the dropdown
Leave the suggested MAC Address
Select the Device Model ( depends on Vm OS drivers available )
Click Apply

Option 2: Virtual Network has not been created via step 1.3.2:

Add Hardware > Network > Network Source > Select Specify Shared Device Name > type br0
Leave the suggested MAC Address
Select the Device Model ( depends on Vm OS drivers available )
Click Apply

1.3.4 Adjust Vm Network Settings to statically assign the IP to your Vm.

Select the Terminal Icon and Click the Play Button

Once Logged in the VM,

  • linux with GNOME-Yast: Goto to Network Settings, Disable NetworkManager and Select Wicked.
    Enter the dedicated static IP in eth0 Interface
  • windows: Change Adapter Setting, Right Click on Network Adapter and Select Properties>IPV4>Edit
    Enter the dedicated static IP in eth0 Interface

IP 192.168.0.3
MASK 255.255.255.224
Gateway 192.168.0.1

ipconfig or ipconfig

1.3.5. Adjust HOSTNAME in Yast-Linux or Hosts in Windows

1.3.6. Repeat the steps 1.3.5 in the respective hosts (dom0).

1.3.7 Check Interfaces in host terminal with:

#virsh domiflist <vm_domain>

Interface Type Source Model MAC

vnet0 bridge br0 rtl8139 52:54:00:14:dc:04

#virsh domifstat bw vnet0

vnet0 rx_bytes 110600
vnet0 rx_packets 629
vnet0 rx_errs 0
vnet0 rx_drop 0
vnet0 tx_bytes 1390
vnet0 tx_packets 19
vnet0 tx_errs 0
vnet0 tx_drop 0

1.3.8 Create the same virtual network in bare host (step 1.3.2) and adjust vms as
step 1.3.3 > 1.3.7

virsh net-list

cd /run/libvirt/network

#ls

#rm virbr0.pid
#rm eth0_br0.xml

cat > eth0_br0.xml <<EOF

<network>
<name>eth0_br0</name>
<forward mode=“bridge”/>
<bridge name=“br0”/>
</network>
EOF

virsh net-list

virsh net-create eth0_br0.xml

1.4 Summary of usefull command lines:

#virsh help virsh
#virsh help domain
#virsh help monitor
#virsh help host
#virsh help interface
#virsh help filter
#virsh help network
#virsh help nodedev
#virsh help secret
#virsh help snapshot
#virsh help pool
#virsh help volume

#/sbin/rcSuSEfirewall2 stop
#/sbin/rcSuSEfirewall2 start
#systemctl stop wicked
#systemctl start wicked
#wicked ifup br0
#wicked ifstatus br0
#wicked ifdown br0
#nm-connection-editor &
#nmcli con show (Error: NetworkManager is not running)
#service NetworkManager stop
#service wicked start
#brctl delbr br0
#brctl addbr br0
#ip addr add 192.168.0.199/27 dev br0
#service libvirtd reload (Restart the libvirt daemon.)

brctl delbr br0

netstat -ia

Kernel Interface table
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
br0 1500 0 6216 0 0 0 528 0 0 0 BMRU
eth0 1500 0 8418 0 0 0 3605 0 0 0 BMRU
vnet0 1500 0 19 0 0 0 1193 0 0 0 BMRU

for kernel interfaces beware the flag
B broadcat address is set up U up R running L loopback P point-to-point M promiscuous

netstat -r

Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.0.0 * 255.255.255.224 U 0 0 0 br0

Hope this will help. I’ll update it with Dynamic DHCP and/NetworkManager eventually later on.
I wish I could realize the same without a router, with the limit of two connected physical hosts.

Cheers,

lucodealethea

Well,
Congrats on finding a working solution.

But, believe me it would have been a lot simpler and easy to just set up using virtual networks that bridge to the physical network as I recommended. You probably would be working in just a few minutes without stress and hard work.

The simple ideas my recommendation is based on…

  • It doesn’t matter whether you use a network manager or not (or any) in the client, although static addresses can ensure consistent IP addressing if you don’t have a way to discover when an address changes.

  • When a Guest connects to a network using a bridging virtual network, the Guest is seen and behaves like any physical host on the network, so you can design, conceptualize, connect and troubleshoot the Guest like any other physical Host on the network.

  • Based on the above principle, when the Guests are assigned IP addresses the same as the physical Hosts, then the Guests are seen and behave like any other Host on the physical network. But, if the IP addresses of the Guests are assigned IP addresses with their own networkID, then they see only each other other and don’t communicate with any other Host, virtual or physical. This is no different than what can be built using all physical machines and no virtual machines.

TSU

Yes, you are totally right, just applying principles.
I agree this is not a straight, but very verbose solution,
and should be done in a few clicks with Wicked or NetworkManager.
Maybe I set it up as a tutorial for networking/virtualization end-user like me.
I’ll get back to it with a quick handy solution.
Thanks, TSU for the concepts and your continuous support.

Bridged Network for hosts and vms in a few clicks : wicked or network manager.

  1. Leaving router settings as previously defined in previous implementation
    ie. static IP on 192.168.0.1 subnet mask 255.255.255.224.

Making sure the router is turned on.

1. Setting up the Bridged Network with Libvirt/virt-manager and Wicked opensuse network
service.

**1.1 Clean host1 and host2 previous bridge definitions **
with YAST/NetworkManager/Network Settings/

> Global Options Tab> Select in Dropdown: Wicked
> Overview Tab > Delete all Interfaces to make them appear as “not configured”
> HostName/DNS > Note that your hostname , domain remains there
> Routing Tab> Enable IPv4 Forwarding is off (no routing features for host1 and host2)

Click Ok.

This has now cleaned all interfaces/bridges and activated Wicked Network Service,
instead of Network Manager:GNOME/Right Upper Corner has no Wired/Wifi Settings Menu Options.

1.2 Check the cleanup in Gnome Terminal as root:

su root

Password:

cd /etc/sysconfig/network

ls ifcfg

returns only
ifcfg-lo ifcfg.template

ls .ifcfg*

ls: cannot access .ifcfg*: No such file or directory

but in case there are still .ifcfg-br0 .ifcfg-eth0,

rm .ifcfg-br0

rm .ifcfg-eth0

ifconfig

shows only lo interface:

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
…]

Check if wicked is active:

systemctl status wicked

wicked.service - wicked managed network interfaces
Loaded: loaded (/usr/lib/systemd/system/wicked.service; enabled)
Active: active (exited) since Fri 2016-01-08 15:37:56 AZOT; 34min ago

2. Setting up the Bridge with LIBVIRT:
Gnome Terminal command line:

virt-manager

or

GNOME YAST/Virtualization/Create Vm,followed by Cancel Creation

2.1 Click on your hypervisor QEMU/KVM to connect ( in my case QEMU/KVM )

2.2 Menu Edit/Connections Details or Right-Click Details

2.3 Goto Network Interfaces Tab > Click + (Add) > Bridge > Forward :

Name : br0
Start Mode: none
Activate Now: checked on
IP Settings: Leave DHCP
or Configure, Mode: Static ( to continue on previous example and because VMs IP are already statically defined)
Address: 192.168.0.2/27 (equivalent to Subnet Mask set to 255.255.255.224)
Gateway 192.168.0.1
Bridge Settings: turn STP off ( no complex networks )
Choose Interface(s)to Bridge
eth0 is checked

2.4 Finish - This will take sometimes to set up.
“The virtual interface is now being created.” Processing…

And br0 or brx shows as active.

2.5 Adjust your VMs Network NIC settings while they are still down

2.5.0 Remove Old NIC from VM:
Virt-Manager > Select VM > Open > Click Lamp Icon > Select NIC > Click Remove (right-down corner).
Note: if Lamp Icon does not appear after Open, Goto View and Select Toolbar checkbox.

2.5.1 Add new NIC to VM:
Virt-Manager > Select VM > Open > Click Lamp Icon > Add Hardware > Network >

Network source: Bridge br0: host device eth0
MAC Address: checked, leave the suggested one
Device Model: Hypervisor Default or the one you know the vm-guest has the driver for.

> Finish

2.5.2 Run the VM and test in VM’s Gnome Terminal

ping vm

ping host1

etc…

2.6 Repeat the steps in host2 bare metal,
with Step 1 and subsequent 2.3 with
Name : br0
Start Mode: none
Activate Now: checked on
IP Settings: Leave DHCP
or Configure, Mode: Static
Address: 192.168.0.10/27
Bridge Settings: turn STP off
Choose Interface(s)to Bridge eth0 is checked

2.7 Adjust host2 VMs Network NIC settings according to 2.5

Conclusion: With a clean starting situation, rcSuSEfirewall2 status active or not doesn’t matter,
virt-manager could set up the bridge and network connection to the router successfully,
**in just a few clicks. **

3. Setting up the Bridged Network with Libvirt/virt-manager and NetworkManager**.**

3.0 In Libvirt/virt-manager:

3.0.1.
Stop Network Bridge br0
“Are you sure you want to stop the interface br0 ?” > Yes
then Delete it:
“Are you sure to permanently delete the interface br0 ?” > Yes
3.0.2
Stop Network Interface eth0
“Are you sure you want to stop the interface eth0 ?” > Yes
then Delete it:
“Are you sure to permanently delete the interface eth0 ?” > Yes

3.1 Set Network Manager via YAST/NetworkManager/Network Settings/

> Global Options Tab> Select in Dropdown: NetworkManager
Pop Up: No Network is running.

This has now cleaned all interfaces/bridges and activated Wicked Network Service,
instead of Network Manager:GNOME/Right Upper Corner has no Wired/Wifi Settings Menu Options.

3.2 Check the cleanup in Gnome Terminal as root:

su root

Password:

cd /etc/sysconfig/network

ls ifcfg

returns only
ifcfg-lo ifcfg.template

ls .ifcfg*

there are still .ifcfg-br0 .ifcfg-eth0,

rm .ifcfg-br0

rm .ifcfg-eth0

ifconfig

eth0 Link encap:Ethernet HWaddr 14:DA:E9:41:33:49
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
…]

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0

we bring eth0 down :

ifconfig eth0 down

3.3 Setting up the Bridge with LIBVIRT, Network Manager running (systemctl status NetworkManager):

Gnome Terminal command line:

virt-manager

or

GNOME YAST/Virtualization/Create Vm,followed by Cancel Creation

3.3.1 Click on your hypervisor QEMU/KVM to connect ( in my case QEMU/KVM )

3.3.2 Menu Edit/Connections Details or Right-Click Details

3.3.3 Goto Network Interfaces Tab > Click + (Add) > Bridge > Forward :

Name : br0
Start Mode: none
Activate Now: checked on
IP Settings: Leave DHCP
or Configure, Mode: Static ( to continue on previous example and because VMs IP are already statically defined)
Address: 192.168.0.2/27 (equivalent to Subnet Mask set to 255.255.255.224)
Gateway 192.168.0.1
Bridge Settings: turn STP off ( no complex networks )
Choose Interface(s)to Bridge
eth0 is checked

3.3.4 Finish -

Error creating interface: 'Could not create interface: internal error: failed to create (start) interface br0: other error - Unable to start interface ‘br0’'

3.4 Gnome Terminal to set up the bridge with NetworkManager:

nm-connection-editor &

Click Add, set the dropdown to Bridge, and Click Create…

3.4.1 Window Editing Bridge Connection X, Tab Bridge:

Interface Name: bridge0 ( different Network Manager naming convention than br0 )
Bridge Connections Pane > Button Add:
> Choose Connection Type - Dropdown Box: Ethernet > Create
> Device - Dropdown eth0 (xx:xx:xx:00:00:00) > Save

Enable STP : unchecked
Forward Delay: unchanged

3.4.2 Window Editing Bridge Connection X, Tab IPv4Settings:
> Method - Dropdown : Manual
Addresses Pane > Button Add :
Address box: 192.168.0.2
Netmask:27 (from 192.168.0.2/27)
Gateway: 192.168.0.1

> Save

> Network Connections > Close

3.5.2 Check Bridge in ifconfig

ifconfig

bridge0 Link encap:Ethernet HWaddr 46:6C:F1:A1:BF:F4
inet addr:192.168.0.2 Bcast:192.168.0.31 Mask:255.255.255.224
…]

brctl show

bridge name bridge id STP enabled interfaces
bridge0 8000.000000000000 yes

Note: interfaces looks empty ??

cd /etc/NetworkManager/system-connections

ls

# nmcli con show
NAME UUID TYPE DEVICE
Bridge connection 1 c53a922d-bca0-4e9d-bf48-c335e76eecb9 bridge bridge0
bridge0 slave 1 950a5f63-11b5-4407-a00d-6afd7b7e397f 802-3-ethernet eth0

# nmcli con up 950a5f63-11b5-4407-a00d-6afd7b7e397f

3.5 Check Network in libvirt:

#virt-manager

Click on your hypervisor QEMU/KVM to connect >
Menu Edit/Connections Details or Right-Click Details

> Goto Network Interfaces Tab: empty
> Goto Virtual Networks Tab: empty

3.6 Adjust your VMs Network NIC settings while they are still down

3.6.0 Remove Old NIC from VM:
Virt-Manager > Select VM > Open > Click Lamp Icon > Select NIC > Click Remove (right-down corner).
Note: if Lamp Icon does not appear after Open, Goto View and Select Toolbar checkbox.

3.6.1 Add new NIC to VM:
Virt-Manager > Select VM > Open > Click Lamp Icon > Add Hardware > Network >

Network source: Specify device name: bridge0
MAC Address: checked, leave the suggested one
Device Model: Hypervisor Default or the one you know the vm-guest has the driver for.

> Finish

3.6.2 Run the VM and test in VM’s Gnome Terminal

ping vm

ping host1

etc…

Conclusion:
With a clean starting situation, rcSuSEfirewall2 status active or not doesn’t matter,

NetworkManager (1.0.6-1.2) running, virt-manager (libvirt 1.2.18.1) could not set up the bridge and network connection to the router successfully,
in just a few clicks.
Upgrade to libvirt libvirt 1.3.0-544.3 didn’t help much, to the contrary, Network Interface cannot be set up anymore via libvirt, not even with Wicked…

This is a bit disappointing. Workaround is to do it with nm-connection-editor as described,
adjust the VMs NIC manually, and accept that virt-manager doesn’t know about the Network Interface.
An advantage is to have a little more flexibility to connect to Wifi network once NetworkManager is on.

Thanks to TSU advice and encouragement to find the shortest way.

Only comment…

When configuring Guests, you only need to configure a wired connection to eth0 (or its equivalent) <within> the Guest and then you may never again modify the settings regardless what changes happen outside the network. The only main change you may need to make from time to time is as a DHCP client or not.

All configurations connecting to virtual networks (by bridge devices like br0, virbr0, etc) are made in the Guest properties. You can switch between any available “br” type device representing a virtual network even on the fly (no rebooting) including switching between different types of networking (eg NAT, bridging, host-only) and physical networks (eg wired 802.3, WiFi, other)

So,
The work you did to remove and re-create the Guest virtual network adapter(Guest properties) and network adapter(within the Guest) are unnecessary.
Just modify the properties of the old, working existing virtual network adapter (Guest properties) pointing to your new virtual network and it’ll be working right away (well, you actually may have to restart the network services in the Guest to acquire a new IP address from the DHCP on your new network).

TSU

Yes, I realized that because I double checked again what was installed on the main opensuse 42.1 hosts. And needed to refresh some spice libs into the guests through wifi connections ( my router is not connected to internet).
Different types of networking can live along in libvirt- virtual networks / Network interfaces activating/deactivating on the fly…

I ended-up upgrading to more recent packages with the hope that integration between libvirt and NetworkManager would orchestrate properly.

virt-manager 1.3.1 xen-libs 4.6.0_06, libvirt 1.3.0-544.3 qemu 2.4.0-314.6 NetworkManager 1.0.8-76 ( instead of 1.0.6 )

But unfortunately, it didn’t work any better. So, if NetworkManager is the way to go, they are still some clumpsy command lines to run to launch the bridge. Still, I keep the impression that there is a way to make it more streamlined.

How to keep up-to-date with last fixes on libvirt, virt-manager and NetworkManager integration, considering it as a bug or not…?

Cheers,

luco

You’ll probably never see any intentional libvirt/NM integration.

Each project has its own domain of objectives and they really don’t intersect anywhere that I can see.

You can suggest something to each project, but I doubt it would likely go anywhere since AFAIK most Admins will architect their networking as I described using Linux Bridge Devices (except the Docker project which apparently has decided to go in another direction)… LXC, VBox, libvirt, VMware, Hyper-V, Xen, the list goes on and on for all the virtualization techbnologies which use this same networking architecture… And, if you decide to install more than one virtualization technology on your machine (but never run more than one at once! ) you’ll find that all these virt technologies will happily using a virtual network and bridge device that was created by another technology.

For any technologies which are installed from openSUSE repos, you can update to latest available versions (and update everthing else on your system) with

zypper up

TSU