【HCIA】静态路由综合实验

一、配置IP地址

1.1.R1上的配置

<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 192.168.1.1 28
Mar 15 2023 14:54:13-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]int g0/0/1
[r1-GigabitEthernet0/0/1]ip address 192.168.1.33 28
Mar 15 2023 14:54:50-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]dis	
[r1-GigabitEthernet0/0/1]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 1

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.1.1/28       up         up        
GigabitEthernet0/0/1              192.168.1.33/28      up         up        
GigabitEthernet0/0/2              unassigned           down       down      
NULL0                             unassigned           up         up(s) 

 1.2.R2上的配置

 <Huawei>sys
[Huawei]sysname r2
[r2]interface g0/0/0
[r2-GigabitEthernet0/0/0]ip address 192.168.1.2 28

[r2-GigabitEthernet0/0/0]int g0/0/1
[r2-GigabitEthernet0/0/1]ip address 192.168.1.17 28

[r2-GigabitEthernet0/0/1]display ip interface brief 
down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 1

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.162.1.17/28      up         up        
GigabitEthernet0/0/1              192.168.1.17/28      up         up        
GigabitEthernet0/0/2              unassigned           down       down      
NULL0                             unassigned           up         up(s)     

 1.3.R3上的配置

[Huawei]sysname r3
[r3]interface g0/0/0
[r3-GigabitEthernet0/0/0]ip address 192.168.1.35 28
Mar 15 2023 15:20:27-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r3-GigabitEthernet0/0/0]int g0/0/1
[r3-GigabitEthernet0/0/1]ip add 192.168.1.49 28
Mar 15 2023 15:21:00-08:00 r3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[r3-GigabitEthernet0/0/1]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 1

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.1.35/28      up         up        
GigabitEthernet0/0/1              192.168.1.49/28      up         up        
GigabitEthernet0/0/2              unassigned           down       down      
NULL0                             unassigned           up         up(s)     

 1.4.R4上的配置

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r4
[r4]interface g0/0/0
[r4-GigabitEthernet0/0/0]ip address 192.168.1.18 28
[r4-GigabitEthernet0/0/0]
Mar 15 2023 15:22:57-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r4-GigabitEthernet0/0/0]int g0/0/1
[r4-GigabitEthernet0/0/1]ip add 192.168.1.50 28
[r4-GigabitEthernet0/0/1]
Mar 15 2023 15:23:31-08:00 r4 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[r4-GigabitEthernet0/0/1]int g0/0/2
[r4-GigabitEthernet0/0/2]ip add 192.168.1.65 28
[r4-GigabitEthernet0/0/2]
Mar 15 2023 15:23:58-08:00 r4 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP 
on the interface GigabitEthernet0/0/2 has entered the UP state. 
[r4-GigabitEthernet0/0/2]int g4/0/0
[r4-GigabitEthernet4/0/0]ip add 192.168.1.181 28
[r4-GigabitEthernet4/0/0]
Mar 15 2023 15:25:24-08:00 r4 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP 
on the interface GigabitEthernet4/0/0 has entered the UP state. 
[r4-GigabitEthernet4/0/0]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 5
The number of interface that is DOWN in Physical is 0
The number of interface that is UP in Protocol is 5
The number of interface that is DOWN in Protocol is 0

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.1.18/28      up         up        
GigabitEthernet0/0/1              192.168.1.50/28      up         up        
GigabitEthernet0/0/2              192.168.1.65/28      up         up        
GigabitEthernet4/0/0              192.168.1.181/28     up         up        
NULL0                             unassigned           up         up(s) 

 1.5.R5上的配置

Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r5
[r5]int g0/0/0
[r5-GigabitEthernet0/0/0]ip add 192.168.1.66 28
Mar 15 2023 15:28:23-08:00 r5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r5-GigabitEthernet0/0/0]int g0/0/1
[r5-GigabitEthernet0/0/1]ip add 192.168.1.82 28
Mar 15 2023 15:28:44-08:00 r5 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[r5-GigabitEthernet0/0/1]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 0
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 1

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.1.66/28      up         up        
GigabitEthernet0/0/1              192.168.1.82/28      up         up        
GigabitEthernet0/0/2              unassigned           up         down      
NULL0                             unassigned           up         up(s)     

二、配置静态路由

2.1.R1上的配置

[r1]ip route-static 192.168.1.16 28 192.168.1.2 
[r1]ip route-static 192.168.1.48 28 192.168.1.35

//负载均衡
[r1]ip route-static 192.168.1.64 27 192.168.1.2        
[r1]ip route-static 192.168.1.64 27 192.168.1.35

//缺省路由

[r1]ip route-static 0.0.0.0 0 192.168.1.2

//回环的静态路由

[r1]ip route-static 192.168.1.160 27 192.168.1.2         //L4和L5

[r1]ip route-static 192.168.1.128 27 192.168.1.35         //L2和L3

[r1]ip route-static 192.168.1.192 27 192.168.1.2          //L6和L7

[r1]display ip routing-table //查看路由表

2.2.R2上的配置

