HCNA-19 全网全通静态路由及默认路由配置
<Huawei>system-view [Huawei]sysnamer1 [r1]interfaceGigabitEthernet 0/0/2 [r1-GigabitEthernet0/0/2]ipaddress 172.16.10.1 24 [r1-GigabitEthernet0/0/2]quit [r1]interfaceGigabitEthernet 0/0/0 [r1-GigabitEthernet0/0/0]ipaddress 172.16.12.1 24 [r1-GigabitEthernet0/0/0]quit [r1]iproute-static 172.16.23.0 24 172.16.12.2 //配置静态路由目标网段+掩码+下一跳地址 [r1]iproute-static 172.16.30.0 24 172.16.12.2 [r1]displayip interface brief //查看IP接口摘要信息 <Huawei>system-view [Huawei]sysname [Huawei]sysnamer2 [r2]interfaceGigabitEthernet 0/0/0 [r2-GigabitEthernet0/0/0]ipaddress 172.16.12.2 24 [r2-GigabitEthernet0/0/0]quit [r2]interfaceGigabitEthernet 0/0/1 [r2-GigabitEthernet0/0/1]ipaddress 172.16.23.2 24 [r2-GigabitEthernet0/0/1]quit [r2]iproute-static 172.16.10.0 24 172.16.12.1 [r2]iproute-static 172.16.30.0 24 172.16.23.3 [r2]displayip interface brief <Huawei>system-view [Huawei]sysnamer3 [r3]interfaceGigabitEthernet 0/0/1 [r3-GigabitEthernet0/0/1]ipaddress 172.16.23.3 24 [r3-GigabitEthernet0/0/1]quit [r3]interfaceGigabitEthernet 0/0/2 [r3-GigabitEthernet0/0/2]ipaddress 172.16.30.1 24 [r3-GigabitEthernet0/0/2]quit [r3]displayip interface brief [r1]displayip routing-table //查看IP路由表 RouteFlags: R - relay, D - download to fib ------------------------------------------------------------------------------ RoutingTables: Public Destinations : 12 Routes : 12 Destination/Mask Proto Pre Cost Flags NextHop Interface …… 172.16.23.0/24 Static 60 0 RD 172.16.12.2 GigabitEthernet 0/0/0 172.16.30.0/24 Static 60 0 RD 172.16.12.2 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 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0 …… 172.16.10.0/24 Static 60 0 RD 172.16.12.1 GigabitEthernet …… 172.16.30.0/24 Static 60 0 RD 172.16.23.3 GigabitEthernet 0/0/1 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 [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.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0 …… 172.16.10.0/24 Static 60 0 RD 172.16.23.2 GigabitEthernet 0/0/1 172.16.12.0/24 Static 60 0 RD 172.16.23.2 GigabitEthernet 0/0/1 ….. 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 PC>ping172.16.30.100 //PC1Ping 测试PC2 Ping172.16.30.100: 32 data bytes, Press Ctrl_C to break Requesttimeout! Requesttimeout! From172.16.30.100: bytes=32 seq=3 ttl=125 time=16 ms From172.16.30.100: bytes=32 seq=4 ttl=125 time=31 ms From172.16.30.100: bytes=32 seq=5 ttl=125 time=16 ms ---172.16.30.100 ping statistics --- 5 packet(s) transmitted 3 packet(s) received 40.00% packet loss round-trip min/avg/max = 0/21/31 ms PC>tracert172.16.30.100 //路由追踪 tracerouteto 172.16.30.100, 8 hops max (ICMP),press Ctrl+C to stop 1 172.16.10.1 15 ms 16 ms 16 ms 2 172.16.12.2 15 ms 31 ms 16 ms 3 172.16.23.3 78 ms 16 ms 31 ms 4 172.16.30.100 31 ms 32 ms 15 ms 下面配置默认路由 [r1]undoip route-static 172.16.23.0 24 172.16.12.2 //取消原有静态路由 [r1]undoip route-static 172.16.30.0 24 172.16.12.2 [r1]iproute-static 0.0.0.0 0.0.0.0 172.16.12.2 //配置默认路由目标掩码是全0 PC>ping172.16.30.100 Ping172.16.30.100: 32 data bytes, Press Ctrl_C to break From172.16.30.100: bytes=32 seq=1 ttl=125 time=15 ms From172.16.30.100: bytes=32 seq=2 ttl=125 time=32 ms From172.16.30.100: bytes=32 seq=3 ttl=125 time=15 ms From172.16.30.100: bytes=32 seq=4 ttl=125 time=16 ms From172.16.30.100: bytes=32 seq=5 ttl=125 time=15 ms ---172.16.30.100 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 15/18/32 ms 再配置R3默认路由 [r3]undoip route-static 172.16.12.0 24 172.16.23.2 [r3]undoip route-static 172.16.10.0 24 172.16.23.2 [r3]iproute-static 0.0.0.0 0.0.0.0 172.16.23.2 PC>ping172.16.10.100 Ping172.16.10.100: 32 data bytes, Press Ctrl_C to break From 172.16.10.100:bytes=32 seq=1 ttl=125 time=16 ms From172.16.10.100: bytes=32 seq=2 ttl=125 time=31 ms From172.16.10.100: bytes=32 seq=3 ttl=125 time=16 ms From172.16.10.100: bytes=32 seq=4 ttl=125 time=31 ms From172.16.10.100: bytes=32 seq=5 ttl=125 time=16 ms ---172.16.10.100 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 16/22/31 ms
|