KVM网桥 多vLan 配置

示例:
物理节点IP:10.12.40.0/24                        (vlan4440)
虚机     IP:10.16.41.0/24                         (vlan4439)

1、     物理网桥
# vim /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE="eth0"
BOOTPROTO="none"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="Ethernet"
MASTER="bond0"
SLAVE="yes"
USERCTL="no"

 
# vim /etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE="eth1
BOOTPROTO="none"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="Ethernet"
MASTER="bond0"
SLAVE="yes"
USERCTL="no"

  
# vim /etc/sysconfig/network-scripts/ifcfg-bond0

DEVICE="bond0"
BOOTPROTO="none"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="Ethernet"
USERCTL="no"
BRIDGE="iccsbr0"
BONDING_OPTS="miimon=100 mode=4"


# vim /etc/sysconfig/network-scripts/ifcfg-iccsbr0

DEVICE="iccsbr0"
BOOTPROTO="none"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="Bridge"
USERCTL="no"
IPADDR="10.16.40.41"
NETMASK="255.255.255.0"
GATEWAY="10.16.40.254"


2、     虚机vlan网桥
# vim /etc/sysconfig/network-scripts/ifcfg-bond0.4439

DEVICE=bond0.4439
PHYSDEV=bond0
ONBOOT=yes
BOOTPROTO=none
VLAN=yes
BRIDGE=iccsbr4439


# vim /etc/sysconfig/network-scripts/ifcfg-iccsbr4439

DEVICE=iccsbr4439
TYPE=Bridge
#STP=on
ONBOOT=yes
BOOTPROTO=none



上联cisco2960配置

 
...............

interface Port-channel1
switchport trunk native vlan 4440
switchport mode trunk
!
........

!
interface GigabitEthernet0/7
switchport trunk native vlan 4440
switchport mode trunk
channel-group 1 mode active
!        
interface GigabitEthernet0/8
switchport trunk native vlan 4440
switchport mode trunk
channel-group 1 mode active

端口7和8分别连接服务器的两个网卡,其中
“switchport trunk native vlan 4440” 代表服务端过来的数据包,如果没打vlan id,则标示为vlan 4440;针对KVM服务器管理IP(10.16.40.0/24  vlan4440)
 
“switchport mode trunk” 代表服务端过来的打了标签的vlan,全部放行;针对KVM打了标签的虚机数据包(10.16.41.0/24  vlan4439)
 

3、     当虚机需走vlan4439时,在网络接入选择iccsbr4439即可
4、     当有其他vlan需求时,同上类似配置

转载于:https://www.cnblogs.com/tonychiu/articles/5766530.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值