0
点赞
收藏
分享

微信扫一扫

HuaWei ❀ 静态路由配置实验解析


文章目录

  • ​​1、配置静态路由​​
  • ​​2、配置解析​​

1、配置静态路由

如下图所示,配置静态路由,要求全网可达

HuaWei ❀ 静态路由配置实验解析_经验分享

2、配置解析

配置接口IP地址:
[r1]int g0/0/1
[r1-GigabitEthernet0/0/1]ip address 12.1.1.1 24

配置静态路由:
[r1]ip route-static ?
X.X.X.X Destination IP address
default-preference Preference-value for IPv4 static-routes
selection-rule Selection rule
topology Specify the name of topology
vpn-instance VPN-Instance route information

[r1]ip route-static 1.1.1.1 ?
INTEGER<0-32> Length of IP address mask
X.X.X.X IP address mask

[r1]ip route-static 1.1.1.1 24 ?
Ethernet Ethernet interface
GigabitEthernet GigabitEthernet interface
NULL NULL interface
Serial Serial interface
X.X.X.X Gateway address
vpn-instance Destination VPN-Instance for Gateway address

[r1]ip route-static 2.2.2.2 32 12.1.1.2
[r1]ip route-static 23.1.1.0 24 12.1.1.2
[r1]ip route-static 3.3.3.3 32 12.1.1.2
[r1]ip route-static 3.3.3.3 32 14.1.1.2
[r1]ip route-static 34.1.1.0 24 14.1.1.2
[r1]ip route-static 4.4.4.4 32 14.1.1.2

[r2]ip route-static 1.1.1.1 32 12.1.1.1
[r2]ip route-static 3.3.3.3 32 23.1.1.2
[r2]ip route-static 14.1.1.0 24 12.1.1.1
[r2]ip route-static 34.1.1.0 24 23.1.1.2
[r2]ip route-static 4.4.4.4 32 12.1.1.1
[r2]ip route-static 4.4.4.4 32 23.1.1.2

[r3]ip route-static 2.2.2.2 32 23.1.1.1
[r3]ip route-static 12.1.1.0 24 23.1.1.1
[r3]ip route-static 1.1.1.1 32 23.1.1.1
[r3]ip route-static 1.1.1.1 32 34.1.1.2
[r3]ip route-static 14.1.1.0 24 34.1.1.2
[r3]ip route-static 4.4.4.4 32 34.1.1.2

[r4]ip route-static 1.1.1.1 32 14.1.1.1
[r4]ip route-static 12.1.1.0 24 14.1.1.1
[r4]ip route-static 2.2.2.2 32 14.1.1.1
[r4]ip route-static 2.2.2.2 32 34.1.1.1
[r4]ip route-static 23.1.1.0 24 34.1.1.1
[r4]ip route-static 3.3.3.3 32 34.1.1.1

检查配置结果:
[r1]ping 2.2.2.2
PING 2.2.2.2: 56 data bytes, press CTRL_C to break
Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=255 time=50 ms
Reply from 2.2.2.2: bytes=56 Sequence=2 ttl=255 time=30 ms
Reply from 2.2.2.2: bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 2.2.2.2: bytes=56 Sequence=4 ttl=255 time=30 ms
Reply from 2.2.2.2: bytes=56 Sequence=5 ttl=255 time=30 ms

--- 2.2.2.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/34/50 ms

[r1]ping 3.3.3.3
PING 3.3.3.3: 56 data bytes, press CTRL_C to break
Reply from 3.3.3.3: bytes=56 Sequence=1 ttl=254 time=80 ms
Reply from 3.3.3.3: bytes=56 Sequence=2 ttl=254 time=70 ms
Reply from 3.3.3.3: bytes=56 Sequence=3 ttl=254 time=60 ms
Reply from 3.3.3.3: bytes=56 Sequence=4 ttl=254 time=70 ms
Reply from 3.3.3.3: bytes=56 Sequence=5 ttl=254 time=60 ms

--- 3.3.3.3 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 60/68/80 ms

[r1]ping 4.4.4.4
PING 4.4.4.4: 56 data bytes, press CTRL_C to break
Reply from 4.4.4.4: bytes=56 Sequence=1 ttl=255 time=50 ms
Reply from 4.4.4.4: bytes=56 Sequence=2 ttl=255 time=30 ms
Reply from 4.4.4.4: bytes=56 Sequence=3 ttl=255 time=50 ms
Reply from 4.4.4.4: bytes=56 Sequence=4 ttl=255 time=50 ms
Reply from 4.4.4.4: bytes=56 Sequence=5 ttl=255 time=30 ms

--- 4.4.4.4 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/42/50 ms


举报

相关推荐

0 条评论