华为高级acl访问控制列表的基本使用

本文我为大家介绍华为高级acl的基本使用。
实验要求:

1)允许Client1访问Server1的Web服务;
2)允许Client1访问网络192.168.2.0/24;
3)禁止Client1访问其它网络;
4)只运行R4远程访问路由器R3。

实验拓扑图如下:

华为高级acl访问控制列表的基本使用

首先我们Client1、Server1、PC1、R1、R2、R3、R4进行基本配置。

Client1配置如下:
华为高级acl访问控制列表的基本使用
Server1配置如下:
华为高级acl访问控制列表的基本使用
PC1配置如下:
华为高级acl访问控制列表的基本使用
R1配置如下:
[R1]interface g0/0/2
[R1-GigabitEthernet0/0/2]ip address 192.168.1.254 24
[R1-GigabitEthernet0/0/2]interface g0/0/0
[R1-GigabitEthernet0/0/2]ip address 192.168.1.254 24
[R1]ip route-static 0.0.0.0 0.0.0.0 192.168.12.2
R2配置如下:
[R2]interface g0/0/1
[R2-GigabitEthernet0/0/1]ip address 192.168.12.2 24
[R2-GigabitEthernet0/0/1]interface g0/0/2
[R2-GigabitEthernet0/0/2]ip address 192.168.2.254 24
[R2-GigabitEthernet0/0/2]interface g0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.23.1 24
[R2]ip route-static 192.168.1.0 255.255.255.0 192.168.12.1
[R2]ip route-static 192.168.3.0 255.255.255.0 192.168.23.2
R3配置如下:
[R3]interface g0/0/1
[R3-GigabitEthernet0/0/1]ip address 192.168.23.2 24
[R3]interface g0/0/2
[R3-GigabitEthernet0/0/2]ip address 192.168.3.254 24
[R3]ip route-static 0.0.0.0 0.0.0.0 192.168.23.1
R4配置如下:
[R4]interface g0/0/0
[R4-GigabitEthernet0/0/0]ip address 192.168.1.100 24
[R4]ip route-static 0.0.0.0 0.0.0.0 192.168.1.254

接下来,我们在R1配置华为高级ACL,

1)允许Client1访问Server1的Web服务;
2)允许Client1访问网络192.168.2.0/24;
3)禁止Client1访问其它网络。

在R1上配置:

[R1]acl 3000
[R1-acl-adv-3000]rule 10 permit tcp source 192.168.1.1 0 destination 192.168.3.1 0 destination-port eq 80
//允许Client1访问Server1的Web服务
[R1-acl-adv-3000]rule 20 permit ip source 192.168.1.1 0 destination 192.168.2.0 0.0.0.255
//允许Client1访问网络192.168.2.0/24
[R1-acl-adv-3000]rule 30 deny ip source 192.168.1.1 0 destination any
禁止Client1访问其它网络
在接口应用:
[R1]interface g0/0/2
[R1-GigabitEthernet0/0/2]traffic-filter inbound acl 3000

在R3上配置基本的ACL,仅允许R4远程访问:

[R3]acl 2000
[R3-acl-basic-2000]rule 10 permit source 192.168.1.100 0
//允许主机R4访问R3
[R3-acl-basic-2000]rule 20 deny source any
//拒绝其他所有访问
[R3]user-interface vty 0 4
[R3-ui-vty0-4]acl 2000 inbound
//在vty中调用acl2000
[R3-ui-vty0-4]user privilege level 15
[R3-ui-vty0-4]authentication-mode password
Please configure the login password (maximum length 16):123

最后,我们分别在Client1、R4上面测试

Client1和192.168.2.0/24网络的联通性,成功如下:
华为高级acl访问控制列表的基本使用

Client1访问Server1的Web服务,成功如下:
华为高级acl访问控制列表的基本使用

在R4上远程访问R3路由器,成功如下:
华为高级acl访问控制列表的基本使用

配置完成,实验配置成功!!!!

猜你喜欢

转载自blog.51cto.com/11806823/2316235
今日推荐