静态路由实验


静态路由实验

路由器静态路由实验:实现R1、R2、 R3三者之间互相ping通。

工具准备

  • 华为 eNSP

路由器静态路由实验:实现R1、R2、R3三者之间互相ping通。

  • 第一步:首先配置各接口P地址。

  • 第二步:配置静态路由命令。

  • 第三步:再ping验证或display ip routing。

第一步:首先配置 各接口IP地址。

第二步:配置静态路由命令。

...

第一步:首先配置各接口P地址。

AR1:


The device is running!

sys
Enter system view, return user view with Ctrl+Z.
[Huawei]
[Huawei]
[Huawei]sysname AR1
[AR1]
[AR1]
[AR1]int giga	
[AR1]int GigabitEthernet 0/0/1
[AR1-GigabitEthernet0/0/1]   
[AR1-GigabitEthernet0/0/1]
[AR1-GigabitEthernet0/0/1]
[AR1-GigabitEthernet0/0/1]
[AR1-GigabitEthernet0/0/1]ip add	
[AR1-GigabitEthernet0/0/1]ip address 10.1.1.1 24 
Jun 21 2022 16:04:15-08:00 AR1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface GigabitEthernet0/0/1 has entered the UP state. 
[AR1-GigabitEthernet0/0/1]
[AR1-GigabitEthernet0/0/1]
[AR1-GigabitEthernet0/0/1]
[AR1-GigabitEthernet0/0/1]un in en
                             ^
Error: Unrecognized command found at '^' position.
[AR1-GigabitEthernet0/0/1]
[AR1-GigabitEthernet0/0/1]quit
[AR1]
[AR1]
[AR1]un in en
Info: Information center is disabled.
[AR1]
[AR1]
[AR1]int giga     	
[AR1]int GigabitEthernet 0/0/2
[AR1-GigabitEthernet0/0/2]
[AR1-GigabitEthernet0/0/2]
[AR1-GigabitEthernet0/0/2]
[AR1-GigabitEthernet0/0/2]ip add	
[AR1-GigabitEthernet0/0/2]ip address 
                                     ^
Error:Incomplete command found at '^' position.
[AR1-GigabitEthernet0/0/2]
[AR1-GigabitEthernet0/0/2]ip address 10.1.4.1 30 
[AR1-GigabitEthernet0/0/2]
[AR1-GigabitEthernet0/0/2]
[AR1-GigabitEthernet0/0/2]
[AR1-GigabitEthernet0/0/2]ip rou	
[AR1-GigabitEthernet0/0/2]ip route-s	
[AR1-GigabitEthernet0/0/2]ip route-sta	
[AR1-GigabitEthernet0/0/2]return
sys
Enter system view, return user view with Ctrl+Z.
[AR1]ip sta	
[AR1]ip static	
[AR1]ip rou	
[AR1]ip route-s	
[AR1]ip route-static 10.1.2.0 255.255.255.0 10.1.4.2
[AR1]
[AR1]
[AR1]
[AR1]ip route-sta	
[AR1]ip route-static 10.1.3.0 255.255.255.0 10.1.4.2
[AR1]
[AR1]
[AR1]
[AR1]

AR2:

...

The device is running!

sys
Enter system view, return user view with Ctrl+Z.
[Huawei]
[Huawei]
[Huawei]sysname AR2
[AR2]
[AR2]
[AR2]
[AR2]int giga	
[AR2]int GigabitEthernet 0/0/2
[AR2-GigabitEthernet0/0/2]
[AR2-GigabitEthernet0/0/2]
[AR2-GigabitEthernet0/0/2]
[AR2-GigabitEthernet0/0/2]ip add 10.1.4.2 30 
Jun 21 2022 16:18:30-08:00 AR2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface GigabitEthernet0/0/2 has entered the UP state. 
[AR2-GigabitEthernet0/0/2]
[AR2-GigabitEthernet0/0/2]
[AR2-GigabitEthernet0/0/2]
[AR2-GigabitEthernet0/0/2]int giga	
[AR2-GigabitEthernet0/0/2]quit
[AR2]int giga	
[AR2]int GigabitEthernet 0/0/1
[AR2-GigabitEthernet0/0/1]ip add 10.1.2.1 24 
Jun 21 2022 16:19:43-08:00 AR2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
 on the interface GigabitEthernet0/0/1 has entered the UP state. 
