HCNA-28 RIP的路由引入
先是接口地址配置: <Huawei>system-view [Huawei]sysnamer4 [r4]interfaceGigabitEthernet 0/0/0 [r4-GigabitEthernet0/0/0]ipaddress 192.168.30.1 24 [r4-GigabitEthernet0/0/0]interfaceGigabitEthernet 0/0/1 [r4-GigabitEthernet0/0/1]ipaddress 172.17.14.4 24 [r4-GigabitEthernet0/0/1]quit [r4]displayip interface brief <Huawei>system-view [Huawei]sysnamer1 [r1]interfaceGigabitEthernet 0/0/0 [r1-GigabitEthernet0/0/0]ipaddress 172.17.14.1 24 [r1-GigabitEthernet0/0/0]interface GigabitEthernet 0/0/1 [r1-GigabitEthernet0/0/1]ipaddress 172.16.12.1 24 [r1-GigabitEthernet0/0/1]interfaceGigabitEthernet 0/0/2 [r1-GigabitEthernet0/0/2]ipaddress 172.16.13.1 24 [r1-GigabitEthernet0/0/2]quit [r1]displayip interface brief <Huawei>system-view [Huawei]sysnamer2 [r2]interfaceGigabitEthernet 0/0/0 [r2-GigabitEthernet0/0/0]ipaddress 172.16.12.2 24 [r2-GigabitEthernet0/0/0]interfaceGigabitEthernet 0/0/1 [r2-GigabitEthernet0/0/1]ipaddress 192.168.20.1 24 [r2-GigabitEthernet0/0/1]quit [r2]displayip interface brief <Huawei>system-view [Huawei]sysnamer3 [r3]interfaceGigabitEthernet 0/0/0 [r3-GigabitEthernet0/0/0]ipaddress 172.16.13.3 24 [r3-GigabitEthernet0/0/0]interfaceGigabitEthernet 0/0/1 [r3-GigabitEthernet0/0/1]ipaddress 192.168.30.1 24 [r3-GigabitEthernet0/0/1]quit [r3]displayip interface brief 然后搭建B公司RIP网络 [r1]rip1 [r1-rip-1]undosummary [r1-rip-1]version 2 [r1-rip-1]network172.16.0.0 [r1-rip-1]quit [r2]rip1 [r2-rip-1]undosummary [r2-rip-1]version2 [r2-rip-1]network172.16.0.0 [r2-rip-1]network 192.168.20.0 [r2-rip-1]quit [r3]rip1 [r3-rip-1]undosummary [r3-rip-1]version2 [r3-rip-1]network172.16.0.0 [r3-rip-1]network 192.168.30.0 [r3-rip-1]quit 对R2GE 0/0/1接口抓包 此时财务部PC会收到对自己没有任何用处的RIPv2报文,因为只要使用network命令通告财务部所在网段后,R2的GE0/0/0就会收发RIP协议报文,不管对端口设备是否利用。 为了让财务PC不接收这些无用RIP更新报文,可以在R2的RIP进程中不使用network命令通告网段,而采用引入直连路由的方式来代替,把财务的网段当成外部路由发布到公司RIP网络中。 [r2]rip1 [r2-rip-1]undonetwork 192.168.20.0 //先取消宣告参与网段 [r2-rip-1]import-routedirect //引入直连路由 查看R1的路由表 <r1>display ip routing-table RouteFlags: R - relay, D - download to fib ------------------------------------------------------------------------------ RoutingTables: Public Destinations : 15 Routes : 15 Destination/Mask Proto Pre Cost Flags NextHop Interface …… 192.168.20.0/24 RIP 100 1 D 172.16.12.2 GigabitEthernet 0/0/1 192.168.30.0/24 RIP 100 1 D 172.16.13.3 GigabitEthernet …… 配置引入路由后,R1的路由表同样学习到了192.168.20.0网段。 此时再回到R2的GE 0/0/1接口上抓包,看看会不会再有RIP的更新报文。 没有再出现RIPv2的更新报文了。 如果需要研发部也与财务一样,相同的操作方法即可。 最后再让A公司与B公司网络互通: R1做静态路由连接R4,然后R4配置默认路由访问R1 [r1]iproute-static192.168.40.0 24 172.17.14.4 //配置静态路由 下一跳地址 [r4]iproute-static0.0.0.0 0.0.0.0 172.17.14.1 //配置默认路由 下面使用PC1Ping PC3 Ping192.168.40.100: 32 data bytes, Press Ctrl_C to break Requesttimeout! Requesttimeout! Requesttimeout! Requesttimeout! Requesttimeout! ---192.168.40.100 ping statistics --- 5 packet(s) transmitted 0 packet(s) received 100.00% packet loss 重要的事情来了,此时A与B之间的网络仍然不可互通,这是因为B边的RIP网络无法识别A的外界非RIP协议网络,需要配置路由引入后才可互通!! 下面在R1上做路由引入 [r1-rip-1]import-routestatic //配置引入静态路由 此时再使用PC1Ping PC3 PC>ping192.168.40.100 Ping192.168.40.100: 32 data bytes, Press Ctrl_C to break Requesttimeout! From192.168.40.100: bytes=32 seq=2 ttl=125 time=78 ms From192.168.40.100: bytes=32 seq=3 ttl=125 time=79 ms From192.168.40.100: bytes=32 seq=4 ttl=125 time=78 ms From192.168.40.100: bytes=32 seq=5 ttl=125 time=78 ms ---192.168.40.100 ping statistics --- 5 packet(s) transmitted 4 packet(s) received 20.00% packet loss round-trip min/avg/max = 0/78/79 ms 完成通信工作。 |