标签:
转载:http://wiki.sylixos.com/index.php/Linux%E7%8E%AF%E5%A2%83%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97
环境介绍:
Win7 64 + Vmware 11 + ubuntu12.04 32
u-boot 版本:u-boot-2015-04
Linux kernel版本:linux-3.16.y
busybox版本:1_24_stable
交叉编译工具链:arm-linux-gnueabi-
sudo apt-get install uml-utilities
sudo apt-get install bridge-utils
ls -l /dev/net/tun
crw-rw-rwT 1 root root 10, 200 Apr 15 02:23 /dev/net/tun
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
#NetworkManager#iface eth0 inet dhcp
# 经过试验发现,由于我用的是虚拟机,添加了三块虚拟网卡eth0对应的是NAT连接方式,eth2对应的是桥接方式,如果
# 将虚拟机的VMnet8和VMnet1禁止掉的话,eth2就不能工作,此时下面如果是bridge_ports eth2的话,qemu就无法联网了
# 但是发现eth0让然可用,所以这里设置了bridge_ports eth0.
auto br0
iface br0 inet dhcp
bridge_ports eth0
#!/bin/sh
echo sudo tunctl -u $(id -un) -t $1
sudo tunctl -u $(id -un) -t $1
echo sudo ifconfig $1 0.0.0.0 promisc up
sudo ifconfig $1 0.0.0.0 promisc up
echo sudo brctl addif br0 $1
sudo brctl addif br0 $1
echo brctl show
brctl show
sudo ifconfig br0 192.168.11.20
#!/bin/sh
echo sudo brctl delif br0 $1
sudo brctl delif br0 $1
echo sudo tunctl -d $1
sudo tunctl -d $1
echo brctl show
brctl show
chmod +x /etc/qemu-ifup
chmod +x /etc/qemu-ifdown
运行测试:
./qemu-system-arm ...... -net nic,vlan=0 -net tap,vlan=0,ifname=tap0
warning: could not configure /dev/net/tun: no virtual network emulation
Could not initialize device ‘tap‘
/etc/qemu-ifup tap0
用Qemu模拟vexpress-a9 --- 配置 qemu 的网络功能
标签:
原文地址:http://www.cnblogs.com/pengdonglin137/p/5023340.html