qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-discuss] About how to connect from guest "10.0.2.15" to remote


From: Mike Lovell
Subject: Re: [Qemu-discuss] About how to connect from guest "10.0.2.15" to remote "192.168.1.xx"
Date: Tue, 14 Feb 2012 10:38:30 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Lightning/1.0b2 Thunderbird/3.1.16

what does `brctl show` list as the current bridge configuration? there
should be eth0 and tap0 attached to br0. if not, you should add them.

mike

On 02/14/2012 06:32 AM, qzhan15 wrote:
> Thanks for you advice
>
> I followed the instructions
>
> I found my host can't ping to any remote server now
> and my guest also can't ping to the host ( i just config the eth0 to
> 192.168.1.200)
>
> the command i use start qemu changed to
> qemu-system-x86_64 -kernel arch/x86/boot/bzImage -boot d -append
> 'console=ttyS0, 115200' -nographic -net nic,macaddr=00:00:00:00:00:00
> -net tap,ifname=tap0,script=no,downscript=no
>
> below is ifconfig and route table dump on my host
> address@hidden:~$ ifconfig
> br0 Link encap:Ethernet HWaddr 02:32:6d:ca:db:a5
> inet addr:192.168.1.155 Bcast:192.168.1.255 Mask:255.255.255.0
> inet6 addr: fe80::40ec:69ff:fee8:3d00/64 Scope:Link
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> RX packets:104 errors:0 dropped:0 overruns:0 frame:0
> TX packets:263 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:0
> RX bytes:9992 (9.9 KB) TX bytes:30390 (30.3 KB)
>
> eth0 Link encap:Ethernet HWaddr 08:00:27:ed:c9:b3
> inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
> inet6 addr: fe80::a00:27ff:feed:c9b3/64 Scope:Link
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> RX packets:56919 errors:0 dropped:0 overruns:0 frame:0
> TX packets:42953 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:1000
> RX bytes:81679486 (81.6 MB) TX bytes:3243769 (3.2 MB)
>
> lo Link encap:Local Loopback
> inet addr:127.0.0.1 Mask:255.0.0.0
> inet6 addr: ::1/128 Scope:Host
> UP LOOPBACK RUNNING MTU:16436 Metric:1
> RX packets:98 errors:0 dropped:0 overruns:0 frame:0
> TX packets:98 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:0
> RX bytes:10026 (10.0 KB) TX bytes:10026 (10.0 KB)
>
> tap0 Link encap:Ethernet HWaddr 02:32:6d:ca:db:a5
> inet6 addr: fe80::32:6dff:feca:dba5/64 Scope:Link
> UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
> RX packets:29 errors:0 dropped:0 overruns:0 frame:0
> TX packets:204 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 address@hidden:~$ route -n
>
>
> Kernel IP routing table
> Destination Gateway Genmask Flags Metric Ref Use Iface
> 0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
> 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
> 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 br0:500
> RX bytes:1882 (1.8 KB) TX bytes:29466 (29.4 KB)
> 在 2012-2-14,下午6:04, mathslinux 写道:
>
>> You can add a bridge in you host os, and add your host's net
>> interface and
>> guest's net device to this bridge.
>>
>> Codes you should use:
>> brctl addbr br0 # Create a bridge named br0.
>>
>> ifconfig br0 192.168.1.155 netmask 255.255.255.0 up # Activate br0,
>> and set it's ipaddress.(Change with your real ipaddress)
>>
>> tunctl -b -u root -t tap0 # Create a new tap device named tap0 for root.
>>
>> brctl addif br0 tap0 # Make the tap0 a port of br0.
>>
>> ifconfig tap0 up 0.0.0.0 promisc # set the tap0
>>
>> # below make your real interface a port of br0.
>> brctl addif br0 eth0 # Change eth0 with your real interface name.
>> ifconfig eth0 0.0.0.0
>> ifconfig eth0 up
>>
>> # Then start qemu:
>> qemu-kvm -net nic,macaddr=00:00:00:00:00:00 -net
>> tap,ifname=tap0,script=no,downscript=no
>> /var/lib/libvirt/images/XP.img -m 1024
>>
>>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]