5G华为静态路由实现全网互通

静态路由实现全网互通

5G华为静态路由实现全网互通_第1张图片

配置前先把所有设置打上必打命令

以R1为例

undo terminal monitor ——关闭弹屏
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.——修改名字
[Huawei]sysname r1
r1]user-interface console 0
[r1-ui-console0]id
[r1-ui-console0]idle-timeout 0 0——启用永不超时
[r1-ui-console0]quit

配置线路端口命令

R1
[r1]int g0/0/0——进入端口
[r1-GigabitEthernet0/0/0]ip add 10.1.1.1 24——配置地址
[r1-GigabitEthernet0/0/0]undo shutdown ——开启
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[r1-GigabitEthernet0/0/0]int loop0——环回
[r1-LoopBack0]ip add 1.1.1.1 32
[r1-LoopBack0]quit
[r1]

R2
[r2]user
[r2]user-in
[r2]user-interface co
[r2]user-interface console 0
[r2-ui-console0]id
[r2-ui-console0]idle-timeout 0 0
[r2-ui-console0]quit
[r2]interface g0/0/0
[r2-GigabitEthernet0/0/0]ip add 10.1.1.2 24
[r2-GigabitEthernet0/0/0]undo shutdown
[r2-GigabitEthernet0/0/0]int g0/0/1
[r2-GigabitEthernet0/0/1]ip add 10.1.2.2 24
[r2-GigabitEthernet0/0/1]undo shutdown
[r2-GigabitEthernet0/0/1]quit

R3
[r3]user
[r3]user-in
[r3]user-interface co
[r3]user-interface console 0
[r3-ui-console0]idle-timeout 0 0
[r3-ui-console0]quit
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 10.1.2.3 24
[r3-GigabitEthernet0/0/0]int loop0
[r3-LoopBack0]ip add 3.3.3.3 32
[r3-LoopBack0]quit

端口配置完后设置默认路由

在以上命令基础上输入命令
R1
[r1]ip route-static 10.1.2.0 24 10.1.1.2——所获取的地址及下一跳指向的端口
[r1]ip rou
[r1]ip route
[r1]ip route-static
[r1]ip route
[r1]ip route-static 3.3.3.3 32 10.1.1.2

R2
[r2]ip route-static 1.1.1.1 32 10.1.1.1
[r2]ip rou
[r2]ip route
[r2]ip route-static 3.3.3.3 32 10.1.2.3

R3
[r3]ip rou
[r3]ip route
[r3]ip route-static 10.1.1.0 24 10.1.2.2
[r3]ip rou
[r3]ip route
[r3]ip route-static 1.1.1.1 32 10.1.2.2

检查设备是否连通

[r2]ping 10.1.1.1
PING 10.1.1.1: 56 data bytes, press CTRL_C to break
Reply from 10.1.1.1: bytes=56 Sequence=1 ttl=255 time=60 ms
Reply from 10.1.1.1: bytes=56 Sequence=2 ttl=255 time=30 ms
Reply from 10.1.1.1: bytes=56 Sequence=3 ttl=255 time=10 ms
Reply from 10.1.1.1: bytes=56 Sequence=4 ttl=255 time=10 ms
Reply from 10.1.1.1: bytes=56 Sequence=5 ttl=255 time=20 ms

你可能感兴趣的:(静态路由配置)