实践是检验真理的唯一标准!路由相关配置实操②

实验

实验要求:实现全网互通。
实践是检验真理的唯一标准!路由相关配置实操②
配置步骤:
(1)配置PC1,PC2和PC3
①配置PC1的IP为192.168.10.1,子网掩码为255.255.255.0,网关为192.168.10.254
实践是检验真理的唯一标准!路由相关配置实操②
②配置PC2的IP为192.168.20.1,子网掩码为255.255.255.0,网关为192.168.20.254
实践是检验真理的唯一标准!路由相关配置实操②
③配置PC3的IP为192.168.30.1,子网掩码为255.255.255.0,网关为192.168.30.254
实践是检验真理的唯一标准!路由相关配置实操②

(2)配置路由器R1

①进入系统视图

②改路由器名称为R1

③接口IP设置
接口g0/0/0 ip address 192.168.10.254 24
接口g0/0/1 ip address 12.0.0.1 24
接口g0/0/2 ip address 13.0.0.1 24

④设置静态路由
ip route-static 192.168.20.0 24 12.0.0.2
ip route-static 192.168.30.0 24 13.0.0.2

⑤保存设置

<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1

[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.10.254 24
Apr  5 2021 22:59:31-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 add 12.0.0.1 24
Apr  5 2021 23:00:03-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]int g0/0/2
[R1-GigabitEthernet0/0/2]ip add 13.0.0.1 24
[R1-GigabitEthernet0/0/2]
Apr  5 2021 23:00:58-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]q
[R1]ip route-static 192.168.20.0 24 12.0.0.2
[R1]ip route-static 192.168.30.0 24 13.0.0.2

[R1]quit
<R1>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
<R1>

(3) 配置路由器R2

①进入系统视图

②改路由器名称为R2

③接口IP设置
接口g0/0/0 ip address 12.0.0.2 24
接口g0/0/1 ip address 192.168.20.254 24

④设置静态路由
ip route-static 192.168.10.0 24 12.0.0.1
ip route-static 192.168.30.0 24 12.0.0.1

⑤保存设置

<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R2

[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 12.0.0.2 24
Apr  5 2021 23:01:47-08:00 R2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 

[R2-GigabitEthernet0/0/0]int g0/0/1
[R2-GigabitEthernet0/0/1]ip add 192.168.20.254 24
Apr  5 2021 23:02:24-08:00 R2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state.
 
[R2-GigabitEthernet0/0/1]q
[R2]ip route-static 192.168.10.0 24 12.0.0.1
[R2]ip route-static 192.168.30.0 24 12.0.0.1

[R2]quit
<R2>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
<R2>

(4)配置路由器R3

①进入系统视图

②改路由器名称为R3

③接口IP设置
接口g0/0/0 ip address 13.0.0.2 24
接口g0/0/1 ip address 192.168.30.254 24

④设置静态路由
ip route-static 192.168.10.0 24 13.0.0.1
ip route-static 192.168.20.0 24 13.0.0.1

⑤保存设置

<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R3

[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 13.0.0.2 24
Apr  5 2021 23:02:57-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.30.254 24
Apr  5 2021 23:03:28-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]q
[R3]ip route-static 192.168.10.0 24 13.0.0.1
[R3]ip route-static 192.168.20.0 24 13.0.0.1

[R3]quit
<R3>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
<R3>;

(5)互通Ping测试。
①PC1 ping 通PC2和PC3

实践是检验真理的唯一标准!路由相关配置实操②
②PC2 ping 通PC1和PC3
实践是检验真理的唯一标准!路由相关配置实操②
③PC3 ping 通PC1和PC2
实践是检验真理的唯一标准!路由相关配置实操②

上一篇:VRRP相关配置案例!②


下一篇:双机热备份VRRP原理详解(附实验)