Virtual network on P4080DS. How to setup initial ip address, routing ... in guest of QEMU-KVM?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Virtual network on P4080DS. How to setup initial ip address, routing ... in guest of QEMU-KVM?

跳至解决方案
2,346 次查看
kanatalimzhanov
Contributor III

Hello Freescale team. I have run two Linux  guests with virtual eth0 in P4080DS following HOW-TOs in SDK 1.5 (parts KVM-QEMU). Everything works as expected, but i bored to setup network address, hostname, routing table again-and-again when launch guest linux. I was sure that script /root/qemu-ifup will run in guest side and write something looking:

root@p4080ds:/root# cat qemu-ifup_gest1 #!/bin/sh                                                                                                                                          

#/root/qemu-ifup_gest1                                                                                                                            

# TAP interface will be passed in $1                                                                                                                bridge=br0                                                                                                                                          guest_device=$1                                                                                                                                    

ifconfig $guest_device up                                                                                                                          

brctl addif $bridge $guest_device 

                                                                                                                 

#ifconfig eth0 192.168.32.33 up                                                                                                                     

#route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.32.32 metric 0 dev eth0

#hostname gest1

And find that qemu-ifup_gest1 runs on Host side, and commented out lines expected to setup initial network parameters on guest1.

And again my qwestion: How to setup initial ip address, routing ...  in guest of QEMU-KVM?

Here is info about networking bridge on Host side: br0 inet addr:192.168.32.32  Bcast:192.168.32.255  Mask:255.255.255.0

标记 (3)
0 项奖励
回复
1 解答
2,156 次查看
bpe
NXP Employee
NXP Employee

On the guest side, bridged network interfaces are bought up as ordinary network interfaces. If your guest brings up it's network with

network scripts, which is the SDK default, you should alter /etc/network/interfaces on the guest as required. See man 8 ifup and man 5 interfaces for details.

If your guest uses a virtual disk, you can edit this file directly. If the guest uses an initrd image as it is described in our SDK documentation, you should

alter the SDK package that provides /etc/interfaces and redeploy the guest rootfs image.

The SDK package that is responsible for populating /etc/interfaces in the target root filesystem is 'init-ifupdown'. For a quick solution, you can add your statements directly to

<SDK_INSTALL_PATH>/meta-fsl-networking/recipes-core/init-ifupdown/files/interfaces and rebuild.

Refer to Yocto documentation for more information on working with Yocto:

http://www.freescale.com/infocenter/topic/QORIQSDK/2888160.html


Have a great day,
Platon

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
回复
2 回复数
2,157 次查看
bpe
NXP Employee
NXP Employee

On the guest side, bridged network interfaces are bought up as ordinary network interfaces. If your guest brings up it's network with

network scripts, which is the SDK default, you should alter /etc/network/interfaces on the guest as required. See man 8 ifup and man 5 interfaces for details.

If your guest uses a virtual disk, you can edit this file directly. If the guest uses an initrd image as it is described in our SDK documentation, you should

alter the SDK package that provides /etc/interfaces and redeploy the guest rootfs image.

The SDK package that is responsible for populating /etc/interfaces in the target root filesystem is 'init-ifupdown'. For a quick solution, you can add your statements directly to

<SDK_INSTALL_PATH>/meta-fsl-networking/recipes-core/init-ifupdown/files/interfaces and rebuild.

Refer to Yocto documentation for more information on working with Yocto:

http://www.freescale.com/infocenter/topic/QORIQSDK/2888160.html


Have a great day,
Platon

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复
2,156 次查看
kanatalimzhanov
Contributor III

Thanks a lot.

I will try to supply VM-s with virtual disks.

0 项奖励
回复