I have a network bridge on my CentOS 7 box where eno1 is the slave of br0. The br0 gets its IP via DHCP. Now I called following commands to create the VM.
Code: Select all
genisoimage -output plex.iso -volid cidata -joliet -rock user-data meta-data
qemu-img create -f qcow2 -o backing_file=../qcows/CentOS-7-x86_64-GenericCloud.qcow2 plex.qcow2
virt-install --connect qemu:///system --import --name plex --ram 4096 --vcpus 2 --disk path=plex.qcow2 --disk path=plex.iso,device=cdrom --network bridge=br0,model=virtio --os-type=linux --os-variant=centos7.0 --noautoconsole --nographics
Code: Select all
[FAILED] Failed to start LSB: Bring up/down networking.
Code: Select all
[ *] A start job is running for LSB: Bri.../down networking (45s / 5min 5s)
Code: Select all
sudo systemctl status network
● network.service - LSB: Bring up/down networking
Loaded: loaded (/etc/rc.d/init.d/network; bad; vendor preset: disabled)
Active: failed (Result: timeout) since Fri 2020-01-17 18:52:11 UTC; 50s ago
Docs: man:systemd-sysv-generator(8)
Jan 17 18:51:19 plex dhclient[855]: DHCPDISCOVER on eth0 to 255.255.255.255...5)
Jan 17 18:51:33 plex dhclient[855]: DHCPDISCOVER on eth0 to 255.255.255.255...5)
Jan 17 18:51:51 plex dhclient[855]: DHCPDISCOVER on eth0 to 255.255.255.255...5)
Jan 17 18:52:02 plex dhclient[855]: DHCPDISCOVER on eth0 to 255.255.255.255...5)
Jan 17 18:52:11 plex systemd[1]: network.service start operation timed out....g.
Jan 17 18:52:11 plex systemd[1]: Failed to start LSB: Bring up/down networking.
Jan 17 18:52:11 plex systemd[1]: Unit network.service entered failed state.
Jan 17 18:52:11 plex systemd[1]: network.service failed.
Jan 17 18:52:12 plex dhclient[855]: No DHCPOFFERS received.
Jan 17 18:52:12 plex network[726]: Determining IP information for eth0... f...d.
Hint: Some lines were ellipsized, use -l to show in full.
Code: Select all
BOOTPROTO=dhcp
DEVICE=eth0
HWADDR=52:54:00:5d:f6:5d
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
List the state after CentOS installation on the host.
Code: Select all
nmcli con show --active
NAME UUID TYPE DEVICE
eno1 6eaf6ce4-fd7b-428a-8a4f-0390f13d3930 ethernet eno1
virbr0 5803036f-c5e9-4893-ad8c-b8f5cd42c0ed bridge virbr0
Code: Select all
nmcli con add ifname br0 type bridge con-name br0
nmcli con add type bridge-slave ifname eno1 master br0
Disable spanning tree.
Code: Select all
nmcli con modify br0 bridge.stp no
Code: Select all
nmcli con show
NAME UUID TYPE DEVICE
br0 c81fcfb4-9091-47f5-8c0b-503666401912 bridge br0
eno1 6eaf6ce4-fd7b-428a-8a4f-0390f13d3930 ethernet eno1
virbr0 5803036f-c5e9-4893-ad8c-b8f5cd42c0ed bridge virbr0
bridge-slave-eno1 310597e5-fa36-4fbb-a3aa-6c15b387af9a ethernet --
Code: Select all
nmcli con up br0
ncmli con down eno1
Code: Select all
ifconfig
br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.5 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::cd6:5b23:4367:fab9 prefixlen 64 scopeid 0x20<link>
ether 1c:69:7a:0a:98:2f txqueuelen 1000 (Ethernet)
RX packets 113 bytes 8477 (8.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 39 bytes 7002 (6.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 0.0.0.0
ether 02:42:8d:49:28:10 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 1c:69:7a:0a:98:2f txqueuelen 1000 (Ethernet)
RX packets 97697 bytes 134675728 (128.4 MiB)
RX errors 0 dropped 4 overruns 0 frame 0
TX packets 32598 bytes 2350477 (2.2 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 16 memory 0xc0b00000-c0b20000
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:82:15:ce txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Code: Select all
sudo systemctl restart NetworkManager
Code: Select all
cat > bridge.xml <<EOF
<network>
<name>host-bridge</name>
<forward mode="bridge"/>
<bridge name="br0"/>
</network>
EOF
virsh net-define bridge.xml
virsh net-start host-bridge
virsh net-autostart host-bridge