HCIA第三天作业

一、拓扑结构

二、要求

 1.PC1访问PC345走上面,R1 R2实现备份21.1.10/24实现备份

PC3456 访问PC12走下面,R3 4之间实现等价路由

尽量减少路由条目

全网可达

2.PC7代表运营商,所有PC均可访问

三、步骤

1.给所有端口配置IP地址

AR6配置

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]interface g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add	
[Huawei-GigabitEthernet0/0/0]ip address 16.1.1.1 24
Jul 21 2022 20:44:51-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[2]:The line protocol
 IP on the interface GigabitEthernet0/0/0 has entered the UP state. 
[Huawei-GigabitEthernet0/0/0]quit
[Huawei]interface g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add	
[Huawei-GigabitEthernet0/0/1]ip address 172.16.1.1 24
Jul 21 2022 20:44:32-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[1]:The line protocol
 IP on the interface GigabitEthernet0/0/1 has entered the UP state. 
[Huawei]interface g0/0/2	
[Huawei-GigabitEthernet0/0/2]ip address 67.1.1.1 24
Jul 21 2022 20:43:18-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[0]:The line protocol
 IP on the interface GigabitEthernet0/0/2 has entered the UP state. 
	

  AR1配置

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r1
[r1]interface g0/0/0
[r1-GigabitEthernet0/0/0]ip address 16.1.1.2 24
Jul 21 2022 20:46:19-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r1-GigabitEthernet0/0/0]quit 
[r1]interface g0/0/1
[r1-GigabitEthernet0/0/1]ip address 12.1.1.1 24
Jul 21 2022 20:46:35-08:00 r1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[r1-GigabitEthernet0/0/1]quit	
[r1]interface g0/0/2
[r1-GigabitEthernet0/0/2]ip address 13.1.1.1 24
[r1-GigabitEthernet0/0/2]
Jul 21 2022 20:46:56-08:00 r1 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP 
on the interface GigabitEthernet0/0/2 has entered the UP state. 
[r1-GigabitEthernet0/0/2]quit
[r1]interface g4/0/0
[r1-GigabitEthernet4/0/0]ip address 21.1.1.1 24
[r1-GigabitEthernet4/0/0]
Jul 21 2022 20:47:47-08:00 r1 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP 
on the interface GigabitEthernet4/0/0 has entered the UP state. 

测试连通性 

AR6开启DHCP服务

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]dhcp enable 
Info: The operation may take a few seconds. Please wait for a moment.done.
[Huawei]ip pool 1
Info: It's successful to create an IP address pool.
[Huawei-ip-pool-1]network 172.16.1.0 mask 255.255.255.0	
[Huawei-ip-pool-1]gateway-list 172.16.1.1	
[Huawei-ip-pool-1]dns-list 8.8.8.8 114.114.114.114
[Huawei-ip-pool-1]quit
[Huawei]interface g0/0/1	
[Huawei-GigabitEthernet0/0/1]dhcp select global 
[Huawei-GigabitEthernet0/0/1]

 

 AR5同理,PC4567同理

静态路由

AR6

[Huawei]ip route-static 12.1.1.0 24 16.1.1.2
[Huawei]ip route-static 21.1.1.0 24 16.1.1.2
[Huawei]ip route-static 24.1.1.0 24 16.1.1.2
[Huawei]ip route-static 13.1.1.0 24 16.1.1.2
[Huawei]ip route-static 34.1.1.0 24 16.1.1.2
[Huawei]ip route-static 43.1.1.0 24 16.1.1.2
[Huawei]ip route-static 45.1.1.0 24 16.1.1.2
[Huawei]ip route-static 192.168.0.0 22 16.1.1.2
[Huawei]display ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 21       Routes : 21       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

       12.1.1.0/24  Static  60   0          RD   16.1.1.2        GigabitEthernet
0/0/0
       13.1.1.0/24  Static  60   0          RD   16.1.1.2        GigabitEthernet
0/0/0
       16.1.1.0/24  Direct  0    0           D   16.1.1.1        GigabitEthernet
0/0/0
       16.1.1.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
     16.1.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
       21.1.1.0/24  Static  60   0          RD   16.1.1.2        GigabitEthernet
0/0/0
       24.1.1.0/24  Static  60   0          RD   16.1.1.2        GigabitEthernet
0/0/0
       34.1.1.0/24  Static  60   0          RD   16.1.1.2        GigabitEthernet
0/0/0
       43.1.1.0/24  Static  60   0          RD   16.1.1.2        GigabitEthernet
