('华为静态路由、浮动路由、默认路由配置以及华为路由协议优先级总结一、实验拓扑二、配置设备名称与IP地址R1:system-viewEntersystemview,returnuserviewwithCtrl+Z.[Huawei]sysnameR1[R1]interfaceg0/0/1[R1-GigabitEthernet0/0/1]ipaddress202.100.1.1255.255.255.0Quit[R1]interfaceg0/0/2[R1-GigabitEthernet0/0/2]ipadd202.100.2.1255.255.255.0quit[R1-GigabitEthernet0/0/1]intlo0=====创建环回接口[R1-LoopBack0]ipadd1.1.1.1255.255.255.255[R1-LoopBack0]quit[R1]displaycurrent-configurationinterface=====显示接口信息#interfaceGigabitEthernet0/0/0#interfaceGigabitEthernet0/0/1ipaddress202.100.1.1255.255.255.0#interfaceGigabitEthernet0/0/2ipaddress202.100.2.1255.255.255.0#interfaceNULL0#interfaceLoopBack0ipaddress1.1.1.1255.255.255.255R2:[R2]interfaceg0/0/1[R2-GigabitEthernet0/0/1]ipadd202.100.1.2255.255.255.0[R2-GigabitEthernet0/0/1]intg0/0/0[R2-GigabitEthernet0/0/0]ipadd202.100.3.2255.255.255.0[R2-GigabitEthernet0/0/0]intlo0[R2-LoopBack0]ipad2.2.2.2255.255.255.255[R2-LoopBack0]quitR3:[R3]intg0/0/2[R3-GigabitEthernet0/0/2]ipadd202.100.2.3255.255.255.0[R3-GigabitEthernet0/0/2]intg0/0/0[R3-GigabitEthernet0/0/0]ipadd202.100.3.3255.255.255.0[R3-GigabitEthernet0/0/0]intlo0[R3-LoopBack0]ipadd3.3.3.3255.255.255.255ping-c2202.100.1.2=====ping两个数据包PING202.100.1.2:56databytes,pressCTRL_CtobreakReplyfrom202.100.1.2:bytes=56Sequence=1ttl=255time=10msReplyfrom202.100.1.2:bytes=56Sequence=2ttl=255time=1msping-c2202.100.2.3PING202.100.2.3:56databytes,pressCTRL_CtobreakReplyfrom202.100.2.3:bytes=56Sequence=1ttl=255time=20msReplyfrom202.100.2.3:bytes=56Sequence=2ttl=255time=10ms---202.100.2.3pingstatistics---2packet(s)transmitted2packet(s)received0.00%packetlossround-tripmin/avg/max=10/15/20msdisplayiprouting-table====查看路由表RouteFlags:R-relay,D-downloadtofib------------------------------------------------------------------------------RoutingTables:PublicDestinations:11Routes:11Destination/MaskProtoPreCostFlagsNextHopInterface1.1.1.1/32Direct00D127.0.0.1LoopBack0127.0.0.0/8Direct00D127.0.0.1InLoopBack0127.0.0.1/32Direct00D127.0.0.1InLoopBack0127.255.255.255/32Direct00D127.0.0.1InLoopBack0202.100.1.0/24Direct00D202.100.1.1GigabitEthernet0三、配置静态路由[R1]iproute-static3.3.3.3255.255.255.255202.100.2.3===添加静态路由[R1]iproute-static202.100.3.0255.255.255.0202.100.2.3[R1]displayiprouting-table=====Static代表静态路由,60代表静态路由优先级RouteFlags:R-relay,D-downloadtofib------------------------------------------------------------------------------RoutingTables:PublicDestinations:13Routes:13Destination/MaskProtoPreCostFlagsNextHopInterface1.1.1.1/32Direct00D127.0.0.1LoopBack03.3.3.3/32Static600RD202.100.2.3GigabitEthernet0ping-c13.3.3.3PING3.3.3.3:56databytes,pressCTRL_CtobreakReplyfrom3.3.3.3:bytes=56Sequence=1ttl=255time=10msping-c1202.100.3.3PING202.100.3.3:56databytes,pressCTRL_CtobreakReplyfrom202.100.3.3:bytes=56Sequence=1ttl=255time=10ms四、配置浮动路由用于备份配置备份静态路由,当R1与R3之间链路出现故障时,可走R2。[R2]iproute-static3.3.3.3255.255.255.255202.100.3.3[R1]iproute-static202.100.3.024202.100.1.2preference80[R1]iproute-static3.3.3.332202.100.1.2preference80[R3]iproute-static202.100.1.0255.255.255.0202.100.3.2[R1]tracert202.100.3.3tracerouteto202.100.3.3(202.100.3.3),maxhops:30,packetlength:40,pressCTRL_Ctobreak1202.100.2.310ms10ms20ms[R1]tracert3.3.3.3tracerouteto3.3.3.3(3.3.3.3),maxhops:30,packetlength:40,pressCTRL_Ctobreak1202.100.2.320ms10ms20ms[R1]intg0/0/2[R1-GigabitEthernet0/0/2]shutdown[R1]displayiprouting-tableRouteFlags:R-relay,D-downloadtofib------------------------------------------------------------------------------RoutingTables:PublicDestinations:10Routes:103.3.3.3/32Static800RD202.100.1.2GigabitEthernet0/0/1202.100.3.0/24Static800RD202.100.1.2GigabitEthernet0/0/1[R1]tracert3.3.3.31202.100.1.220ms1ms10ms2202.100.3.320ms10ms20ms[R1]tracert202.100.3.31202.100.1.21ms10ms10ms2202.100.3.320ms20ms20ms[R1]interfaceg0/0/2[R1-GigabitEthernet0/0/2]undoshutdown(注:华为设备中no掉配置命令undo)此处敲restart也可以May12201422:58:05-05:13R1%%01IFPDT/4/IF_STATE(l)[6]:InterfaceGigabitEthernet0/0/2hasturnedintoUPstate[R2]iproute-static0.0.0.00.0.0.0202.100.3.3====添加默认路由[R2]ping202.100.2.1PING202.100.2.1:56databytes,pressCTRL_CtobreakReplyfrom202.100.2.1:bytes=56Sequence=1ttl=254time=10msReplyfrom202.100.2.1:bytes=56Sequence=5ttl=254time=30ms五、配置默认路由配置备份默认路由,当R2与R3之间链路出现故障时,可走R1。[R2]iproute-static0.0.0.00.0.0.0202.100.1.1preference80[R3]iproute-static0.0.0.00.0.0.0202.100.2.1preference80[R2]intg0/0/0[R2-GigabitEthernet0/0/0]shut[R2-GigabitEthernet0/0/0][R2]tracert202.100.2.3tracerouteto202.100.2.3(202.100.2.3),maxhops:30,packetlength:40,pressCTRL_Ctobreak1202.100.1.110ms10ms10ms2202.100.2.320ms20ms10ms六、了解华为不同路由协议的优先级',)