ACL访问控制列表

要求:

  • 允许10.1/24访问30.1/24的http服务,但是禁止访问30.2
  • 禁止10.2/24ping 两台服务器。可以访问其他服务。
  • 20.1可以访问30.1,不能访问30.2。工作日8;00到18:00禁止访问30.3

1、实验拓扑

2、配置

1)PC和服务器IP地址配置

2)VLAN配置

单臂路由四步:

        创建子接口。

        封装dot1q协议,对应vlan。

        配置IP。

        开启ARP协议。

LSW1:

vlan batch 10 20
#
interface Ethernet0/0/1
 port link-type access
 port default vlan 10
#
interface Ethernet0/0/2
 port link-type access
 port default vlan 10
#
interface Ethernet0/0/3
 port link-type access
 port default vlan 20
#
interface Ethernet0/0/22
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#

AR1:

#
interface GigabitEthernet0/0/1.10
 dot1q termination vid 10
 ip address 192.168.10.254 255.255.255.0 
 arp broadcast enable
#
interface GigabitEthernet0/0/1.20
 dot1q termination vid 20
 ip address 192.168.20.254 255.255.255.0 
 arp broadcast enable
#

3)链路聚合配置

        步骤:创建聚合组。

                  undo portswitch 取消二层口限制

                  添加端口。trunkport

                  聚合口配IP地址。(路由器需配)

AR1:

#
interface Eth-Trunk1
 undo portswitch
 trunkport g0/0/0
 trunkport g0/0/2
 ip address 10.1.1.1 255.255.255.252 
 traffic-filter outbound acl 3000
 mode lacp-static
#

AR2:

#
interface GigabitEthernet0/0/1
 ip address 192.168.30.254 255.255.255.0 
#
interface Eth-Trunk1
 undo portswitch
 ip address 10.1.1.2 255.255.255.252 
 mode lacp-static
#

3)ACL策略

要求:必须按顺序配置。

1、允许10.1/24访问30.1/24的http服务,但是禁止访问30.2
 2、禁止10.2/24ping 两台服务器。可以访问其他服务。
3、20.1可以访问30.1,不能访问30.2。工作日8;00到18:00禁止访问30.3

 配置时间:

 time-range AAA 08:00 to 18:00 working-day 

ACL配置:

#
acl number 3000  
 rule 5 permit tcp source 192.168.10.1 0 destination 192.168.30.1 0 destination-
port eq www 
 rule 10 deny ip source 192.168.10.1 0 destination 192.168.30.2 0 
 rule 15 deny icmp source 192.168.10.2 0 destination 192.168.30.1 0 icmp-type ec
ho 
 rule 20 deny icmp source 192.168.10.2 0 destination 192.168.30.2 0 icmp-type ec
ho 
 rule 25 permit ip source 192.168.20.1 0 destination 192.168.30.1 0 
 rule 30 deny ip source 192.168.20.1 0 destination 192.168.30.2 0 
 rule 35 deny ip source 192.168.20.1 0 destination 192.168.30.3 0 time-range AAA
 
#

4)静态路由

AR1:

ip route-static 192.168.30.0 255.255.255.0 10.1.1.2

AR2:

ip route-static 192.168.0.0 255.255.0.0 10.1.1.1

3、测试

1)允许10.1/24访问30.1/24的http服务,但是禁止访问30.2。

启动Server的http服务,以Server1为例。

验证:

2)禁止10.2/24ping 两台服务器。可以访问其他服务。

可以看到都ping不通,但我们测试一下http服务。

可以看到允许http等其他服务。

3)20.1可以访问30.1,不能访问30.2。工作日8;00到18:00禁止访问30.3

目前是周四的12:19,在时间范围内,不能访问192.168.30.2。

  • 8
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值