Finally, I got eventually my homework .done…As decribed by TSU, we are in a Linux bridge scenario
Scenario :
- Two physical hosts running openSuse 13.1 and
- two hypervisors Xen or KVM with
- all vm’s and hosts communicating (inbound-outbound)
- on the same local (isolated from outside) network 192.168.0.0 restricted to 255.255.255.192 /26
- One Dlink router ( apparently without LAN bridging capabilities)
- static dhcp definition / or dynamic
- Using NetworkManager or Not, but NetWork Manager does a better job to switch easily to your wifi network (after breaking off local ethernet network)
- No Firewall or Wifi bridging
Reading : on your opensuse 13.1 server /usr/share/doc/packages/sysconfig
README.virtualization
Network and netconfig.png
http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
3 Steps :
-
Create Physical connections
-
Create Linux Bridge
-
Create Virtual Network using Linux Bridge
-
Plug your router and make sure, it is set to factory standard, for example with a local
ip 192.168.0.1, theoretically comes with DHCP on, meaning that any host connecting via NIC card will get assigned
automatically a sequenced/randow ip address defined in the net defined on the router
In FireFox http://192.168.0.1 > username password > Network Settings : IP and netmask 192.168.0.0 restricted to 255.255.255.192 /26
Range 192.168.0.2 - 192.168.0.62
Static is easier in such a small network for this exercise…
- on host A and B : Yast > Goto Services Manager > Disable Network Manager
Reason: Network Manager will end up override your settings but when you are confident enough
you can do the same with NM
- on host A and B Yast > Goto Network Settings > Delete All Interfaces >
they appear now as Not Configured and with command line look @
ls /etc/sysconfig/network
> notice that no ifcfg-br0, ifcfg-virbr0, ifcfg-eth0 or ifcfg-enp5s0 files exist
> if some do exist
mkdir -p /etc/sysconfig/network/bak
mv ifcfg-br bak/*
those configuration files are created when you use Yast > NetWork Settings
by the traditional way with ifup and not NetWork manager
ifconfig
shows only lo interface
2.1. on host A and B :Create the linux bridge with Yast > NetWork Settings > Add > Device Type Bridge > Configuration Name ( will concatenate the number choosen in the dropdown menu to predefined conventiomnal string “br” , ie. br0 in case of a first bridge created).
Note: You are not tight to this convention anymore with NetWork Manager
Fill in the ip address of the router ( when you had the chance to write down its ip)
and fill 192.168.0.1 255.255.255.0 or /24 myhost.mysite.com
Then
Goto Bridged Device Tab > Select enp5s0 or other ethernet NIC device and finish
ifconfig
> Doesn’t show the bridge and interface ?
service network stop
service network start
or
Go back to Network Settings > Edit Bridge Br0 > Global View > Change the Option StartUp On Boot to HotPlug
or
ifconfig enp5s0 down
ifconfig br0 down
cd /etc/sysconfig/network
cat cfcfg-br0
and you will notice that BRIDGE_PORTS is blank,
vim /etc/sysconfig/network/ifcfg-br0
edit according to’enp5s0’ or your ehernet NIC if, save and exit
BRIDGE_PORTS=’’ >> BRIDGE_PORTS=‘enp5s0’
ifconfig enp5s0 up
ifconfig br0 up
brctl show
bridge name bridge id STP enabled interfaces
br0 8000.14dae9413349 no enp5s0
reboot now
reboot in Xen Domain0
2.2
on host A ( and B : br0 with different HwAddr linked differently to enp5s0f2)
ifconfig
shows properly
br0 Link encap:Ethernet HWaddr 14:DA:E9:41:33:49
inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::16da:e9ff:fe41:3349/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:95 errors:0 dropped:0 overruns:0 frame:0
TX packets:97 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:5448 (5.3 Kb) TX bytes:13255 (12.9 Kb)
enp5s0 Link encap:Ethernet HWaddr 14:DA:E9:41:33:49
inet6 addr: fe80::16da:e9ff:fe41:3349/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:142 errors:0 dropped:0 overruns:0 frame:0
TX packets:131 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:44052 (43.0 Kb) TX bytes:18555 (18.1 Kb)
- On host A:
3.1 Create the Virtual Network with virsh and xml
cd /usr/share/libvirt/networks
cat > enp5s0_br0.xml <<EOF
<network>
<name>enp5s0_br0</name>
<forward mode=“bridge”/>
<bridge name=“br0”/>
</network>
EOF
On Host B:
cd /usr/share/libvirt/networks
cat > enp5s0f2_br0.xml <<EOF
<network>
<name>enp5s0f2_br0</name>
<forward mode=“bridge”/>
<bridge name=“br0”/>
</network>
EOF
virsh net-list
virsh net-destroy default
in case virsh net-list shows other network running
host A
vish net-create enp5s0_br0.xml
host B
vish net-create enp5s0f2_br0.xml
virsh net-list
net-list list networks
net-autostart autostart a network
3.2. Change the vm definition files in /etc/xen/vm
native and xml file definition for the ds virtual machine
name=“ds”
description=“ds”
uuid=“c23e07d0-5e6a-76cc-26da-6c6bae394a4c”
memory=2465
maxmem=2465
…]
>> vif= ‘mac=00:16:3e:23:a4:66,script=vif-bridge,bridge=br0’, ]
vfb=‘type=vnc,vncunused=1’]
3.3. Start the Virtual Machines on both hosts
virt-manager
3.4 Adjust Yast>Hostnames with ip that ifconfig gives you in local vm’s (static or dynamic)
Simple but requires to practice because wrong sequence with beginners make systems unbehaved…
I used cross-over cables (I didn’t have regular available) to connect router to hosts and it didn’t cause any issue:.
Enjoy.