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

实验

实验要求:
在R1配置默认路由,R2,R3配置静态路由,使得内网1.0和2.0网段可以访问server。
在这里插入图片描述

配置步骤:
(1)配置PC1和PC2以及服务器server的IP地址和子网掩码

①配置PC1的IP为192.168.1.10,子网掩码为255.255.255.0,网关为192.168.1.1
在这里插入图片描述
②配置PC2的IP为192.168.2.10,子网掩码为255.255.255.0,网关为192.168.2.1
在这里插入图片描述

③配置server的IP为10.0.0.2,子网掩码为255.0.0.0,网关为10.0.0.1 `

(2)配置路由器R1

①进入系统视图

②改路由器名称为R1

③接口IP设置
接口g0/0/0 ip address 192.168.1.1 24
接口g0/0/1 ip address 192.168.2.1 24
接口g0/0/2 ip address 192.168.10.1 24

④设置默认路由
ip route-static 0.0.0.0 0 192.168.10.2

⑤保存设置

<Huawei>system-view
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 24
Apr  5 2021 17:00:18-08:00 R1 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 

[R1-GigabitEthernet0/0/0]interface g0/0/1
[R1-GigabitEthernet0/0/1]ip address 192.168.2.1 24
Apr  5 2021 17:00:51-08:00 R1 %%01IFNET/4/LINK_STATE(l)[4]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 

[R1-GigabitEthernet0/0/1]interface g0/0/2
[R1-GigabitEthernet0/0/2]ip address 192.168.10.1 24
[R1-GigabitEthernet0/0/2]
Apr  5 2021 17:01:27-08:00 R1 %%01IFNET/4/LINK_STATE(l)[5]:The line protocol IP 
on the interface GigabitEthernet0/0/2 has entered the UP state. 

[R1-GigabitEthernet0/0/2]quit
[R1]ip route-static 0.0.0.0 0 192.168.10.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 192.168.10.2 24
接口g0/0/1 ip address 192.168.20.1 24

④设置静态路由
ip route-static 10.0.0.0 8 192.168.20.2
ip route-static 192.168.1.0 24 192.168.10.1
ip route-static 192.168.2.0 24 192.168.10.1

⑤保存设置

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

[R2]interface g0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.10.2 24
Apr  5 2021 17:06:21-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]interface g0/0/1
[R2-GigabitEthernet0/0/1]ip address 192.168.20.1 24
Apr  5 2021 17:06:47-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]quit
[R2]ip route-static 10.0.0.0 8 192.168.20.2
[R2]ip route-static 192.168.1.0 24 192.168.10.1
[R2]ip route-static 192.168.2.0 24 192.168.10.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 192.168.20.2 24
接口g0/0/1 ip address 10.0.0.1 8

④设置静态路由
ip route-static 192.168.1.0 24 192.168.20.1
ip route-static 192.168.2.0 24 192.168.20.1

⑤保存设置

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

[R3]interface g0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.20.2 24
Apr  5 2021 17:15:19-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]interface g0/0/1
[R3-GigabitEthernet0/0/1]ip address 10.0.0.1 8
Apr  5 2021 17:16:03-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]quit
[R3]ip route-static 192.168.1.0 24 192.168.20.1
[R3]ip route-static 192.168.2.0 24 192.168.20.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)主机PC1和主机PC2ping通服务器server测试
①PC1 ping sercer 测试
ping 10.0.0.2
在这里插入图片描述
②PC2 ping sercer 测试
ping 10.0.0.2
在这里插入图片描述

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值