On 2011-04-15,at 11:10:25, Amos Kong wrote:

>发送日期:2011-04-15 11:10:25
>收件人:wuyu8242; autotest
>抄送:
>主题:Re: Re: [Autotest] About the mac addr and ip addr
>> 
>>>2011/4/13 wuyu8242 <[email protected]>:
>>>> hi Lucas, Amos,
>>>>
>>>> Disturbing you!There are some issues about network test. About the mac addr
>>>> and ip addr, the result of ifconfig include eth0 and eth1, the eth0 has no
>>>> ip address, the eth1 has a ip: 10.0.2.25, but the conf file of eth1 is not
>>>
>>>What's your qemu commandline ?   '10.0.2.25 always be assigned when we
>>>use userspace network(NAT mode).
>>>qemu-kvm -net user ....
>
>> my command line as following:
>> [33m 92 04/15 05:48:34 INFO |    kvm_vm:0987| Running qemu command:
>> /usr/bin/qemu-kvm -name 'vm1' -monitor 
>> unix:'/tmp/monitor-humanmonitor1-20110411-062101-hWQJ',server,nowait -serial 
>> unix:'/tmp/serial-20110411-062101-hWQJ',server,nowait -drive 
>> file='/tmp/kvm_autotest_root/images/f11-64.qcow2',index=0,if=ide,cache=none 
>> -net nic,vlan=0,model=rtl8139,macaddr='9a:a3:23:b0:e0:d0',id='idsLxMpu' -net 
>> user,vlan=0 -m 512 -smp 2 -redir tcp:5000::22 -vnc :0
>>
>> if the network is the NAT mode, why not connect other ip? and the 10.0.2.25 
>> is fixed.
>
>qemu-kvm has two network modes
>
>1. NAT mode
># qemu-kvm -net nic,... -net user,...
yes, I used this mode, and this mode is default mode in code,too, so this mode 
should be connected to other host ip, but failed.
>2. bridge mode
># qemu-kvm -net nic,.. -net tap,script=/etc/qemu-ifup
>
># cat /etc/qemu-ifup
>#!/bin/sh
>switch=switch
>/sbin/ifconfig $1 0.0.0.0 up
>/usr/sbin/brctl addif ${switch} $1
>/usr/sbin/brctl setfd ${switch} 0
>/usr/sbin/brctl stp ${switch} off
>
>switch is a bridge device in the host, you can reference the following 
>document.
>http://www.linux-kvm.org/page/KVM-Autotest/Client_Install#More_about_machine_setup_-_Bridges
>
>MORE detail for KVM network: http://www.linux-kvm.org/page/Networking
>
Okay, I will try it, thank you Amos :)

------------------                               
wuyu8242
2011-04-15
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to