掌握目标一、配置设备名称与 IP 地址:二、配置静态路由三、配置浮动路由用于备份四、配置默认路由一、配置设备名称与 IP 地址: (ccieh3c.qzone.qq.com)R1:<Huawei>system-viewEnter system view, return user view with Ctrl+Z.[Huawei]sysname R1[R1]interface g0/0/1[R1-GigabitEthernet0/0/1]ip address 202.100.1.1 255.255.255.0quit[R1]interface g0/0/2[R1-GigabitEthernet0/0/2]ip add 202.100.2.1 255.255.255.0quit[R1-GigabitEthernet0/0/1]int lo 0 =====创建环回接口[R1-LoopBack0]ip add 1.1.1.1 255.255.255.255[R1-LoopBack0]quit[R1]display current-configuration interface =====显示接口信息#interface GigabitEthernet0/0/0#interface GigabitEthernet0/0/1ip address 202.100.1.1 255.255.255.0#interface GigabitEthernet0/0/2ip address 202.100.2.1 255.255.255.0#interface NULL0#interface LoopBack0ip address 1.1.1.1 255.255.255.255R2:[R2]interface g0/0/1[R2-GigabitEthernet0/0/1]ip add 202.100.1.2 255.255.255.0[R2-GigabitEthernet0/0/1]int g0/0/0[R2-GigabitEthernet0/0/0]ip add 202.100.3.2 255.255.255.0[R2-GigabitEthernet0/0/0]int lo 0[R2-LoopBack0]ip ad 2.2.2.2 255.255.255.255[R2-LoopBack0]quitR3:[R3]int g0/0/2[R3-GigabitEthernet0/0/2]ip add 202.100.2.3 255.255.255.0[R3-GigabitEthernet0/0/2]int g0/0/0[R3-GigabitEthernet0/0/0]ip add 202.100.3.3 255.255.255.0[R3-GigabitEthernet0/0/0]int lo 0[R3-LoopBack0]ip add 3.3.3.3 255.255.255.255<R1>ping -c 2 202.100.1.2 =====ping 两个数据包PING 202.100.1.2: 56 data bytes, press CTRL_C to breakReply from 202.100.1.2: bytes=56 Sequence=1 ttl=255 time=10 msReply from 202.100.1.2: bytes=56 Sequence=2 ttl=255 time=1 ms--- 202.100.1.2 ping statistics ---2 packet(s) transmitted2 packet(s) received0.00% packet lossround-trip min/avg/max = 1/5/10 ms<R1>ping -c 2 202.100.2.3PING 202.100.2.3: 56 data bytes, press CTRL_C to breakReply from 202.100.2.3: bytes=56 Sequence=1 ttl=255 time=20 msReply from 202.100.2.3: bytes=56 Sequence=2 ttl=255 time=10 ms--- 202.100.2.3 ping statistics ---2 packet(s) transmitted2 packet(s) received0.00% packet lossround-trip min/avg/max = 10/15/20 ms<R1>display ip routing-table ====查看路由表Route Flags: R - relay, D - download to fib------------------------------------------------------------------------------Routing Tables: PublicDestinations : 11 Routes : 11Destination/Mask Proto Pre Cost Flags NextHop Interface1.1.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0202.100.1.0/24 Direct 0 0 D 202.100.1.1 GigabitEthernet0二、配置静态路由[R1]ip route-Static 3.3.3.3 255.255.255.255 202.100.2.3 ===添加静态路由[R1]ip route-static 202.100.3.0 255.255.255.0 202.100.2.3[R1]display ip routing-table =====Static 代表静态路由,60 代表静态路由优先级Route Flags: R - relay, D - download to fib------------------------------------------------------------------------------Routing Tables: PublicDestinations : 13 Routes : 13Destination/Mask Proto Pre Cost Flags NextHop Interface1.1.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack03.3.3.3/32 Static 60 0 RD 202.100.2.3 GigabitEthernet0<R1>ping -c 1 3.3.3.3PING 3.3.3.3: 56 data bytes, press CTRL_C to breakReply from 3.3.3.3: bytes=56 Sequence=1 ttl=255 time=10 ms<R1>ping -c 1 202.100.3.3PING 202.100.3.3: 56 data bytes, press CTRL_C to breakReply from 202.100.3.3: bytes=56 Sequence=1 ttl=255 time=10 ms三、配置浮动路由用于备份 (ccieh3c.qzone.qq.com)配置备份静态路由,当 R1 与 R3 之间链路出现故障时,可走 R2。[R2]ip route-static 3.3.3.3 255.255.255.255 202.100.3.3[R1]ip route-static 202.100.3.0 24 202.100.1.2 preference 80[R1]ip route-static 3.3.3.3 32 202.100.1.2 preference 80[R3]ip route-static 202.100.1.0 255.255.255.0 202.100.3.2[R1]tracert 202.100.3.3traceroute to 202.100.3.3(202.100.3.3), max hops: 30 ,packet length: 40,press CTRL_C to break1 202.100.2.3 10 ms 10 ms 20 ms[R1]tracert 3.3.3.3traceroute to 3.3.3.3(3.3.3.3), max hops: 30 ,packet length: 40,press CTRL_C to break1 202.100.2.3 20 ms 10 ms 20 ms[R1]int g0/0/2[R1-GigabitEthernet0/0/2]shutdown[R1]display ip routing-tableRoute Flags: R - relay, D - download to fib------------------------------------------------------------------------------Routing Tables: PublicDestinations : 10 Routes : 103.3.3.3/32 Static 80 0 RD 202.100.1.2 GigabitEthernet0/0/1202.100.3.0/24 Static 80 0 RD 202.100.1.2 GigabitEthernet0/0/1[R1]tracert 3.3.3.31 202.100.1.2 20 ms 1 ms 10 ms2 202.100.3.3 20 ms 10 ms 20 ms[R1]tracert 202.100.3.31 202.100.1.2 1 ms 10 ms 10 ms2 202.100.3.3 20 ms 20 ms 20 ms[R1]interface g0/0/2[R1-GigabitEthernet0/0/2]undo shutdown (注:华为设备中 no 掉配置命令 undo) 此处敲 restart 也可以May 12 2014 22:58:05-05:13 R1 %%01IFPDT/4/IF_STATE(l)[6]:Interface GigabitEthernet0/0/2 has turned into UP state.[R2]ip route-static 0.0.0.0 0.0.0.0 202.100.3.3 ====添加默认路由[R2]ping 202.100.2.1PING 202.100.2.1: 56 data bytes, press CTRL_C to breakReply from 202.100.2.1: bytes=56 Sequence=1 ttl=254 time=10 msReply from 202.100.2.1: bytes=56 Sequence=5 ttl=254 time=30 ms四、配置默认路由 (ccieh3c.qzone.qq.com)配置备份默认路由,当 R2 与 R3 之间链路出现故障时,可走 R1。[R2]ip route-static 0.0.0.0 0.0.0.0 202.100.1.1 preference 80[R3]ip route-static 0.0.0.0 0.0.0.0 202.100.2.1 preference 80[R2]int g0/0/0[R2-GigabitEthernet0/0/0]shut[R2-GigabitEthernet0/0/0][R2]tracert 202.100.2.3traceroute to 202.100.2.3(202.100.2.3), max hops: 30 ,packet length: 40,press CTRL_C to break1 202.100.1.1 10 ms 10 ms 10 ms2 202.100.2.3 20 ms 20 ms 10 ms



还没有评论,来说两句吧...