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

实验

实验要求:实现全网互通。
在这里插入图片描述
配置步骤:
(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
在这里插入图片描述

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值