Chinaunix首页 | 论坛 | 博客
  • 博客访问: 739646
  • 博文数量: 256
  • 博客积分: 3502
  • 博客等级: 中校
  • 技术积分: 3988
  • 用 户 组: 普通用户
  • 注册时间: 2012-04-17 21:13
文章分类

全部博文(256)

文章存档

2014年(11)

2013年(134)

2012年(111)

我的朋友

分类:

2012-11-15 13:23:02

一)、端口聚合channel-group

端口的聚合有两种方式,一种是手动的方式,一个是自动协商的方式。
(1)手动方式
   这种方式很简单,设置端口成员链路两端的模式为“on”。命令格式为:
   channel-group mode on
(2)自动方式
    自动方式有两种协议:PAgP(Port Aggregation Protocol)和LACP(Link aggregation Control Protocol)。

    PAgP:Cisco设备的端口聚合协议,有auto和desirable两种模式。

 
              auto模式在协商中只收不发,desirable模式的端口收发协商的数据包。
    LACP:标准的端口聚合协议802.3ad,有active和passive两种模式。
              active相当于PAgP的auto,而passive相当于PAgP的desirable。
1:在(config)#模式下,输入int port-channel ID(1-64)
2:假设要把F0/23和F0/24聚合,那么分别在起端口配置里面输入:
switchport trunk
encapsulation dot1q
switchport mode trunk(假设有多个)
duplex full
speed 100
no cdp enable
channel-group 1 mode on(这里的1就是开始创建的数字),
或者直接在需要做端口聚合的端口上执行下面命令
int port-ch 10
channel-g 10 mode ac
channel-g p lacp(panp)
然后只要在对端交换机也做同样配置就了.

 

Cat2950的配置:
Cat2950(config)#int port-channel 1
Cat2950(config)#int fa0/2
Cat2950(config-if)#channel-group 1 mode on
Cat2950(config)#int fa0/3
Cat2950(config-if)#channel-group 1 mode on
Cat2950(config)#int port-channel 1
Cat2950(config-if)#switchport mode trunk
Cat2950(config-if)#switchport trunk native vlan 10

cisco7200的配置:
Cisco7200(config)#int port-channel 1
Cisco7200(config)#int fa3/0
Cisco7200(config-if)#channel-group 1
Cisco7200(config)#int fa4/0
Cisco7200(config-if)#channel-group 1
Cisco7200(config)#int port-channel 1.10
Cisco7200(config-subif)#encapsulation dot1Q 10 native
Cisco7200(config-subif)#ip address 10.10.10.1 255.255.255.0
Cisco7200(config)#int port-channel 1.20
Cisco7200(config-subif)#encapsulation dot1Q 20
Cisco7200(config-subif)#ip address 10.10.11.1 255.255.255.0

三层接口的LACP配置:
Cat2950(config)#int port-channel 1
Cat2950(config-if)#no switchport
Cat2950(config-if)#ip add 10.1.1.1 255.255.255.0
Cat2950(config)#int fa0/2
Cat2950(config-if)#no switchport
Cat2950(config-if)#channel-protocol lacp
Cat2950(config-if)#channel-group 1 mode active
Cat2950(config-if)#no shut
Cat2950(config)#int fa0/3
Cat2950(config-if)#no switchport
Cat2950(config-if)#channel-group 1 mode active
Cat2950(config)#no shut

LACP负载的配置:
Cat2950(config)#port-channel load-balance src-dst-ip

二)、Pvlan

pVLAN通常用于企业内部网,用来防止连接到某些接 口或接口组的网络设备之间的相互通信,但却允许与默认网关进行通信。
尽管各设备处于不同的pVLAN中,它们可以使用相同的IP子网。

pVLAN 的3种port:
isolated,community ,promiscuous。

pVLAN 的3种子VLAN :
primary VLAN , isolated VLAN(second vlan), community VLAN(second vlan)。

pVLAN通 信范围:
primary VLAN:可以和所有他所关联的isolated VLAN,community VLAN通信.
community VLAN:可以同那些处于相同community VLAN内的community port通信,也可以与pVLAN中的promiscuous端口通信。 (每个pVLAN可以有多个community VLAN)
isolated VLAN:不可以和处于相同isolated VLAN内的其它isolated port通信,只可以与promisuous端口通信。 (每个pVLAN中只能有 一个isolated VLAN)

pVLAN限 制:
pVLAN要求使用VTPv1或VTPv2。
pVLAN必须工作于Transparent模式。
禁止将第 3层VLAN接口配置为辅助VLAN。
EtherChannel或SPAN目标端口不支持pVLAN。

配置命令:

//建 立primary VLAN
vlan 10 private-vlan primary

//建 立isolated VLAN
vlan 11 private-vlan isolated

//建 立community VLAN
vlan 12 private-vlan community

//关 联primary VLAN与Second VLANs
vlan 10 private-vlan association 11,12

//配 置promiscuous
interface G0/0
switchport
switchport mode private-vlan promiscuous
switchport private-vlan mapping 10 11,12
注:这里promiscuous port可以属于多个secondary VLAN,但只可以属于一个primary VLAN,就好像普通的access port只能属于一个vlan是一样的。

//配 置isolated port
interface G0/1
switchport
switchport mode private-vlan host
switchport private-vlan host-association 10 11

//配置community port
interface G0/2
switchport
switchport mode private-vlan host
switchport private-vlan host-association 10 12

注 意:

1>在private vlan里 switchport access vlan xxx 这一句已经不起作用了。
起作用的是 switchport private-vlan host-association 10 11这一句,这一句把端口放入primary vlan 10和secondary vlan 11。

2>在配置vlan的3层地址 的时候,只可以配置在primary VLAN上,从这里也可以看出,primary VLAN在某些地方是和普通vlan一样工作的,secondary VLAN则更特殊一些。

pVLAN使 用方案:

  1. 把需要2层隔离的主机放到同一个isolated VLAN,或者不同的community VLAN。
  2. 把需要2层通信的主机放到同一个community VLAN。
  3. 公 共的服务器或者上联端口放到primary VLAN,和本primaryVLAN和所有secondaryVLAN里的主机是2层连通的。
  4. 在primary VLAN上来看,所有的主机在同一个primary VLAN里,在secondary VLAN里的主机互相访问的时候,才和private VLAN的配置有关。
  5. 网 关可以是 primary VLAN上配一个3层地址或者在primary VLAN上连一个路由器。所有主机在3层都是在primary VLAN的这个网段里,所以还是可以通信的,只是2层隔离了,因为3层接口不转发广播,广播也就被隔离了,网上邻居之类基于广播的应用就互相看不到了.
  6. 上联的端口也可以是trunk,primary VLAN和secondary VLAN都可以trunk过去。
  7. vtp一 定要transparent,SPAN和vlan acl等等特性可能会有限制
阅读(6685) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~