[AR2-GigabitEthernet0/0/1]
[AR2-GigabitEthernet0/0/1]
[AR2-GigabitEthernet0/0/1]quit
[AR2]
[AR2]
[AR2]
[AR2]un in en
Info: Information center is disabled.
[AR2]
[AR2]
[AR2]
[AR2]int giga	
[AR2]int GigabitEthernet 0/0/0
[AR2-GigabitEthernet0/0/0]
[AR2-GigabitEthernet0/0/0]
[AR2-GigabitEthernet0/0/0]
[AR2-GigabitEthernet0/0/0]
[AR2-GigabitEthernet0/0/0]ip add 10.1.5.1 30
[AR2-GigabitEthernet0/0/0]
[AR2-GigabitEthernet0/0/0]
[AR2-GigabitEthernet0/0/0]
[AR2-GigabitEthernet0/0/0]quit
[AR2]
[AR2]
[AR2]
[AR2]
[AR2]
[AR2]
[AR2]ip rou	
[AR2]ip route-st	
[AR2]ip route-static 10.1.1.0 255.255.255.0
                                            ^
Error:Incomplete command found at '^' position.
[AR2]ip route-static 10.1.1.0 255.255.255.0 10.1.4.1
[AR2]
[AR2]
[AR2]
[AR2]
[AR2]ip route-static 10.1.3.0 255.255.255.0 10.1.5.2
[AR2]
[AR2]
[AR2]
[AR2]
[AR2]

AR3:

...


The device is running!

sys
Enter system view, return user view with Ctrl+Z.
[Huawei]
[Huawei]
[Huawei]
[Huawei]
[Huawei]sysname AR3
[AR3]
[AR3]
[AR3]
[AR3]
[AR3]int giga	
[AR3]int GigabitEthernet 0/0/1
[AR3-GigabitEthernet0/0/1]
[AR3-GigabitEthernet0/0/1]
[AR3-GigabitEthernet0/0/1]ip add 10.1.3.1 24
Jun 21 2022 17:16:43-08:00 AR3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface GigabitEthernet0/0/1 has entered the UP state. 
[AR3-GigabitEthernet0/0/1]
[AR3-GigabitEthernet0/0/1]
[AR3-GigabitEthernet0/0/1]
[AR3-GigabitEthernet0/0/1]quit
[AR3]un in en
Info: Information center is disabled.
[AR3]
[AR3]
[AR3]
[AR3]int giga	
[AR3]int GigabitEthernet 0/0/2
[AR3-GigabitEthernet0/0/2]
[AR3-GigabitEthernet0/0/2]
[AR3-GigabitEthernet0/0/2]
[AR3-GigabitEthernet0/0/2]ip add 10.1.5.2 30
[AR3-GigabitEthernet0/0/2]
[AR3-GigabitEthernet0/0/2]
[AR3-GigabitEthernet0/0/2]
[AR3-GigabitEthernet0/0/2]quit
[AR3]
[AR3]
[AR3]
[AR3]ip rou	
[AR3]ip route-s	
[AR3]ip route-static 10.1.2.0 255.255.255
                              ^
Error: Wrong parameter found at '^' position.
[AR3]ip route-static 10.1.2.0 255.255.255.0 10.1.5.1
[AR3]
[AR3]
[AR3]
[AR3]

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

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





save
  The current configuration will be written to the device. 
  Are you sure to continue? (y/n)[n]:y
  It will take several minutes to save configuration file, please wait.......
  Configuration file had been saved successfully
  Note: The configuration file will take effect after being activated
sys
Enter system view, return user view with Ctrl+Z.
[AR3]
[AR3]
[AR3]ip rou	
[AR3]ip route-s	
[AR3]ip route-static 10.1.1.0 255.255.255.0 10.1.5.1 
[AR3]
[AR3]
[AR3]
[AR3]
[AR3]
[AR3]quit
save
  The current configuration will be written to the device. 
  Are you sure to continue? (y/n)[n]:y
  It will take several minutes to save configuration file, please wait.......
  Configuration file had been saved successfully
  Note: The configuration file will take effect after being activated

PC1:

...

PC2:

...

PC3:

第三步:再ping验证或display ip routing。

PC1 ping PC3

PC1 ping PC2