华为ACL实验配置

ACL: Access Control List,访问控制列表

主要作用:控制网络访问行为,结合其他技术匹配网络流量的范围。

  • 实验1: ACL快速配置
复制代码
拒绝PC1 访问PC3
acl  3000  创建ACL 3000
 rule deny ip source 1.1.1.1 0 destination 3.3.3.3 0 
创建规则拒绝源IP为1.1.1.1目标IP为3.3.3.3的报文

interface GigabitEthernet0/0/0
 traffic-filter inbound acl 3000
在Gi0/0/0接口的入方向调用ACL 3000
  • 实验2:200人园区网案例

需求:

1 PC1、PC3 自动获取ip地址。

2 配置静态路由使得全网互通。

3 R2上面启用Telnet服务,方便远程管理。

用户名:aa 密码:Huawei@123

4 拒绝财务部和市场部用户互访。

5 在R2上配置ACL仅允许PC5 远程telnet控制。

6 在R2上配置ACL拒绝PC2 访问Server1 的HTTP服务,但可以ping通。

7 在R1上配置ACL拒绝PC4 ping Server1 但可以访问其HTTP服务。

拓扑描述:

1 R1 作为所有PC的网关。

2 财务部用户:192.168.1.0/24

市场部用户:192.168.2.0/24

server1:HTTP 服务器地址为7.7.7.7/24

PC2:192.168.1.2

PC4:192.168.2.2

PC5:(由路由器模拟)192.168.1.3

注意事项:模拟器中路由器Router 配置ACL不生效,需采用AR2220配置。

步骤:

1 配置接口地址

2 配置静态路由和DHCP

复制代码
R1:
DHCP:
dhcp enable 

interface GigabitEthernet0/0/0
 ip address 192.168.1.254 255.255.255.0 
 dhcp select interface
#
interface GigabitEthernet0/0/1
 ip address 192.168.2.254 255.255.255.0 
 dhcp select interface

R1:
ip route-static 0.0.0.0 0 12.1.1.2
R2:
ip route-static 192.168.1.0 255.255.255.0 12.1.1.1
ip route-static 192.168.2.0 255.255.255.0 12.1.1.1

3 R2上启用Telnet服务

复制代码
R2:
aaa
  local-user aa privilege level 2 password cipher Huawei@123
  local-user aa service-type telnet

user-interface vty 0 4
 authentication-mode aaa

4 拒绝财务部和市场部互访

复制代码
R1:
acl number 3005  
 rule 5 deny ip source 192.168.1.0 0.0.0.255 destination 192.168.2.0 0.0.0.255 

acl number 3006  
 rule 5 deny ip source 192.168.2.0 0.0.0.255 destination 192.168.1.0 0.0.0.255 

interface GigabitEthernet0/0/0
 traffic-filter inbound acl 3005
 #
interface GigabitEthernet0/0/1
  traffic-filter inbound acl 3006

5 R2上配置ACL仅允许PC5 远程telnet控制

复制代码
R2:
acl number 3010  
 rule 5 permit ip source 192.168.1.3 0 
 rule 10 deny ip (选配)

user-interface vty 0 4
 acl 3010 inbound

注意:acl 调用在vty 接口下,用来匹配范围,默认拒绝所有。

6 在R2上配置ACL拒绝PC2访问Server1 的HTTP服务,但可以ping通

复制代码
acl number 3011  
 rule 5 deny tcp source 192.168.1.2 0 destination 7.7.7.7 0 destination-port eq www

int gi 0/0/1
   traffic-filter outbound acl 3010

7 在R1上配置ACL拒绝PC4 ping Server1 但可以访问其HTTP服务。

复制代码
acl number 3006  
  rule 10 deny icmp source 192.168.2.2 0 destination 7.7.7.7 0 

调试命令:dis acl all

相关推荐
你我约定有三6 分钟前
云服务器--阿里云OSS(2)【Springboot使用阿里云OSS】
服务器·spring boot·阿里云
苹果醋31 小时前
React Native jpush-react-native极光推送 iOS生产环境接收不到推送
java·运维·spring boot·mysql·nginx
xsc-xyc3 小时前
虚拟机Ubuntu重启发现找不到共享文件夹
服务器·ubuntu
skywalk81633 小时前
Ubuntu24.04启动后显示:推荐安装输入法面板这个Gnome Shell,否则可能无法看到输入法窗口 extension/261/kimpanel
linux·运维·服务器
网硕互联的小客服3 小时前
CentOS8 Stream 网卡配置及重启
linux·运维·服务器
DXY7984 小时前
Ext系列文件系统
运维·linix
ALLSectorSorft4 小时前
定制客车系统票务管理系统功能设计
linux·服务器·前端·数据库·apache
cyber_两只龙宝5 小时前
综合项目记录:自动化备份全网服务器数据平台
linux·运维·服务器·自动化·web