30
2020
12

vlan中ACL inbound与outbound详解



推荐点击下面图片,通过本站淘宝优惠价购买:

image.png

关键字:华为ACL配置、Cisco ACL配置、Vlan ACL配置

ACL一般有两种应用场景:应用到交换机物理端口和应用到Vlan。

场景一:应用到交换机物理端口上的ACL

网络拓扑:PC连接在交换机Gig0/0/1端口

实现目的:在PC上不能访问某IP的80和443端口

解析:

站在PC侧(站在哪里看很重要)看交换机,PC的数据包是要进入交换机端口,那么ACL就应用到交换机物理端口Gig0/0/1的inbound方向上。

  1. PC访问百度的443,即数据包的destination-port 443 。

  2. ACL配置如下:

acl name test
 rule 5 deny tcp destination-port eq 443
 rule 10 deny tcp destination-port eq www
interface GigabitEthernet0/0/1
 traffic-filter inbound acl name test

场景二:应用到vlan上的ACL

实现目的:在某vlan的in方向上,只允许此vlan与主机10.10.10.89通讯。

解析:

把vlan的网关看作交换机的大门。

交换机内部,报文在Vlan间是由交换机L3转发引擎转发,不受ACL控制。所以对于vlanA访问vlanB,ACL只能应用于vlanA的in方向。

vlan acl方向

ACL配置如下,应用于Vlan182的inbound方向:

Permit ip destination 10.10.10.89 0
Deny ip destination 10.0.0.0 0.255.255.255
Deny ip destination 172.16.0.0 0.25.255.255Deny ip destination 192.168.0.0 0.0.255.255Permit ip destination any

另一种写法,是应用到vlan的out方向

这里控制的是已经进入交换机的流量。正常通信的建立需要对方回包,相当于小偷已经进到客厅了,但不让它从后门出去。

使用标准acl即可,内容如下:

Permit source 10.10.10.89 0
Deny source 10.0.0.0 0.255.255.255
Deny source172.16.0.0 0.25.255.255
Deny source 192.168.0.0 0.0.255.255
Permit any



本文链接:http://www.hqyman.cn/post/1591.html 非本站原创文章欢迎转载,原创文章需保留本站地址!

分享到:





休息一下,本站随机推荐观看栏目:


« 上一篇 下一篇 »

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

您的IP地址是: