1、专题6 静态路由与默认路由进阶配置场景场景你是你们公司的网络工程师,现在公司有一个总部和两个分支机构。其中R1为总部路由器,总部有一个网段,R2、R3为分支机构。R1通过串行线缆与分支机构相连,分支结构之间也通过串行线缆实现互联。因为网络规模较小,所以采用静态路由和默认路由的方式实现网络互通。IP地址编址信息如拓扑图。拓扑结构图10.0.23.1/2410.0.23.2/2410.0.2.2/2410.0.2.1/2410.0.12.2/2410.0.12.1/2410.0.1.1/2410.0.1.2/2410.0.13.1/24 10.0.13.2/2410.0.3.2/2410.0.3.
2、1/24每个接口(绿色小点)的IP地址标注在其旁边设置主机IP和网关主机的网关是其所连接的路由器端口的IP,如client0 连接路由器R1的E0/0/0端口(10.0.1.1),因此client0的网关是10.0.1.1,设置如下1.R1的基础配置与IP编址undo ter monsystem-viewHuaweisysname R1R1int s0/0/1R1-Serial0/0/1ip address 10.0.13.1 24R1-Serial0/0/1undo shutR1-Serial0/0/1int s0/0/0R1-Serial0/0/0ip address 10.0.12.1
3、24R1-Serial0/0/0undo shutR1-Serial0/0/0int e0/0/0R1-Ethernet0/0/0ip address 10.0.1.1 24R1-Ethernet0/0/0undo shutR1-Ethernet0/0/0quit2.R2的基础配置与IP编址undo ter monsystem-viewHuaweisysname R2R2int s0/0/1R2-Serial0/0/1ip address 10.0.12.2 24R2-Serial0/0/1undo shutR2-Serial0/0/1int s0/0/0R2-Serial0/0/0ip ad
4、dress 10.0.23.1 24R2-Serial0/0/0undo shutR2-Serial0/0/0int e0/0/0R2-Ethernet0/0/0ip address 10.0.2.1 24R2-Ethernet0/0/0undo shutR2-Ethernet0/0/0quit3.R3的基础配置与IP编址undo ter monsystem-viewHuaweisysname R3R3int s0/0/0R3-Serial0/0/0ip address 10.0.23.2 24R3-Serial0/0/0undo shutR3-Serial0/0/0interface s0/
5、0/1R3-Serial0/0/1ip addr 10.0.13.2 24R3-Serial0/0/1undo shutR3-Serial0/0/1int e0/0/0R3-Ethernet0/0/0ip addr 10.0.3.1 24R3-Ethernet0/0/0undo shutR3-Ethernet0/0/0quit4.测试直连网络连通性在R1上ping 10.0.12.2 通ping 10.0.12.2 Reply from 10.0.12.2:bytes=56 Sequence=1 ttl=255 time=1 ms在R1上ping 10.0.13.2 通ping 10.0.13
6、.2 Reply from 10.0.13.2:bytes=56 Sequence=1 ttl=255 time=1 ms在R2上ping 10.0.12.1 通ping 10.0.12.1Reply from 10.0.12.1:bytes=56 Sequence=1 ttl=255 time=20 ms在R2上ping 10.0.23.2 通ping 10.0.23.2Reply from 10.0.23.2:bytes=56 Sequence=1 ttl=255 time=60 ms在R3上ping 10.0.23.1 通ping 10.0.23.1Reply from 10.0.23.
7、1:bytes=56 Sequence=1 ttl=255 time=1 ms在R2上ping 10.0.13.1 通ping 10.0.13.1Reply from 10.0.23.2:bytes=56 Sequence=1 ttl=255 time=10 ms5 测试非直连网络的连通性测试非直连网络的连通性测试测试R2到目的网络到目的网络10.0.13.0/24、10.0.3.0/24的的连通性连通性ping 10.0.13.2 Request time out 不通ping 10.0.3.2 Request time out 不通此时R2如果要与网络10.0.3.0网段通讯,则需要R2上
8、有去往该网段的路由信息,并且R3上也需要有回到R2接口IP网段的路由信息。以上测试结果显示R2无法与地址10.0.3.2和10.0.13.2地址通讯。6 查看路由表 display ip routing-table Route Flags:R-relay,D-download to fib-Routing Tables:Public Destinations:10 Routes:10 Destination/Mask Proto Pre Cost Flags NextHop Interface 10.0.2.0/24 Direct 0 0 D 10.0.2.1 Ethernet0/0/0 10
9、.0.2.1/32 Direct 0 0 D 127.0.0.1 Ethernet0/0/0 10.0.12.0/24 Direct 0 0 D 10.0.12.2 Serial0/0/1 10.0.12.1/32 Direct 0 0 D 10.0.12.1 Serial0/0/1 10.0.12.2/32 Direct 0 0 D 127.0.0.1 Serial0/0/1 10.0.23.0/24 Direct 0 0 D 10.0.23.1 Serial0/0/0 10.0.23.1/32 Direct 0 0 D 127.0.0.1 Serial0/0/0 10.0.23.2/32
10、Direct 0 0 D 10.0.23.2 Serial0/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发现R2的路由表里面没有去往10.0.1.0、10.0.3.0、10.0.13.0等网络的路由信息同理,你也可以发现在R1的路由表里面没有去往10.0.3.0、10.0.23.0、10.0.2.0等网络的路由信息同理,你也可以发现在R3的路由表里面没有去往10.0.1.0、10.0.12.0、10.0.2.0等网络的路由信息需要添加到这些网
11、络的路由项目。7.规划路由目的网络目的网络子网掩码子网掩码下一跳下一跳10.0.3.0255.255.255.010.0.13.210.0.23.0255.255.255.010.0.12.210.0.2.0255.255.255.010.0.12.2R1的路由表目的网络目的网络子网掩码子网掩码下一跳下一跳10.0.1.0255.255.255.010.0.12.110.0.13.0255.255.255.010.0.23.210.0.3.0255.255.255.010.0.23.2R2的路由表目的网络目的网络子网掩码子网掩码下一跳下一跳10.0.1.0255.255.255.010.0.1
12、3.110.0.12.0255.255.255.010.0.23.110.0.2.0255.255.255.010.0.23.1R3的路由表8.根据规划在根据规划在R1 R2 R3上上配置静态路由配置静态路由 R1上增加三条 R1ip route-static 10.0.3.0 24 10.0.13.2R1ip route-static 10.0.23.0 24 10.0.12.2R1ip route-static 10.0.2.0 24 10.0.12.2R2上增加三条 R2ip route-static 10.0.3.0 24 10.0.23.2R2ip route-static 10.0
13、.13.0 24 10.0.23.2R2ip route-static 10.0.1.0 24 10.0.12.1R3上增加三条 R3ip route-static 10.0.1.0 24 10.0.13.1R3ip route-static 10.0.12.0 24 10.0.23.1R3ip route-static 10.0.2.0 24 10.0.23.19.查看路由表并测试连通性R1dis ip routing-tableRoute Flags:R-relay,D-download to fib-Routing Tables:Public Destinations:13 Routes
14、:13 Destination/Mask Proto Pre Cost Flags NextHop Interface 10.0.1.0/24 Direct 0 0 D 10.0.1.1 Ethernet0/0/0 10.0.1.1/32 Direct 0 0 D 127.0.0.1 Ethernet0/0/0 10.0.2.0/24 Static 60 0 RD 10.0.12.2 Serial0/0/0 10.0.3.0/24 Static 60 0 RD 10.0.13.2 Serial0/0/1 10.0.12.0/24 Direct 0 0 D 10.0.12.1 Serial0/0
15、/0 10.0.12.1/32 Direct 0 0 D 127.0.0.1 Serial0/0/0 10.0.12.2/32 Direct 0 0 D 10.0.12.2 Serial0/0/0 10.0.13.0/24 Direct 0 0 D 10.0.13.1 Serial0/0/1 10.0.13.1/32 Direct 0 0 D 127.0.0.1 Serial0/0/1 10.0.13.2/32 Direct 0 0 D 10.0.13.2 Serial0/0/1 10.0.23.0/24 Static 60 0 RD 10.0.12.2 Serial0/0/0 127.0.0
16、.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在任意主机、路由器上互相ping都可以通过PCping 10.0.3.2Ping 10.0.3.2:32 data bytes,Press Ctrl_C to breakFrom 10.0.3.2:bytes=32 seq=3 ttl=126 time=47 msFrom 10.0.3.2:bytes=32 seq=4 ttl=126 time=46 msFrom 10.0.3.2:bytes=32 seq=5 ttl=1
17、26 time=16 msPCping 10.0.2.2Ping 10.0.2.2:32 data bytes,Press Ctrl_C to breakFrom 10.0.2.2:bytes=32 seq=1 ttl=126 time=109 msFrom 10.0.2.2:bytes=32 seq=2 ttl=126 time=46 ms10 默认(缺省)路由观察R1的路由表10.0.2.0/24 Static 60 0 RD 10.0.12.2 Serial0/0/010.0.23.0/24 Static 60 0 RD 10.0.12.2 Serial0/0/0发现到达10.0.2.0
18、和10.0.23.0这两个目的网络的路由具有相同的下一跳10.0.12.2可以合并为一条缺省路由ip route-static 0.0.0.0 0.0.0.0 10.0.12.2 首先需要把这两条路由删掉R1undo ip route-static 10.0.2.0 24 10.0.12.2R1undo ip route-static 10.0.23.0 24 10.0.12.2查看路由表发现已经没有了这两条R1dis ip routRoute Flags:R-relay,D-download to fib-Routing Tables:Public Destinations:11 Route
19、s:11 Destination/Mask Proto Pre Cost Flags NextHop Interface 10.0.1.0/24 Direct 0 0 D 10.0.1.1 Ethernet0/0/0 10.0.1.1/32 Direct 0 0 D 127.0.0.1 Ethernet0/0/0 10.0.3.0/24 Static 60 0 RD 10.0.13.2 Serial0/0/1 10.0.12.0/24 Direct 0 0 D 10.0.12.1 Serial0/0/0 10.0.12.1/32 Direct 0 0 D 127.0.0.1 Serial0/0
20、/0 10.0.12.2/32 Direct 0 0 D 10.0.12.2 Serial0/0/0 10.0.13.0/24 Direct 0 0 D 10.0.13.1 Serial0/0/1 10.0.13.1/32 Direct 0 0 D 127.0.0.1 Serial0/0/1 10.0.13.2/32 Direct 0 0 D 10.0.13.2 Serial0/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此时已经ping不通这
21、些地址了R1ping 10.0.2.2 PING 10.0.2.2:56 data bytes,press CTRL_C to break Request time out Request time out Request time out Request time out Request time out -10.0.2.2 ping statistics-5 packet(s)transmitted 0 packet(s)received 100.00%packet loss增加上默认路由后重新可以通了R1ip route-static 0.0.0.0 0.0.0.0 10.0.12.2R1ping 10.0.2.2 PING 10.0.2.2:56 data bytes,press CTRL_C to breakReply from 10.0.2.2:bytes=56 Sequence=2 ttl=127 time=780 msReply from 10.0.2.2:bytes=56 Sequence=3 ttl=127 time=60 ms
侵权处理QQ:3464097650--上传资料QQ:3464097650
【声明】本站为“文档C2C交易模式”,即用户上传的文档直接卖给(下载)用户,本站只是网络空间服务平台,本站所有原创文档下载所得归上传人所有,如您发现上传作品侵犯了您的版权,请立刻联系我们并提供证据,我们将在3个工作日内予以改正。