qemu with tap0 in bridge receives no network traffic

Questions to IPFire Addons.
Post Reply
bschluff
Posts: 30
Joined: August 17th, 2010, 6:47 pm

qemu with tap0 in bridge receives no network traffic

Post by bschluff » March 18th, 2018, 4:58 pm

hello everybody,

since ownclud is no longer suported by IPFire i try to get a quemu vm working first in blue0 (witch has dhcp).
My whish is a working vm in orange with a fixed ip.

The configuration is (before bridged)

Code: Select all

# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default 
    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
2: green0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether e0:d5:5e:50:ff:57 brd ff:ff:ff:ff:ff:ff
    inet 192.168.101.1/24 brd 192.168.101.255 scope global green0
       valid_lft forever preferred_lft forever
3: red0: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether e0:d5:5e:50:ff:56 brd ff:ff:ff:ff:ff:ff
    inet 192.168.152.2/24 brd 192.168.152.255 scope global red0
       valid_lft forever preferred_lft forever
4: blue0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:08:54:57:da:2d brd ff:ff:ff:ff:ff:ff
    inet 192.168.100.1/24 brd 192.168.100.255 scope global blue0
       valid_lft forever preferred_lft forever
5: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 100
    link/none 
    inet 10.122.133.1 peer 10.122.133.2/32 scope global tun0
       valid_lft forever preferred_lft forever

# ip route show
default via 192.168.152.1 dev red0 
10.122.133.0/24 via 10.122.133.2 dev tun0 
10.122.133.2 dev tun0 proto kernel scope link src 10.122.133.1 
192.168.100.0/24 dev blue0 proto kernel scope link src 192.168.100.1 
192.168.101.0/24 dev green0 proto kernel scope link src 192.168.101.1 
192.168.152.0/24 dev red0 proto kernel scope link src 192.168.152.2 
192.168.152.1 dev red0 scope link 
The Trafic via real nic blue0 is working fine.

here the Bridging script:

Code: Select all

#!/bin/sh
set +x

case "${1}" in
    start)
	boot_mesg "Create Network Bridge blue for qemu..."
	tunctl -t tap0
	ethtool --offload tap0 gso off tso off
	ip addr add 192.168.100.3/24 brd + dev tap0
	ip link set dev blue0 down
	ip addr del 192.168.100.1/24 dev blue0
	ip link set blue0 name blue1
	brctl addbr blue0
	sleep 2
	ip addr add 192.168.100.1/24 brd + dev blue0
	
	brctl stp blue0 on
	brctl addif blue0 blue1
	brctl addif blue0 tap0

	ip link set tap0 up
	ip link set blue1 up
	ip link set blue0 up
	
	;;

    stop)
	boot_mesg "Remove Network Bridge blue for qemu..."
	ip link set blue0 down
	ip link set blue1 down
	ip link set tap0 down
	brctl delbr blue0
	ip link set blue1 name blue0
	ip addr add 192.168.100.1/24 brd + dev blue0
	ip link set blue0 up
	tunctl -d tap0
	;;
    *)
	echo "Usage: ${0} {start|stop}"
	exit 1
	;;
esac
The results of "ip a"

Code: Select all

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default 
    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
2: green0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether e0:d5:5e:50:ff:57 brd ff:ff:ff:ff:ff:ff
    inet 192.168.101.1/24 brd 192.168.101.255 scope global green0
       valid_lft forever preferred_lft forever
3: red0: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether e0:d5:5e:50:ff:56 brd ff:ff:ff:ff:ff:ff
    inet 192.168.152.2/24 brd 192.168.152.255 scope global red0
       valid_lft forever preferred_lft forever
4: blue1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master blue0 state UP group default qlen 1000
    link/ether 00:08:54:57:da:2d brd ff:ff:ff:ff:ff:ff
5: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 100
    link/none 
    inet 10.122.133.1 peer 10.122.133.2/32 scope global tun0
       valid_lft forever preferred_lft forever
10: tap0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel master blue0 state DOWN group default qlen 500
    link/ether 1e:fd:cb:67:eb:f4 brd ff:ff:ff:ff:ff:ff
    inet 192.168.100.3/24 brd 192.168.100.255 scope global tap0
       valid_lft forever preferred_lft forever
11: blue0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default 
    link/ether 00:08:54:57:da:2d brd ff:ff:ff:ff:ff:ff
    inet 192.168.100.1/24 brd 192.168.100.255 scope global blue0
       valid_lft forever preferred_lft forever
[root@bodoserver script]# 
all looks fine after starting the bridge and connecting notebook into the real nic. The trafic runs fine thru the bridge.

and here the qemu start params:

Code: Select all

