KVM虚拟化的多个网卡桥接配置
2014-09-19 22:34
363 查看
桥接基本原理:eth0(本地物理网卡)<---br0(桥)--->tap0,tap1….(tap是给kvm guest使用的接口)1、创建桥
[shell]
#一般一个机器一个桥即可
sudo brctl addbr br0
[/shell]2、创建若干tap
[shell]
#KVM需要几个虚拟网卡,就几个
sudo tunctl -t tap0 -u liheyuan
sudo tunctl -t tap1 -u liheyuan
……
[/shell]3、把eth0,tapX绑定到br0上
[shell]
#eth0肯定要绑定 不然没法上网,tap若干个绑定
sudo brctl addif br0 eth0
sudo brctl addif br0 tap0
sudo brctl addif br0 tap1
……
[/shell]4、把br0设置成原来eth0的IP,eth0设置为混杂模式
[shell]
sudo ifconfig br0 192.168.1.33
sudo ifconfig eth0 0.0.0.0 promisc
[/shell]5、启动所有的tapX
[shell]
#br0是默认启动的,tapX不是
sudo ifconfig tap0 up
sudo ifconfig tap1 up
……
[/shell]6、修改默认网关
[shell]
#改默认网关,不然只能内网通信!
sudo route add -net 0.0.0.0 netmask 0.0.0.0 gw 192.168.1.1
[/shell]6、KVM启动
[shell]
#tap0 guest的eth0
-net nic,name=k1,macaddr=00:11:22:33:66:55
-net tap,vlan=0,name=k1,ifname=tap0,script=no,downscript=no
#tap1 guest的eth1
-net nic,name=k2,macaddr=00:11:22:33:66:56
-net tap,vlan=0,name=k2,ifname=tap1,script=no,downscript=no
[/shell]
[shell]
#一般一个机器一个桥即可
sudo brctl addbr br0
[/shell]2、创建若干tap
[shell]
#KVM需要几个虚拟网卡,就几个
sudo tunctl -t tap0 -u liheyuan
sudo tunctl -t tap1 -u liheyuan
……
[/shell]3、把eth0,tapX绑定到br0上
[shell]
#eth0肯定要绑定 不然没法上网,tap若干个绑定
sudo brctl addif br0 eth0
sudo brctl addif br0 tap0
sudo brctl addif br0 tap1
……
[/shell]4、把br0设置成原来eth0的IP,eth0设置为混杂模式
[shell]
sudo ifconfig br0 192.168.1.33
sudo ifconfig eth0 0.0.0.0 promisc
[/shell]5、启动所有的tapX
[shell]
#br0是默认启动的,tapX不是
sudo ifconfig tap0 up
sudo ifconfig tap1 up
……
[/shell]6、修改默认网关
[shell]
#改默认网关,不然只能内网通信!
sudo route add -net 0.0.0.0 netmask 0.0.0.0 gw 192.168.1.1
[/shell]6、KVM启动
[shell]
#tap0 guest的eth0
-net nic,name=k1,macaddr=00:11:22:33:66:55
-net tap,vlan=0,name=k1,ifname=tap0,script=no,downscript=no
#tap1 guest的eth1
-net nic,name=k2,macaddr=00:11:22:33:66:56
-net tap,vlan=0,name=k2,ifname=tap1,script=no,downscript=no
[/shell]
相关文章推荐
- Ubuntu12.04 配置KVM,使用网卡桥接模式。
- Ubuntu12.04 配置KVM,使用网卡桥接模式。
- KVM网卡桥接配置
- KVM下的桥接网卡配置
- KVM下虚拟机网卡桥接配置
- centos 6 KVM 网卡桥接配置
- RHEL5配置kvm网卡桥接
- kvm配置桥接网卡
- KVM精简教程(二):配置网卡桥接
- RHEL6.4 KVM虚拟化网卡桥接,PXE无人值守安装虚拟机
- RHEL6 KVM虚拟化创建桥接网卡-网桥
- kvm虚拟化学习笔记(十六)之kvm虚拟化存储池配置
- centos6.4_kvm 双网卡(adsl+局域网)配置
- (KVM连载) 5.1.4 使用virtio_net (半虚拟化网卡)
- linux系统KVM虚拟机桥接网卡及新增网卡配置
- kvm虚拟化学习笔记(九)之kvm虚拟机时间配置
- Ubuntu虚拟化KVM的配置:――“瑞友杯”虚拟化征文
- xen虚拟化实战系列(十)之xen虚拟机双网卡配置
- 【笔记】如何配置kvm桥接网络
- KVM 虚拟机在 IBM System x 上应用_图文详解桥接网络配置