华为路由器配置静态路由

在这里插入图片描述
一、配置IP地址
R1路由器配置

system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1
[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ip address 10.0.13.1 24
[R1-GigabitEthernet0/0/0]quit
[R1]interface GigabitEthernet 0/0/1
[R1-GigabitEthernet0/0/1]ip address 10.0.12.1 24
[R1-GigabitEthernet0/0/1]quit
[R1]interface LoopBack 0
[R1-LoopBack0]ip address 10.0.1.1 24

R2路由器配置

system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R2
[R2]interface GigabitEthernet 0/0/1
[R2-GigabitEthernet0/0/1]ip address 10.0.12.2 24
[R2-GigabitEthernet0/0/1]quit
[R2]interface GigabitEthernet 0/0/2
[R2-GigabitEthernet0/0/2]ip address 10.0.23.1 24
[R2-GigabitEthernet0/0/2]quit
[R2]interface LoopBack 0
[R2-LoopBack0]ip address 10.0.2.2 24

R3路由器配置

system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R3
[R3]interface GigabitEthernet 0/0/0
[R3-GigabitEthernet0/0/0]ip address 10.0.13.2 24
[R3-GigabitEthernet0/0/0]quit
[R3]interface GigabitEthernet 0/0/2
[R3-GigabitEthernet0/0/2]ip address 10.0.23.2 24
[R3-GigabitEthernet0/0/2]quit
[R3]interface LoopBack 0
[R3-LoopBack0]ip address 10.0.3.3 24

检测设备之间的连通性
R1 ping10.0.13.2

PING 10.0.13.2: 56  data bytes, press CTRL_C to breakReply from 10.0.13.2: bytes=56 Sequence=1 ttl=255 time=50 msReply from 10.0.13.2: bytes=56 Sequence=2 ttl=255 time=40 msReply from 10.0.13.2: bytes=56 Sequence=3 ttl=255 time=20 msReply from 10.0.13.2: bytes=56 Sequence=4 ttl=255 time=30 msReply from 10.0.13.2: bytes=56 Sequence=5 ttl=255 time=10 ms--- 10.0.13.2 ping statistics ---5 packet(s) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 10/30/50 ms

ping 10.0.12.2

PING 10.0.12.2: 56  data bytes, press CTRL_C to breakReply from 10.0.12.2: bytes=56 Sequence=1 ttl=255 time=40 msReply from 10.0.12.2: bytes=56 Sequence=2 ttl=255 time=30 msReply from 10.0.12.2: bytes=56 Sequence=3 ttl=255 time=20 msReply from 10.0.12.2: bytes=56 Sequence=4 ttl=255 time=20 msReply from 10.0.12.2: bytes=56 Sequence=5 ttl=255 time=30 ms--- 10.0.12.2 ping statistics ---5 packet(s) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 20/28/40 ms

依照此方法测试R2,R3各设备间的连通性。

然后测试R2到目的网络 10.0.13.0/24、10.0.3.0/24 的连通性

PING 10.0.13.3: 56 data bytes, press CTRL_C to breakRequest time outRequest time outRequest time outRequest time outRequest time out--- 10.0.13.3 ping statistics ---5 packet(s) transmitted0 packet(s) received100.00% packet loss
 PING 10.0.3.3: 56 data bytes, press CTRL_C to breakRequest time outRequest time outRequest time outRequest time outRequest time out--- 10.0.3.3 ping statistics ---5 packet(s) transmitted0 packet(s) received
100.00% packet loss

如果R2要与10.0.3.0/24网络通信,需要R2上有去往该网段的路由信息,并且R3上也需要有到R2相应接口所在IP网段的路由信息。

二、配置静态路由
2.1在R2上配置静态路由

配置目的地址为10.0.13.0/24和10.0.3.0/24的静态路由,路由的下一跳配置为R3的G0/0/0接口IP地址10.0.23.2。

[R2]ip route-static 10.0.13.0 24 10.0.23.2
[R2]ip route-static 10.0.3.0 24 10.0.23.2

验证静态路由
tracert 10.0.13.2

traceroute to  10.0.13.2(10.0.13.2), max hops: 30 ,packet length: 40,press CTRL
_C to break 1 10.0.23.2 30 ms  20 ms  30 ms 

tracert 10.0.3.3

traceroute to  10.0.3.3(10.0.3.3), max hops: 30 ,packet length: 40,press CTRL_Cto break 1 10.0.23.2 40 ms  20 ms  20 ms 

静态路由配置完成。


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部