HCNA-36 连接RIP与OSPF网络
配置A部门使用RIP路由协议,B部门使用OSPF路由协议; 保障PC1与PC2访问R1畅通。 <Huawei>system-view [Huawei]sysnamer2 [r2]interfaceGigabitEthernet 0/0/0 [r2-GigabitEthernet0/0/0]ipaddress 192.168.10.1 24 [r2-GigabitEthernet0/0/0]interfaceGigabitEthernet 0/0/1 [r2-GigabitEthernet0/0/1]ipaddress 172.16.12.2 24 [r2-GigabitEthernet0/0/1]ripauthentication-mode md5 usual cipher admin1234 [r2-GigabitEthernet0/0/1]quit [r2]displayip interface brief [r2]rip 1 [r2-rip-1]version2 [r2-rip-1]undosummary [r2-rip-1]network192.168.10.0 [r2-rip-1]network172.16.0.0 [r2-rip-1]return <r2>save The current configuration will be written tothe device. Are you sure to continue? (y/n)[n]:y <Huawei>system-view [Huawei]sysnamer1 [r1]interfaceGigabitEthernet 0/0/0 [r1-GigabitEthernet0/0/0]ipaddress 172.16.12.1 24 [r1-GigabitEthernet0/0/0]ripauthentication-mode md5 usual cipher admin1234 [r1-GigabitEthernet0/0/0]interfaceGigabitEthernet 0/0/1 [r1-GigabitEthernet0/0/1]ipaddress 172.16.13.1 24 [r1-GigabitEthernet0/0/1]quit [r1]rip1 [r1-rip-1]version2 [r1-rip-1]undosummary [r1-rip-1]network172.16.0.0 [r1-rip-1]quit [r1]ospf1 [r1-ospf-1]area0 [r1-ospf-1-area-0.0.0.0]authentication-modemd5 1 cipher admin1234 [r1-ospf-1-area-0.0.0.0]network172.16.13.0 0.0.0.255 [r1-ospf-1-area-0.0.0.0]return <r1>save The current configuration will be written tothe device. Are you sure to continue? (y/n)[n]:y <Huawei>system-view [Huawei]sysnamer3 [r3]interfaceGigabitEthernet 0/0/1 [r3-GigabitEthernet0/0/1]ipaddress 172.16.13.3 24 [r3-GigabitEthernet0/0/1]interfaceGigabitEthernet 0/0/0 [r3-GigabitEthernet0/0/0]ipaddress 192.168.30.1 24 [r3-GigabitEthernet0/0/0]quit [r3]ospf1 [r3-ospf-1]area0 [r3-ospf-1-area-0.0.0.0]authentication-modemd5 1 cipher admin1234 [r3-ospf-1-area-0.0.0.0]network172.16.13.0 0.0.0.255 [r3-ospf-1-area-0.0.0.0]network192.168.30.0 0.0.0.255 [r3-ospf-1-area-0.0.0.0]return <r3>save The current configuration will be written tothe device. Are you sure to continue? (y/n)[n]:y 查看R1路由表: <r1>displayip routing-table RouteFlags: R - relay, D - download to fib ------------------------------------------------------------------------------ RoutingTables: Public Destinations : 12 Routes : 12 Destination/Mask Proto Pre Cost Flags NextHop Interface …… 0/0/1 192.168.10.0/24 RIP 100 1 D 172.16.12.2 GigabitEthernet 0/0/0 192.168.30.0/24 OSPF 10 2 D 172.16.13.3 GigabitEthernet 0/0/1 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 结果R1同行运行RIP与OSPF,路由表中同时获取A部门与B部门的路由条目。 配置双向路由引入 [r1]rip1 [r1-rip-1]import-routeospf 1 cost 2 //引入OSPF路由手工配置跳数=2(默认不配置COST值=1,建议手工配置反应真实网络情况) [r1-rip-1]quit [r1]ospf1 [r1-ospf-1]import-routerip 1 //引入RIP路由 [r1-ospf-1]quit 查看R2与R3的路由表 <r2>displayip routing-table RouteFlags: R - relay, D - download to fib ------------------------------------------------------------------------------ RoutingTables: Public Destinations : 12 Routes : 12 Destination/Mask Proto Pre Cost Flags NextHop Interface …… 172.16.13.0/24 RIP 100 1 D 172.16.12.1 GigabitEthernet 0/0/1 …… 192.168.30.0/24 RIP 100 3 D 172.16.12.1 GigabitEthernet 0/0/1 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 刚才在引入OSPF路由时,COST值手工配置2 所以在路由表中2+1=3 <r3>displayip routing-table RouteFlags: R - relay, D - download to fib ------------------------------------------------------------------------------ RoutingTables: Public Destinations : 12 Routes : 12 Destination/Mask Proto Pre Cost Flags NextHop Interface …… 127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 172.16.12.0/24 O_ASE 150 1 D 172.16.13.1 GigabitEthernet 0/0/1 172.16.13.0/24 Direct 0 0 D 172.16.13.3 GigabitEthernet 0/0/1 …… 192.168.10.0/24 O_ASE 150 1 D 172.16.13.1 GigabitEthernet 0/0/1 …… 查看路由表,R2与R3分别获得对方路由协议中的路由条目。
|