基于VLAN的ACL

在这里插入图片描述

禁止vlan10 访问 vlan30

#
acl number 3000
 rule 5 deny ip source 192.168.10.0 0.0.0.255 destination 192.168.30.0 0.0.0.255
 rule 10 permit ip
#
traffic-filter vlan 10 inbound acl 3000
#

在这里插入图片描述

禁止vlan10 访问 vlan20

acl number 3001
 rule 5 deny ip source 192.168.10.0 0.0.0.255 destination 192.168.20.0 0.0.0.255
 rule 10 permit ip
#
traffic classifier c1 operator and
 if-match acl 3001
#
traffic behavior b1
 permit
#
traffic policy p1
 classifier c1 behavior b1
#
vlan 10
 traffic-policy p1 inbound

在这里插入图片描述
此时 :traffic-filter vlan 10 inbound acl 3000 配置失效 vlan10 和vlan 30 可以相互访问

在这里插入图片描述

[LSW3]ping -a 192.168.10.4 192.168.30.2
Warning: The specified source address is not a local address, the ping command w
ill not check the network connection.
  PING 192.168.30.2: 56  data bytes, press CTRL_C to break
    Request time out
    Request time out
    Request time out
    Request time out
    Request time out

  --- 192.168.30.2 ping statistics ---
    5 packet(s) transmitted
    0 packet(s) received
    100.00% packet loss

[LSW3]ping -a 192.168.10.4 192.168.30.1
Warning: The specified source address is not a local address, the ping command w
ill not check the network connection.
  PING 192.168.30.1: 56  data bytes, press CTRL_C to break
    Request time out
    Request time out
    Request time out
    Request time out
    Request time out

  --- 192.168.30.1 ping statistics ---
    5 packet(s) transmitted
    0 packet(s) received
    100.00% packet loss

[LSW3]ping 192.168.30.1
  PING 192.168.30.1: 56  data bytes, press CTRL_C to break
    Reply from 192.168.30.1: bytes=56 Sequence=1 ttl=255 time=50 ms
    Reply from 192.168.30.1: bytes=56 Sequence=2 ttl=255 time=50 ms
    Reply from 192.168.30.1: bytes=56 Sequence=3 ttl=255 time=50 ms

  --- 192.168.30.1 ping statistics ---
    3 packet(s) transmitted
    3 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 50/50/50 ms

[LSW3]ping 192.168.30.2
  PING 192.168.30.2: 56  data bytes, press CTRL_C to break
    Reply from 192.168.30.2: bytes=56 Sequence=1 ttl=127 time=90 ms
    Reply from 192.168.30.2: bytes=56 Sequence=2 ttl=127 time=100 ms
    Reply from 192.168.30.2: bytes=56 Sequence=3 ttl=127 time=60 ms
    Reply from 192.168.30.2: bytes=56 Sequence=4 ttl=127 time=60 ms
    Reply from 192.168.30.2: bytes=56 Sequence=5 ttl=127 time=60 ms

  --- 192.168.30.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 60/74/100 ms

[LSW3]dis  ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 7        Routes : 7        

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        0.0.0.0/0   Static  60   0          RD   192.168.20.1    Vlanif20
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
   192.168.10.0/24  Direct  0    0           D   192.168.10.5    Vlanif10
   192.168.10.5/32  Direct  0    0           D   127.0.0.1       Vlanif10
   192.168.20.0/24  Direct  0    0           D   192.168.20.3    Vlanif20
   192.168.20.3/32  Direct  0    0           D   127.0.0.1       Vlanif20
  • 3
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

期待未来的男孩

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值