[r2]ip route-static 192.168.1.32 27 192.168.1.1 
[r2]ip route-static 192.168.1.64 27 192.168.1.18
//缺省路由
[r2]ip route-static 0.0.0.0 0 192.168.1.18
//回环的静态路由
[r2]ip route-static 192.168.1.96 27 192.168.1.1         // L0和L1
[r2]ip route-static 192.168.1.128 27 192.168.1.1        //L2和L3
[r2]ip route-static 192.168.1.192 27 192.168.1.18        //L6和L7

[r2]display ip routing-table 

2.3.R3上的配置

[r3]ip route-static 192.168.1.0 27 192.168.1.50
[r3]ip route-static 192.168.1.64 27 192.168.1.50
//缺省路由
[r3]ip route-static 0.0.0.0 0 192.168.1.50

//回环的静态路由

[r3]ip route-static 192.168.1.96 27 192.168.1.33        // L0和L1
[r3]ip route-static 192.168.1.192 27 192.168.1.50         //L4和L5
[r3]ip route-static 192.168.1.160 27 192.168.1.33         //L2和L3
[r3]display ip routing-table

2.4.R4上的配置

[r4]ip route-static 192.168.1.0 28 192.168.1.17
[r4]ip route-static 192.168.1.32 28 192.168.1.49
//回环的静态路由
[r4]ip route-static 192.168.1.96 27 192.168.1.17       // L0和L1
[r4]ip route-static 192.168.1.160 27 192.168.1.17        //L4和L5
[r4]ip route-static 192.168.1.128 27 192.168.1.49        //L2和L3
//缺省路由
[r4]ip route-static 0.0.0.0 0 192.168.1.66
[r4]ip route-static 0.0.0.0 0 192.168.1.82        preference 61         //设置优先级
[r4]display ip routing-table 

2.5.R5上的配置

[r5]ip route-static 192.168.1.32 27 192.168.1.65  [r5]ip route-static 192.168.1.32 27 192.168.1.81 preference 61       

//192.168.1.65为1000M的, 192.168.1.81 为100M的,以下同理
[r5]ip route-static 192.168.1.0 27 192.168.1.65    [r5]ip route-static 192.168.1.0 27 192.168.1.81 preference 61           
//回环的静态路由
[r5]ip route-static 192.168.1.96 27 192.168.1.65    //L1和L2
[r5]ip route-static 192.168.1.96 27 192.168.1.81  preference 61      
[r5]ip route-static 192.168.1.160 27 192.168.1.65        //L4和L5
[r5]ip route-static 192.168.1.160 27 192.168.1.81 preference 61       
[r5]ip route-static 192.168.1.128 27 192.168.1.65        //L2和L3
[r5]ip route-static 192.168.1.128 27 192.168.1.81 preference 61
[r5]ip route-static 192.168.1.192 27 192.168.1.65        //L6和L7
[r5]ip route-static 192.168.1.192 27 192.168.1.81 preference 61

三、避免回环

[r5]ip route-static 192.168.1.32 27 192.168.1.65  [r5]ip route-static 192.168.1.32 27 192.168.1.81 preference 61       

//192.168.1.65为1000M的, 192.168.1.81 为100M的,以下同理
[r5]ip route-static 192.168.1.0 27 192.168.1.65    [r5]ip route-static 192.168.1.0 27 192.168.1.81 preference 61           
//回环的静态路由
[r5]ip route-static 192.168.1.96 27 192.168.1.65    //L1和L2
[r5]ip route-static 192.168.1.96 27 192.168.1.81  preference 61      
[r5]ip route-static 192.168.1.160 27 192.168.1.65        //L4和L5
[r5]ip route-static 192.168.1.160 27 192.168.1.81 preference 61       
[r5]ip route-static 192.168.1.128 27 192.168.1.65        //L2和L3
[r5]ip route-static 192.168.1.128 27 192.168.1.81 preference 61
[r5]ip route-static 192.168.1.192 27 192.168.1.65        //L6和L7
[r5]ip route-static 192.168.1.192 27 192.168.1.81 preference 61

 四、全局DCHP配置

[r5]interface g0/0/2
[r5-GigabitEthernet0/0/2]ip address 192.168.2.1 24
Mar 15 2023 16:46:52-08:00 r5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/2 has entered the UP state. 
[r5-GigabitEthernet0/0/2]q
[r5]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[r5]ip pool shazi
Info: It's successful to create an IP address pool.
[r5-ip-pool-shazi]dns	
[r5-ip-pool-shazi]dns-list 8.8.8.8 114.114.114.114
[r5-ip-pool-shazi]q
[r5]interface g0/0/2
[r5-GigabitEthernet0/0/2]dhcp select global
[r5-GigabitEthernet0/0/2]display ip pool  
  -----------------------------------------------------------------------
  Pool-name      : shazi
  Pool-No        : 0
  Position       : Local           Status           : Unlocked
  Gateway-0      : 192.168.2.1     
  Mask           : -
  VPN instance   : --


  IP address Statistic
    Total       :0     
    Used        :0          Idle        :0     
    Expired     :0          Conflict    :0          Disable   :0   

 五、实验图

  • 5
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值