0/0/0
       45.1.1.0/24  Static  60   0          RD   16.1.1.2        GigabitEthernet
0/0/0
       67.1.1.0/24  Direct  0    0           D   67.1.1.1        GigabitEthernet
0/0/2
       67.1.1.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
     67.1.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
      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
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
     172.16.1.0/24  Direct  0    0           D   172.16.1.1      GigabitEthernet
0/0/1
     172.16.1.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
   172.16.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
    192.168.0.0/22  Static  60   0          RD   16.1.1.2        GigabitEthernet
0/0/0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

r1

[r1]ip route-static 172.16.1.0 24 16.1.1.1
[r1]ip route-static 24.1.1.0 24 12.1.1.2
[r1]ip route-static 24.1.1.0 24 21.1.1.2 preference 61
Info: Succeeded in modifying route.
[r1]ip route-static 45.1.1.0 24 12.1.1.2
[r1]ip route-static 45.1.1.0 24 21.1.1.2 preference 61
[r1]ip route-static 192.168.0.0 22 12.1.1.2
[r1]ip route-static 192.168.0.0 22 21.1.1.2 preference 61

r2

[r2]ip route-static 16.1.1.0 24 12.1.1.1	
[r2]ip route-static 16.1.1.0 24 21.1.1.1 preference 61
[r2]ip route-static 172.16.1.0 24 12.1.1.1	
[r2]ip route-static 172.16.1.0 24 21.1.1.1 preference 61
[r2]ip route-static 45.1.1.0 24 24.1.1.2
[r2]ip route-static 192.168.0.0 22 24.1.1.2

[r2]ip route-static 13.1.1.0 24 12.1.1.1
[r2]ip route-static 13.1.1.0 24 21.1.1.1 preference 61
Info: Succeeded in modifying route.
[r2]ip route-static 34.1.1.0 24 24.1.1.2
[r2]ip route-static 43.1.1.0 24 24.1.1.2

r3

[r3]ip route-static 172.168.1.0 24 13.1.1.1
[r3]ip route-static 16.1.1.0 24 13.1.1.1
[r3]ip route-static 45.1.1.0 24 34.1.1.2
[r3]ip route-static 45.1.1.0 24 43.1.1.2
[r3]ip route-static 192.168.0.0 22 34.1.1.2
[r3]ip route-static 192.168.0.0 22 43.1.1.2
[r3]ip route-static 12.1.1.0 24 13.1.1.1
[r3]ip route-static 21.1.1.0 24 13.1.1.1
[r3]ip route-static 24.1.1.0 24 34.1.1.2
[r3]ip route-static 24.1.1.0 24 43.1.1.2

r4

[r4]ip route-static 192.168.0.0 22 45.1.1.2
[r4]ip route-static 172.16.1.0 24 24.1.1.1
[r4]ip route-static 16.1.1.0 24 24.1.1.1
[r4]ip route-static 12.1.1.0 24 24.1.1.1
[r4]ip route-static 21.1.1.0 24 24.1.1.1
[r4]ip route-static 13.1.1.0 24 34.1.1.1
[r4]ip route-static 13.1.1.0 24 43.1.1.1

r5

[r5]ip route-static 172.16.1.0 24 45.1.1.1
[r5]ip route-static 16.1.1.0 24 45.1.1.1
[r5]ip route-static 12.1.1.0 24 45.1.1.1
[r5]ip route-static 21.1.1.0 24 45.1.1.1
[r5]ip route-static 24.1.1.0 24 45.1.1.1
[r5]ip route-static 13.1.1.0 24 45.1.1.1
[r5]ip route-static 34.1.1.0 24 45.1.1.1
[r5]ip route-static 43.1.1.0 24 45.1.1.1

验证连通性 全网可达

访问外网

缺省路由 

R6[Huawei]ip route-static 0.0.0.0 0 67.1.1.2
[r1]ip route-static 0.0.0.0 0 16.1.1.1
[r2]ip route-static 0.0.0.0 0 12.1.1.1	
[r2]ip route-static 0.0.0.0 0 21.1.1.1 preference 61
[r3]ip route-static 0.0.0.0 0 13.1.1.1
[r4]ip route-static 0.0.0.0 0 24.1.1.1
[r5]ip route-static 0.0.0.0 0 45.1.1.1

PC4 pingPC7(外网) ,全网可达

防环路由

[r5]ip route-static 192.168.0.0 22 NULL 0

 AR6上 走上面

 r5 只能走上面

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值