静态路由配置实验一

网络拓扑如下

image.png

实现上述5个网段互通后的路由表配置如下,

RT1路由表

[RT1]dis ip routing-table

Destinations : 20       Routes : 20

Destination/Mask   Proto   Pre Cost        NextHop         Interface

0.0.0.0/32         Direct  0   0           127.0.0.1       InLoop0

10.1.1.0/24        Direct  0   0           10.1.1.1        Loop0

10.1.1.0/32        Direct  0   0           10.1.1.1        Loop0

10.1.1.1/32        Direct  0   0           127.0.0.1       InLoop0

10.1.1.255/32      Direct  0   0           10.1.1.1        Loop0

10.1.2.0/24        Direct  0   0           10.1.2.1        Ser1/0

10.1.2.0/32        Direct  0   0           10.1.2.1        Ser1/0

10.1.2.1/32        Direct  0   0           127.0.0.1       InLoop0

10.1.2.2/32        Direct  0   0           10.1.2.2        Ser1/0

10.1.2.255/32      Direct  0   0           10.1.2.1        Ser1/0

10.1.3.0/24        Static  60  0           10.1.2.2        Ser1/0

10.1.4.0/24        Static  60  0           10.1.2.2        Ser1/0

10.1.5.0/24        Static  60  0           10.1.2.2        Ser1/0

127.0.0.0/8        Direct  0   0           127.0.0.1       InLoop0

127.0.0.0/32       Direct  0   0           127.0.0.1       InLoop0

127.0.0.1/32       Direct  0   0           127.0.0.1       InLoop0

127.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0

224.0.0.0/4        Direct  0   0           0.0.0.0         NULL0

224.0.0.0/24       Direct  0   0           0.0.0.0         NULL0

255.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0

RT2路由表

[RT2]dis ip routing-table

Destinations : 21       Routes : 21

Destination/Mask   Proto   Pre Cost        NextHop         Interface

0.0.0.0/32         Direct  0   0           127.0.0.1       InLoop0

10.1.1.0/24        Static  60  0           10.1.2.1        Ser2/0

10.1.2.0/24        Direct  0   0           10.1.2.2        Ser2/0

10.1.2.0/32        Direct  0   0           10.1.2.2        Ser2/0

10.1.2.1/32        Direct  0   0           10.1.2.1        Ser2/0

10.1.2.2/32        Direct  0   0           127.0.0.1       InLoop0

10.1.2.255/32      Direct  0   0           10.1.2.2        Ser2/0

10.1.3.0/24        Direct  0   0           10.1.3.1        Ser1/0

10.1.3.0/32        Direct  0   0           10.1.3.1        Ser1/0

10.1.3.1/32        Direct  0   0           127.0.0.1       InLoop0

10.1.3.2/32        Direct  0   0           10.1.3.2        Ser1/0

10.1.3.255/32      Direct  0   0           10.1.3.1        Ser1/0

10.1.4.0/24        Static  60  0           10.1.3.2        Ser1/0

10.1.5.0/24        Static  60  0           10.1.3.2        Ser1/0

127.0.0.0/8        Direct  0   0           127.0.0.1       InLoop0

127.0.0.0/32       Direct  0   0           127.0.0.1       InLoop0

127.0.0.1/32       Direct  0   0           127.0.0.1       InLoop0

127.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0

224.0.0.0/4        Direct  0   0           0.0.0.0         NULL0

224.0.0.0/24       Direct  0   0           0.0.0.0         NULL0

255.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0

RT3路由表

[RT3]dis ip routing-table

Destinations : 21       Routes : 21

Destination/Mask   Proto   Pre Cost        NextHop         Interface

0.0.0.0/32         Direct  0   0           127.0.0.1       InLoop0

10.1.1.0/24        Static  60  0           10.1.3.1        Ser2/0

10.1.2.0/24        Static  60  0           10.1.3.1        Ser2/0

10.1.3.0/24        Direct  0   0           10.1.3.2        Ser2/0

10.1.3.0/32        Direct  0   0           10.1.3.2        Ser2/0

