设为首页收藏本站language 语言切换
查看: 1977|回复: 3
收起左侧

通过ACL来实现vlan间通讯控制

[复制链接]
发表于 2010-8-21 20:50:10 | 显示全部楼层 |阅读模式
1:创建一个vlan map
  Step 1 configure terminal
  Step 2 vlan access-map name [number]      创建一个VLAN地图,并起名字和定义一个号码
  Step 3 action {drop | forward} (Optional)   设置访问VLAN地图的行为,默认为转送
  Step 4 match {ip | mac} address {name |number} [name | number]
  用IP或者MAC匹配包来配对一个或多个标准或者扩展访问列表
  Step 5 end
  注:使用 no vlan access-map name 全局命令删除一个vlan map.
  例1:
  此例指出如何创建一个ACL和VLAN地图来禁止数据包。在第一个地图里面,所有的数据包匹配IP1 ACL(TCP数据包)的都会被丢弃。你先创建IP1ACL,只允许所有TCP数据包。因为VLAN地图中有一个IP数据包的匹配语句,它的默认行为是丢弃所有不符合条件的数据包。
Switch(config)# ip access-list extended ip1
Switch(config-ext-nacl)# permit tcp any any
Switch(config-ext-nacl)# exit
Switch(config)# vlan access-map map_1 10
Switch(config-access-map)# match ip address ip1
Switch(config-access-map)# action drop

  Example 2
  This example shows how to create a VLAN map to permit a packet. ACL ip2 permits UDP packets and any packets that match the ip2 ACL are forwarded.
Switch(config)# ip access-list extended ip2
Switch(config-ext-nacl)# permit udp any any
Switch(config-ext-nacl)# exit
Switch(config)# vlan access-map map_1 20
Switch(config-access-map)# match ip address ip2
Switch(config-access-map)# action forward

 Example 3
  In this example, the VLAN map has a default action of drop for MAC packets and a default action of forward for IP packets. Used with MAC extended access lists good-hosts and good-protocols, the map will have the following results:
  ? Forward MAC packets from hosts 0000.0c00.0111 and 0000.0c00.0211
  ? Forward MAC packets with decnet-iv or vines-ip protocols
  ? Drop all other non-IP packets
  ? Forward all IP packets
Switch(config)# mac access-list extended good-hosts
Switch(config-ext-macl)# permit host 000.0c00.0111 any
Switch(config-ext-macl)# permit host 000.0c00.0211 any
Switch(config-ext-nacl)# exit
Switch(config)# mac access-list extended good-protocols
Switch(config-ext-macl)# permit any any decnet-ip
Switch(config-ext-macl)# permit any any vines-ip
Switch(config-ext-nacl)# exit
Switch(config)# vlan access-map drop-mac-default 10
Switch(config-access-map)# match mac address good-hosts
Switch(config-access-map)# action forward
Switch(config-access-map)# exit
Switch(config)# vlan access-map drop-mac-default 20
Switch(config-access-map)# match mac address good-protocols
Switch(config-access-map)# action forward

  2:将vlan map 指定到一个vlan 上
  Step 1 configure terminal
  Step 2 vlan filter mapname vlan-list list Apply the VLAN map to one or more VLAN IDs.
  The list can be a single VLAN ID (22), a consecutive list (10-22), or a string of VLAN IDs (12, 22, 30)。 Spaces around the comma and hyphen are optional.
  To remove the VLAN map, use the no vlan filter mapname vlan-list list global configuration command.
  Example 1
  If you do not want HTTP traffic switched from Host X to Host Y, you can configure a VLAN map on
  Switch A to drop all HTTP traffic from Host X (IP address 10.1.1.32) to Host Y (IP address 10.1.1.34)at Switch A and not bridge it to Switch B.
1、define the IP access list http that permits (matches) any TCP traffic on the HTTP port.
Switch(config)# ip access-list extended http
Switch(config-ext-nacl)# permit tcp host 10.1.1.32 host 10.1.1.34 eq www
Switch(config-ext-nacl)# exit
2、create VLAN access map map2 so that traffic that matches the http access list is dropped and all other IP traffic is forwarded.
Switch(config)# vlan access-map map2 10
Switch(config-access-map)# match ip address http
Switch(config-access-map)# a
发表于 2013-1-29 14:27:07 | 显示全部楼层
谢谢
沙发 2013-1-29 14:27:07 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2013-4-20 10:00:30 | 显示全部楼层
板凳 2013-4-20 10:00:30 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2013-4-26 08:50:18 | 显示全部楼层
地板 2013-4-26 08:50:18 回复 收起回复
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 论坛注册

本版积分规则

QQ|Archiver|手机版|小黑屋|sitemap|鸿鹄论坛 ( 京ICP备14027439号 )  

GMT+8, 2025-2-3 12:47 , Processed in 0.058333 second(s), 12 queries , Redis On.  

  Powered by Discuz!

  © 2001-2025 HH010.COM

快速回复 返回顶部 返回列表