码迷,mamicode.com
首页 > 其他好文 > 详细

KVM网桥 多vLan 配置

时间:2016-08-12 21:35:36      阅读:453      评论:0      收藏:0      [点我收藏+]

标签:

示例:
物理节点IP:10.161.240.0/24                        (vlan4440)
虚机     IP:10.161.241.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.161.240.41"
NETMASK="255.255.255.0"
GATEWAY="10.161.240.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.161.240.0/24  vlan4440)
 
“switchport mode trunk” 代表服务端过来的打了标签的vlan,全部放行;针对KVM打了标签的虚机数据包(10.161.241.0/24  vlan4439)
 

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

KVM网桥 多vLan 配置

标签:

原文地址:http://www.cnblogs.com/tonychiu/p/5766530.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!