在cisco交换机上实现隔离访问
--------------------------------------------------------------------------------

现在网络安全要求也越来越高了,一个局域网有时候也希望能够做到互相不能访问。我主要是给大家介绍一下在cisco的交换机上面如何来实现大家的需求。

  在cisco 低端交换机中的实现方法:
  1.通过端口保护(switchitchport protected)来实现的。
  2.通过pvlan(private vlan 私有vlan)来实现.
  主要操作如下:
  相对来说cisco 3550或者2950交换机配置相对简单,进入网络接口配置模式:
  switch(c range f0/1 - 24 #同时操作f0/1到f0/24口可根据自己的需求来选择端口
  switch(c protected #开启端口保护
  ok...到此为止,在交换机的每个接口启用端口保护,目的达到.
  
由于4500系列交换机不支持端口保护,可以通过pvlan方式实现。
  主要操作如下:
  首先建立sec vlan 2个
  switch(c 101
  switch(c community
  ###建立vlan101 并指定此vlan为公共vlan
  switch(c 102
  switch(c isolated
  ###建立vlan102 并指定此vlan为隔离vlan
  switch(c 200
  switch(c primary
  switch(c association 101
  switch(c association add 102
  ###建立vlan200 并指定此vlan为主vlan,同时制定vlan101以及102为vlan200的sec vlan
  switch(c vlan 200
  switch(c mapping 101,102
  ###进入vlan200 配置ip地址后,使sec vlan101与102之间路由,使其可以通信
  switch(c f3/1
  switch(c private-vlan host-association 200 102
  switch(c private-vlan mapping 200 102
  switch(c mode private-vlan host
  ###进入接口模式,配置接口为pvlan的host模式,配置pvlan的主vlan以及sec vlan,一定用102,102是隔离vlan
  至此,配置结束,经过实验检测,各个端口之间不能通信,但都可以与自己的网关通信。
  
注:cisco网站上的配置实例好像不能按照此方式使用,只是启用隔离而不能与本vlan的网关通信。按照cisco网站上的配置,private vlan不能up。如果有多个vlan要进行pvlan配置,sec vlan必须要相应的增加,一个vlan只能在private vlan下作为 sec vlan。