eNSP拓扑图
任务如下
任务一:让R1能Ping通R4的192.168.34.4任务二:让R2能Ping通R4的4.4.4.4
配置路由器
R1
[Huawei]sys R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.12.1 24
[R1-GigabitEthernet0/0/0]q
[R1]ip route-static 192.168.34.0 24 192.168.12.2
[R1]ip route-static 4.4.4.4 32 192.168.12.2
R2
[Huawei]sys R2
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 192.168.12.2 24
[R2-GigabitEthernet0/0/0]int g0/0/1
[R2-GigabitEthernet0/0/1]ip add 192.168.23.2 24
[R2-GigabitEthernet0/0/1]q
[R2]ip route-static 192.168.34.4 24 192.168.23.3
[R2]ip route-static 4.4.4.4 32 192.168.23.3
R3
[Huawei]sys R3
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 192.168.23.3 24
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 192.168.34.3 24
[R3-GigabitEthernet0/0/1]q
[R3]ip route-static 192.168.12.0 24 192.168.23.2
[R3]ip route-static 4.4.4.4 32 192.168.34.4
R4
[Huawei]sys R4
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip add 192.168.34.4 24
[R4-GigabitEthernet0/0/0]q
[R4]ip route-static 192.168.12.0 24 192.168.34.3
[R4]int loop 0
[R4-LoopBack0]ip add 4.4.4.4 32
[R4-LoopBack0]q
R1(验证配置)
[R1]ping 192.168.34.4
PING 192.168.34.4: 56 data bytes, press CTRL_C to break
Reply from 192.168.34.4: bytes=56 Sequence=1 ttl=253 time=100 ms
Reply from 192.168.34.4: bytes=56 Sequence=2 ttl=253 time=20 ms
Reply from 192.168.34.4: bytes=56 Sequence=3 ttl=253 time=50 ms
Reply from 192.168.34.4: bytes=56 Sequence=4 ttl=253 time=40 ms
Reply from 192.168.34.4: bytes=56 Sequence=5 ttl=253 time=20 ms
--- 192.168.34.4 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/46/100 ms
[R1]ip route-static 4.4.4.4 32 192.168.12.2
[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=253 time=60 ms
Reply from 4.4.4.4: bytes=56 Sequence=2 ttl=253 time=40 ms
Reply from 4.4.4.4: bytes=56 Sequence=3 ttl=253 time=40 ms
Reply from 4.4.4.4: bytes=56 Sequence=4 ttl=253 time=30 ms
Reply from 4.4.4.4: bytes=56 Sequence=5 ttl=253 time=40 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/60 ms
R1查看路由表
[R1]dis ip rout
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 9 Routes : 9
Destination/Mask Proto Pre Cost Flags NextHop Interface
4.4.4.4/32 Static 60 0 RD 192.168.12.2 GigabitEthernet
0/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.12.0/24 Direct 0 0 D 192.168.12.1 GigabitEthernet
0/0/0
192.168.12.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
192.168.12.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
192.168.34.0/24 Static 60 0 RD 192.168.12.2 GigabitEthernet
0/0/0
路由表分析:
Destination:目的网段
mask:子网掩码
proto:协议(Direct直连、Static静态、BGP、OSPF、RIP、ISIS动态)
pro:优先级(Direct直连:0、Static静态:60、BGP、OSPF:10/150、RIP、ISIS动态)
cost:开销
NextHop:下一跳
任务如下
任务三:全网通,一共18条静态路由
重启路由器,eNSP拓扑图
配置路由器
R1
[Huawei]sys R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.12.1 24
[R1-GigabitEthernet0/0/0]int loop 0
[R1-LoopBack0]ip add 1.1.1.1 32
[R1-LoopBack0]q
[R1]ip route-static 192.168.34.0 24 192.168.12.2
[R1]ip route-static 192.168.23.0 24 192.168.12.2
[R1]ip route-static 2.2.2.2 32 192.168.12.2
[R1]ip route-static 3.3.3.3 32 192.168.12.2
[R1]ip route-static 4.4.4.4 32 192.168.12.2
R2
[Huawei]sys R2
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 192.168.12.2 24
[R2-GigabitEthernet0/0/0]int loop 0
[R2-LoopBack0]ip add 2.2.2.2 32
[R2-LoopBack0]int g0/0/1
[R2-GigabitEthernet0/0/1]ip add 192.168.23.2 24
[R2-GigabitEthernet0/0/1]q
[R2]ip route-static 192.168.34.0 24 192.168.23.3
[R2]ip route-static 3.3.3.3 32 192.168.23.3
[R2]ip route-static 4.4.4.4 32 192.168.23.3
[R2]ip route-static 1.1.1.1 32 192.168.23.1
R3
[Huawei]sys R3
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 192.168.23.3 24
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 192.168.34.3 24
[R3-GigabitEthernet0/0/1]int loop 0
[R3-LoopBack0]ip add 3.3.3.3 32
[R3-LoopBack0]q
[R3]ip route-static 192.168.12.0 24 192.168.23.2
[R3]ip route-static 1.1.1.1 32 192.168.23.2
[R3]ip route-static 2.2.2.2 32 192.168.23.2
[R3]ip route-static 4.4.4.4 32 192.168.34.4
R4
[Huawei]sys R4
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip add 192.168.34.4 24
[R4-GigabitEthernet0/0/0]int loop 0
[R4-LoopBack0]ip add 4.4.4.4 32
[R4-LoopBack0]q
[R4]ip route-static 192.168.12.0 24 192.168.34.3
[R4]ip route-static 192.168.23.0 24 192.168.34.3
[R4]ip route-static 1.1.1.1 32 192.168.34.3
[R4]ip route-static 2.2.2.2 32 192.168.34.3
[R4]ip route-static 3.3.3.3 32 192.168.34.3
验证配置Ping
[R1]ping 192.168.34.3
PING 192.168.34.3: 56 data bytes, press CTRL_C to break
Request time out
Reply from 192.168.34.3: bytes=56 Sequence=2 ttl=254 time=130 ms
Reply from 192.168.34.3: bytes=56 Sequence=3 ttl=254 time=30 ms
Reply from 192.168.34.3: bytes=56 Sequence=4 ttl=254 time=30 ms
Reply from 192.168.34.3: bytes=56 Sequence=5 ttl=254 time=30 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=20 ms
Reply from 3.3.3.3: bytes=56 Sequence=2 ttl=254 time=30 ms
Reply from 3.3.3.3: bytes=56 Sequence=3 ttl=254 time=40 ms
Reply from 3.3.3.3: bytes=56 Sequence=4 ttl=254 time=30 ms
Reply from 3.3.3.3: bytes=56 Sequence=5 ttl=254 time=30 ms
查看路由表
R1
[R1]dis ip rout
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 13 Routes : 13
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
2.2.2.2/32 Static 60 0 RD 192.168.12.2 GigabitEthernet0/0/0
3.3.3.3/32 Static 60 0 RD 192.168.12.2 GigabitEthernet0/0/0
4.4.4.4/32 Static 60 0 RD 192.168.12.2 GigabitEthernet0/0/0
192.168.23.0/24 Static 60 0 RD 192.168.12.2 GigabitEthernet0/0/0
192.168.34.0/24 Static 60 0 RD 192.168.12.2 GigabitEthernet0/0/0
R2
[R2]dis ip rout
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 15 Routes : 15
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.1/32 Static 60 0 RD 192.168.23.1 GigabitEthernet0/0/1
2.2.2.2/32 Direct 0 0 D 127.0.0.1 LoopBack0
3.3.3.3/32 Static 60 0 RD 192.168.23.3 GigabitEthernet0/0/1
4.4.4.4/32 Static 60 0 RD 192.168.23.3 GigabitEthernet0/0/1
192.168.34.0/24 Static 60 0 RD 192.168.23.3 GigabitEthernet
R3
[R3]dis ip rout
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 15 Routes : 15
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.1/32 Static 60 0 RD 192.168.23.2 GigabitEthernet0/0/0
2.2.2.2/32 Static 60 0 RD 192.168.23.2 GigabitEthernet0/0/0
3.3.3.3/32 Direct 0 0 D 127.0.0.1 LoopBack0
4.4.4.4/32 Static 60 0 RD 192.168.34.4 GigabitEthernet0/0/1
192.168.12.0/24 Static 60 0 RD 192.168.23.2 GigabitEthernet0/0/0
R4
[R4]dis ip rout
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 13 Routes : 13
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.1/32 Static 60 0 RD 192.168.34.3 GigabitEthernet0/0/0
2.2.2.2/32 Static 60 0 RD 192.168.34.3 GigabitEthernet0/0/0
3.3.3.3/32 Static 60 0 RD 192.168.34.3 GigabitEthernet0/0/0
4.4.4.4/32 Direct 0 0 D 127.0.0.1 LoopBack0
192.168.12.0/24 Static 60 0 RD 192.168.34.3 GigabitEthernet0/0/0
192.168.23.0/24 Static 60 0 RD 192.168.34.3 GigabitEthernet0/0/0