华为HCIA第六节-----acl和nat

实验中,配置了一台华为设备(GW)作为网关,设置了多个接口的IP地址,并创建了ACL规则阻止特定流量。同时,配置了静态路由。另一台华为设备(ISP)也进行了IP地址配置和静态路由设置,用于连接外部网络。
摘要由CSDN通过智能技术生成

1.实验拓扑:

2.实验要求:

 

 

 

 3.实验代码:

1.GW:

The device is running!

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys GW
[GW]int g0/0/1
[GW-GigabitEthernet0/0/1]ip ad	
[GW-GigabitEthernet0/0/1]ip address 192.168.1.254 24
Mar 30 2023 16:21:59-08:00 GW %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[GW-GigabitEthernet0/0/1]int g0/0/2
[GW-GigabitEthernet0/0/2]ip ad	
[GW-GigabitEthernet0/0/2]ip address 192.168.2.254 24
Mar 30 2023 16:22:13-08:00 GW %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/2 has entered the UP state. 
[GW-GigabitEthernet0/0/2]int g0/0/0
[GW-GigabitEthernet0/0/0]ip ad	
[GW-GigabitEthernet0/0/0]ip address 12.1.1.1 30
Mar 30 2023 16:22:31-08:00 GW %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[GW-GigabitEthernet0/0/0]acl	
[GW-GigabitEthernet0/0/0]aclq
                         ^
Error: Unrecognized command found at '^' position.
[GW-GigabitEthernet0/0/0]q
[GW]ac	
[GW]access-user
[GW]acl 3000
[GW-acl-adv-3000]rou	
[GW-acl-adv-3000]r	
[GW-acl-adv-3000]u	
[GW-acl-adv-3000]ru	
[GW-acl-adv-3000]rule 5 de	
[GW-acl-adv-3000]rule 5 deny ip	
[GW-acl-adv-3000]rule 5 deny ip sou	
[GW-acl-adv-3000]rule 5 deny ip source 192.168.1.1 0 de	
[GW-acl-adv-3000]rule 5 deny ip source 192.168.1.1 0 destination 192.168.2.1 0
[GW-acl-adv-3000]int g0/0/1
[GW-GigabitEthernet0/0/1]tr	
[GW-GigabitEthernet0/0/1]tracert
[GW-GigabitEthernet0/0/1]traffic-filter in	
[GW-GigabitEthernet0/0/1]traffic-filter inbound aacl	
[GW-GigabitEthernet0/0/1]traffic-filter inbound acl	
[GW-GigabitEthernet0/0/1]traffic-filter inbound acl 3000
[GW-GigabitEthernet0/0/1]q
[GW]acl	
[GW]acl 2000
[GW-acl-basic-2000]ru	
[GW-acl-basic-2000]rule 5 pe	
[GW-acl-basic-2000]rule 5 permit sou	
[GW-acl-basic-2000]rule 5 permit source 192.168.1.0 0.0.0.255
[GW-acl-basic-2000]int g0/0/0
[GW-GigabitEthernet0/0/0]ip	
[GW-GigabitEthernet0/0/0]ip ad	
[GW-GigabitEthernet0/0/0]ip address 12.1.1.1 30
Error: The address already exists.
[GW-GigabitEthernet0/0/0]ip address 12.1.1.1 30
Error: The address already exists.
[GW-GigabitEthernet0/0/0]

  Please check whether system data has been changed, and save data in time

  Configuration console time out, please press any key to log on

<GW>
<GW>sys
Enter system view, return user view with Ctrl+Z.
[GW]cal	
[GW]acl	
[GW]acl 2000
[GW-acl-basic-2000]q
[GW]int g0/0/0
[GW-GigabitEthernet0/0/0]ip ad	
[GW-GigabitEthernet0/0/0]ip address 12.1.1.1 30
Error: The address already exists.
[GW-GigabitEthernet0/0/0]ip address 12.1.1.1 24
[GW-GigabitEthernet0/0/0]na	
[GW-GigabitEthernet0/0/0]nat ou	
[GW-GigabitEthernet0/0/0]nat outbound 2000
[GW-GigabitEthernet0/0/0]na	
[GW-GigabitEthernet0/0/0]nat st	
[GW-GigabitEthernet0/0/0]nat static gl	
[GW-GigabitEthernet0/0/0]nat static global 100.1.1.1 in	
[GW-GigabitEthernet0/0/0]nat static global 100.1.1.1 inside 192.168.2.1
[GW-GigabitEthernet0/0/0]ip rou	
[GW-GigabitEthernet0/0/0]ip route	
[GW-GigabitEthernet0/0/0]q
[GW]ip	
[GW]ip rou	
[GW]ip route-static 0.0.0.0 0.0.0.0 12.1.1.2
[GW]
<GW>

ISP:

The device is running!

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys ISP
[ISP]int g0/0/0
[ISP-GigabitEthernet0/0/0]ip ad	
[ISP-GigabitEthernet0/0/0]ip address 12.1.1.2 30
Mar 30 2023 16:22:44-08:00 ISP %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface GigabitEthernet0/0/0 has entered the UP state. 
[ISP-GigabitEthernet0/0/0]int l	
[ISP-GigabitEthernet0/0/0]int l
[ISP-GigabitEthernet0/0/0]q
[ISP]int l	
[ISP]int LoopBack 0
[ISP-LoopBack0]ip ad	
[ISP-LoopBack0]ip address 2.2.2.2 32
[ISP-LoopBack0]

  Please check whether system data has been changed, and save data in time

  Configuration console time out, please press any key to log on

<ISP>
<ISP>sys
Enter system view, return user view with Ctrl+Z.
[ISP]ip rou	
[ISP]ip route
[ISP]ip route-static 100.1.1.2 24
                                  ^
Error:Incomplete command found at '^' position.
[ISP]ip route-static 100.1.1.1 255.255.255.255 12.1.1.1
[ISP]int g0/0/0
[ISP-GigabitEthernet0/0/0]ip ad	
[ISP-GigabitEthernet0/0/0]ip address 12.1.1.2 24
[ISP-GigabitEthernet0/0/0]
[ISP-GigabitEthernet0/0/0]
[ISP-GigabitEthernet0/0/0]

4.实验结果:

 

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值