10.1.3.1/32        Direct  0   0           10.1.3.1        Ser2/0

10.1.3.2/32        Direct  0   0           127.0.0.1       InLoop0

10.1.3.255/32      Direct  0   0           10.1.3.2        Ser2/0

10.1.4.0/24        Direct  0   0           10.1.4.1        Ser1/0

10.1.4.0/32        Direct  0   0           10.1.4.1        Ser1/0

10.1.4.1/32        Direct  0   0           127.0.0.1       InLoop0

10.1.4.2/32        Direct  0   0           10.1.4.2        Ser1/0

10.1.4.255/32      Direct  0   0           10.1.4.1        Ser1/0

10.1.5.0/24        Static  60  0           10.1.4.2        Ser1/0

127.0.0.0/8        Direct  0   0           127.0.0.1       InLoop0

127.0.0.0/32       Direct  0   0           127.0.0.1       InLoop0

127.0.0.1/32       Direct  0   0           127.0.0.1       InLoop0

127.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0

224.0.0.0/4        Direct  0   0           0.0.0.0         NULL0

224.0.0.0/24       Direct  0   0           0.0.0.0         NULL0

255.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0

RT4路由表

[RT4]dis ip routing-table

Destinations : 20       Routes : 20

Destination/Mask   Proto   Pre Cost        NextHop         Interface

0.0.0.0/32         Direct  0   0           127.0.0.1       InLoop0

10.1.1.0/24        Static  60  0           10.1.4.1        Ser2/0

10.1.2.0/24        Static  60  0           10.1.4.1        Ser2/0

10.1.3.0/24        Static  60  0           10.1.4.1        Ser2/0

10.1.4.0/24        Direct  0   0           10.1.4.2        Ser2/0

10.1.4.0/32        Direct  0   0           10.1.4.2        Ser2/0

10.1.4.1/32        Direct  0   0           10.1.4.1        Ser2/0

10.1.4.2/32        Direct  0   0           127.0.0.1       InLoop0

10.1.4.255/32      Direct  0   0           10.1.4.2        Ser2/0

10.1.5.0/24        Direct  0   0           10.1.5.1        Loop0

10.1.5.0/32        Direct  0   0           10.1.5.1        Loop0

10.1.5.1/32        Direct  0   0           127.0.0.1       InLoop0

10.1.5.255/32      Direct  0   0           10.1.5.1        Loop0

127.0.0.0/8        Direct  0   0           127.0.0.1       InLoop0

127.0.0.0/32       Direct  0   0           127.0.0.1       InLoop0

127.0.0.1/32       Direct  0   0           127.0.0.1       InLoop0

127.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0

224.0.0.0/4        Direct  0   0           0.0.0.0         NULL0

224.0.0.0/24       Direct  0   0           0.0.0.0         NULL0

255.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0

路由递归寻址:

RT1的路由条目:

10.1.3.0/24        Static  60  0           10.1.2.2        Ser1/0

10.1.4.0/24        Static  60  0           10.1.2.2        Ser1/0

10.1.5.0/24        Static  60  0           10.1.2.2        Ser1/0

上面路由条目的作用与下面路由条目作用相同,在静态路由只配置下一跳IP地址的情况下,下面路由条目在转发时需要进行递归寻址,转发效率低于上面的路由条目。

10.1.3.0/24        Static  60  0           10.1.2.2        Ser1/0

10.1.4.0/24        Static  60  0           10.1.3.2        Ser1/0

10.1.5.0/24        Static  60  0           10.1.4.2        Ser1/0

路由规则

路由器默认情况下只知道直连的路由信息。

路由器对数据进行精确匹配,即优先匹配子网掩码位数长的路由条目。

缺省路由:   

ip route-static  0.0.0.0  0.0.0.0  10.1.99.254    //所有数据均发给网关10.1.99.254

操作:

H3C:ip route-static 与display ip routing-table

Huawei:conf t 全局配置模式

              Ip route  与show ip route


猜你喜欢

转载自blog.51cto.com/14009115/2404598