I use tap mode for the guest network in qemu .
here is /etc/sysconfig/network-scripts/ifcfg-br0
2 DEVICE=br0 3 TYPE=Bridge 4 BOOTPROTO=static 5 ONBOOT=yes 6 DNS1=192.168.1.1 7 GATEWAY=10.16.255.254 8 IPADDR=10.16.172.77 9 NETMASK=255.255.0.0 10 ONBOOT=yes 11 DELAY=0 12 STP=off (line number)
/etc/sysconfig/network-scripts/ifcfg-em1
1 DEVICE="em1" 2 ONBOOT=yes 3 HWADDR= 4 NM_CONTROLLED="no" 5 TYPE=Ethernet 6 PREFIX=24 7 DEFROUTE=yes 8 IPV4_FAILURE_FATAL=yes 9 IPV6INIT=no 10 NAME="System em1" 11 UUID=1dad842d-1912-ef5a-a43a-bc238fb267e7 12 BRIDGE=br0
use a sh script to biuld tap
3 tunctl -t tap0 -u root 4 brctl addif br0 tap0 5 ifconfig tap0 up 6 ifconfig tap0 0.0.0.0 promisc up
qemu use like -net nic -net tap
Make guest os
ip 10.16.172.18 netmask:255.255.0.0 gateway:10.16.255.254 dns: 192.168.1.1
Here is i got problem . guest ping www.google.com is ok but host os ping 10.16.172.78 get error:
PING 10.1.172.78 (10.1.172.78) 56(84) bytes of data.
From 10.1.1.9 icmp_seq=1 Time to live exceeded From 10.1.1.9 icmp_seq=2 Time to live exceeded From 10.1.1.9 icmp_seq=3 Time to live exceeded From 10.1.1.9 icmp_seq=4 Time to live exceeded
First I got the ip from company ,which mean i can have the network 10.16.172.0 using br0 as bridge .The guest os can have a ip 10.16.172.78 (manly set) The error show , 10.1.1.9 was a router which don't know the ip 10.16.172.78 ? I can't ping the guest os , but that's why i use tap mode in qemu .Because qemu stack mode also can connect to outside. but wasn't seen in host os .
I think don't need ask system manager to set it . Am i right ? How can i make host ping the guest rightly ?