HCNA-37 使用RIP、OSPF发布默认路由
当A与B公司需要实现网络互通,但又彼此又不想让对方知道自己家的路由信息,可以通过RIP,OSPF发布默认路由实现。 配置RIP与OSPF协议网络 <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 //配置RIP认证 [r2-GigabitEthernet0/0/1]quit [r2]rip1 [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 <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]quit [r1]interfaceGigabitEthernet 0/0/1 [r1-GigabitEthernet0/0/1]ipaddress 172.16.13.1 24 [r1-GigabitEthernet0/0/1]ospfauthentication-mode md5 1 cipher admin1234 //配置OSPF接口认证 [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]network172.16.13.0 0.0.0.255 [r1-ospf-1-area-0.0.0.0]return <Huawei>system-view [Huawei]sysnamer3 [r3]interfaceGigabitEthernet 0/0/1 [r3-GigabitEthernet0/0/1]ipaddress 172.16.13.3 24 [r3-GigabitEthernet0/0/1]ospfauthentication-mode md5 1 cipher admin1234 [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]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 <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 …… 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
配置RIP及OSPF发布默认路由 [r1]rip1 [r1-rip-1]default-routeoriginate [r1-rip-1]quit [r1]ospf1 [r1-ospf-1]default-route-advertisealways [r1-ospf-1]return <r3>displayip routing-table RouteFlags: R - relay, D - download to fib ------------------------------------------------------------------------------ RoutingTables: Public Destinations : 11 Routes : 11 Destination/Mask Proto Pre Cost Flags NextHop Interface 0.0.0.0/0 O_ASE 150 1 D 172.16.13.1 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 172.16.13.0/24 Direct 0 0 D 172.16.13.3 GigabitEthernet 0/0/1 172.16.13.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/1 172.16.13.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/1 192.168.30.0/24 Direct 0 0 D 192.168.30.1 GigabitEthernet 0/0/0 192.168.30.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/0 192.168.30.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/0 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 <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 0.0.0.0/0 RIP 100 1 D 172.16.12.1 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 172.16.12.0/24 Direct 0 0 D 172.16.12.2 GigabitEthernet 0/0/1 172.16.12.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/1 172.16.12.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/1 172.16.13.0/24 RIP 100 1 D 172.16.12.1 GigabitEthernet 0/0/1 192.168.10.0/24 Direct 0 0 D 192.168.10.1 GigabitEthernet 0/0/0 192.168.10.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/0 192.168.10.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/0 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 PC>ping192.168.30.100 Ping192.168.30.100: 32 data bytes, Press Ctrl_C to break From192.168.30.100: bytes=32 seq=1 ttl=125 time=79 ms From192.168.30.100: bytes=32 seq=2 ttl=125 time=63 ms From192.168.30.100: bytes=32 seq=3 ttl=125 time=78 ms From192.168.30.100: bytes=32 seq=4 ttl=125 time=62 ms From192.168.30.100: bytes=32 seq=5 ttl=125 time=63 ms ---192.168.30.100 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 62/69/79 ms |