拓扑
第一步:上IP地址(略)
[R1]dis ip int b
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 10.0.13.1/24 up up
GigabitEthernet0/0/1 10.0.12.1/24 up up
[R2]dis ip int b
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 10.0.12.2/24 up up
GigabitEthernet0/0/1 10.1.12.2/24 up up
GigabitEthernet0/0/2 10.2.12.2/24 up up
NULL0 unassigned up up(s)
第二步:配置静态IP全网通
静态IP的宣告要有来又回
格式:ip route-static 想去的网段 网络掩码 下一跳路由器对端IP
[R2]ip route-static 10.0.13.0 24 10.0.12.1
[R1]ip route-static 10.1.12.0 24 10.0.12.2
[R1]ip route-static 10.2.12.0 24 10.0.12.2
查看:dis IP routeing-table
[R2]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 14 Routes : 14
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.12.0/24 Direct 0 0 D 10.0.12.2 GigabitEthernet
0/0/0
10.0.12.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
10.0.12.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
10.0.13.0/24 Static 60 0 RD 10.0.12.1 GigabitEthernet
0/0/0
10.1.12.0/24 Direct 0 0 D 10.1.12.2 GigabitEthernet
0/0/1
10.1.12.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
10.1.12.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
10.2.12.0/24 Direct 0 0 D 10.2.12.2 GigabitEthernet
0/0/2
10.2.12.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
10.2.12.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
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
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
[R1]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 12 Routes : 12
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.12.0/24 Direct 0 0 D 10.0.12.1 GigabitEthernet
0/0/1
10.0.12.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
10.0.12.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
10.0.13.0/24 Direct 0 0 D 10.0.13.1 GigabitEthernet
0/0/0
10.0.13.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
10.0.13.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
10.1.12.0/24 Static 60 0 RD 10.0.12.2 GigabitEthernet
0/0/1
10.2.12.0/24 Static 60 0 RD 10.0.12.2 GigabitEthernet
0/0/1
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
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
接下来可以测试网络连通性。