|
参考的是这个帖子里面的方案2: http://www.linuxsir.cn/bbs/showthread.php?t=293771
-----------------------------------------------------------------------------
方案二 : Transparent Bridge (Layer 2)
在我的机器上测试下来的结果很遗憾, 无线网卡似乎不能配合Bridge工作. 建好Bridge之后, Guest只能访问Host, 连网关都访问不到. 所以我改用有线网卡来进行测试, 有线网卡为eth0, IP地址同ath0.
Host :
#chmod 0666 /dev/net/tun #设置访问权限
#tunctl -t tap0 -u leemars #建立一个tap设备, 名字为tap0, 所有者为leemars
#ifconfig eth0 0.0.0.0 promisc #使eth0进入promiscuous模式
#ifconfig tap0 0.0.0.0 promisc #使tap0进入promiscuous模式
#brctl addbr br0 #增加一个网桥
#brctl addif br0 eth0 #将eth0加入网桥
#ifconfig eth0 up #激活eth0
#dhclient br0 #为br0设置IP地址
#brctl addif br0 tap0 #将tap0加入网桥
#ifconfig tap0 up #激活tap0
Guest :
网卡设置为DHCP. 或者在设置为Host的Subnet中的一个IP地址, 如下例:
IP : 192.168.1.201
Netmask : 255.255.255.0
Gateway : 192.168.1.1
-----------------------------------------------------------------------------
现在的问题是,我的archlinux下没有/dev/net/tun这个文件,连/dev/net这个目录都没有。
运行“tunctl -t tap0 -u 用户名”这个命令时提示“Failed to open '/dev/net/tun' : No such file or directory”
请问有谁遇到过这个问题?如何解决?
多谢~~ |
|