qemu-system-x86_64 -enable-kvm -vnc :1 -hda /mnt/raid/script/testimage.img -m 1024 -netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device virtio-net-pci,netdev=net0,mac=00:16:35:AF:94:4B
The vm is accessible via vnc. The guest system is a pure debian with enabled dhcp.

On the IPFire i get this messages while dhcp requests:

Code: Select all

Mar 18 15:50:51 bodoserver dhcpd: DHCPOFFER on 192.168.100.32 to 00:16:35:af:94:4b (owncloud) via blue0
Mar 18 15:50:58 bodoserver dhcpd: DHCPDISCOVER from 00:16:35:af:94:4b (owncloud) via blue0
Mar 18 15:50:58 bodoserver dhcpd: DHCPOFFER on 192.168.100.32 to 00:16:35:af:94:4b (owncloud) via blue0
Mar 18 15:51:22 bodoserver dhcpd: DHCPDISCOVER from 00:16:35:af:94:4b (owncloud) via blue0
Mar 18 15:51:22 bodoserver dhcpd: DHCPOFFER on 192.168.100.32 to 00:16:35:af:94:4b (owncloud) via blue0
Mar 18 15:51:28 bodoserver dhcpd: DHCPDISCOVER from 00:16:35:af:94:4b (owncloud) via blue0
Mar 18 15:51:28 bodoserver dhcpd: DHCPOFFER on 192.168.100.32 to 00:16:35:af:94:4b (owncloud) via blue0
The Laptop connected to bridge generate this:

Code: Select all

Mar 18 13:42:53 bodoserver dhcpd: DHCPOFFER on 192.168.100.29 to 00:15:58:c5:7b:69 (bodolt2) via blue0
Mar 18 13:42:53 bodoserver dhcpd: DHCPREQUEST for 192.168.100.29 (192.168.100.1) from 00:15:58:c5:7b:69 (bodolt2) via blue0
Mar 18 13:42:53 bodoserver dhcpd: DHCPACK on 192.168.100.29 to 00:15:58:c5:7b:69 (bodolt2) via blue0
Mar 18 13:43:17 bodoserver dhcpd: DHCPREQUEST for 192.168.100.29 from 00:15:58:c5:7b:69 (bodolt2) via blue0
the brctl command gives this:

Code: Select all

 # brctl showstp blue0
blue0
 bridge id		8000.00085457da2d
 designated root	8000.00085457da2d
 root port		   0			path cost		   0
 max age		  19.99			bridge max age		  19.99
 hello time		   1.99			bridge hello time	   1.99
 forward delay		  14.99			bridge forward delay	  14.99
 ageing time		 299.99
 hello timer		   0.89			tcn timer		   0.00
 topology change timer	   0.00			gc timer		 235.18
 flags			


blue1 (1)
 port id		8001			state		     forwarding
 designated root	8000.00085457da2d	path cost		  19
 designated bridge	8000.00085457da2d	message age timer	   0.00
 designated port	8001			forward delay timer	   0.00
 designated cost	   0			hold timer		   0.00
 flags			

tap0 (2)
 port id		8002			state		     forwarding
 designated root	8000.00085457da2d	path cost		 100
 designated bridge	8000.00085457da2d	message age timer	   0.00
 designated port	8002			forward delay timer	   0.00
 designated cost	   0			hold timer		   0.00
 flags			

on the guest vm i got these message with dhclient -v ens3
No DHCOFFERS received.

i also tried working with fixed adress on guest. No ping, no name resolution etc

Does anybody has a idea?

Thanks in advance
Bodo

ps.: please apologize my realy bad english

derfossibaer
Posts: 225
Joined: December 3rd, 2013, 8:46 am

Re: qemu with tap0 in bridge receives no network traffic

Post by derfossibaer » March 28th, 2018, 1:47 pm

Its the same here.

No output in net traffic. IPFire works under Proxmox with "virtio" bridges.

VG - Fossi

bschluff
Posts: 30
Joined: August 17th, 2010, 6:47 pm

Re: qemu with tap0 in bridge receives no network traffic

Post by bschluff » March 30th, 2018, 9:58 am

hi Fossi,

with help from Pablo78 a sollution was found:

in file /var/ipfire/ethernet/setting must the nic set into bridge mode with

Code: Select all

ORANGE_MODE=bridge
Than you will get trafic :-)

cheers
Bodo

derfossibaer
Posts: 225
Joined: December 3rd, 2013, 8:46 am

Re: qemu with tap0 in bridge receives no network traffic

Post by derfossibaer » March 31st, 2018, 3:00 pm

Ididn't recogniced, that the IPFire is baremetal and VM-host.

Here the IPFire is the virtual machine, so I'm in the faulth threed here. Sorry for that. VG - Fossi

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest