H3C路由学习笔记静态路由.docx
《H3C路由学习笔记静态路由.docx》由会员分享,可在线阅读,更多相关《H3C路由学习笔记静态路由.docx(18页珍藏版)》请在冰豆网上搜索。
H3C路由学习笔记静态路由
H3C路由(MSR26-30)
1、进入系统视图
Startupconfigurationfiledoesnotexist.
Performingautomaticconfiguration...PressCTRL_Dtobreak.
------------------------按Ctrl+D键终止设备查找自动配置
Automaticconfigurationattempt:
1.
Notreadyforautomaticconfiguration:
nointerfaceavailable.
Waitingforthenext...
Automaticconfigurationisaborted.-------按Ctrl+D键后放弃自动配置的尝试
Lineaux0isavailable.
PressENTERtogetstarted.---------------到这里系统启动完毕,按回车键
%Aug2209:
19:
53:
3182014H3CSHELL/5/SHELL_LOGIN:
TTYloggedinfromaux0.
--------------再按一次回车键
system-view
[H3C]
2、修改路由器名称
sys
[H3C]sysname名称
如将默认的路由器名称改为RoNetwork_Dept,Ro表示设备类型为路由器,Network_Dept表示部门名称,以后看到这个名称就知道这是什么设备、在什么位置。
建议以后都采用这种方式来给设备命名,以方便管理。
[H3C]sysnameRoNetwork_Dept
[RoNetwork_Dept]
如果要恢复默认名称,使用undosysname命令:
[RoNetwork_Dept]undosysname
[H3C]
3、显示路由表
(1)IPv4
显示路由表概要信息:
[RoNetwork_Dept]displayiprouting-table
显示路由表详细信息:
[RoNetwork_Dept]displayiprouting-tableverbose
显示某种路由协议的信息:
[RoNetwork_Dept]displayiprouting-tableprotocol{bgp|direct|guard|isis|ospf|rip|static}
还有其他信息,可使用?
显示帮助以便选择:
[RoNetwork_Dept]displayiprouting-table?
(2)IPv6
只需将IPv4的命令中ip替换成ipv6即可。
4、配置接口
sys
system-view
[H3C]int接口名称
如配置G0/0接口:
[RoNetwork_Dept]intg0/0
[RoNetwork_Dept-GigabitEthernet0/0]---------进入接口配置视图
配置IP地址:
[RoNetwork_Dept-GigabitEthernet0/0]ipadd?
-----后面跟掩码长度也行,跟掩码也行
INTEGER<1-31>IPmasklength
IPmask
[RoNetwork_Dept-GigabitEthernet0/0]ipadd24----24表示掩码长度为24位,和
[RoNetwork_Dept-GigabitEthernet0/0]undoshutdown-----激活接口
[RoNetwork_Dept-GigabitEthernet0/0]disintg0/0-----查看接口信息
5、信息回显及tracert
为了防止命令被系统输出的消息打断,可以配置信息回显:
[RoNetwork_Dept]info-centersynchronous
为防止tracert超时,链路两端的设备都要开启以下功能:
[RoNetwork_Dept]ipredirectsenable开启设备的ICMP重定向报文的发送功能
[RoNetwork_Dept]ipttl-expiresenable 开启设备的ICMP超时报文的发送功能
[RoNetwork_Dept]ipunreachableenable开启设备的ICMP目的不可达报文的发送功能
6、配置静态路由
拓扑图:
RoNetwork_Dept端:
sys
SystemView:
returntoUserViewwithCtrl+Z.
[H3C]sysRoNetwork_Dept
[RoNetwork_Dept]infosync
Info-centersynchronousoutputison.
[RoNetwork_Dept]intlo0
[RoNetwork_Dept-LoopBack0]ipadd24
[RoNetwork_Dept-LoopBack0]intg0/0
[RoNetwork_Dept-GigabitEthernet0/0]ipadd24
[RoNetwork_Dept-GigabitEthernet0/0]undosh
[RoNetwork_Dept-GigabitEthernet0/0]iproute
[RoNetwork_Dept]%Aug2211:
45:
32:
4152014RoNetwork_DeptIFNET/3/PHY_UPDOWN:
PhysicalstateontheinterfaceGigabitEthernet0/0changedtoup.
%Aug2211:
45:
32:
4162014RoNetwork_DeptIFNET/5/LINK_UPDOWN:
LineprotocolstateontheinterfaceGigabitEthernet0/0changedtoup.-------系统发出的消息,g0/0接口已经up了
[RoNetwork_Dept]disipro
Destinations:
17Routes:
17
Destination/MaskProtoPreCostNextHopInterface
Direct00InLoop0
Direct00GE0/0
Direct00GE0/0
Direct00InLoop0
Direct00GE0/0
Direct00InLoop0
Direct00InLoop0
Direct00InLoop0
Direct00InLoop0
Direct00Loop0
Direct00Loop0
Direct00InLoop0
Direct00Loop0
Static600GE0/0
Direct00NULL0
Direct00NULL0
Direct00InLoop0
[RoNetwork_Dept]ping---------使用ping命令测试路由是否配置正确
Ping(56databytes,pressCTRL_Ctobreak
56bytesfromicmp_seq=0ttl=255time=1.457ms
56bytesfromicmp_seq=1ttl=255time=1.113ms
56bytesfromicmp_seq=2ttl=255time=1.168ms
56bytesfromicmp_seq=3ttl=255time=1.189ms
56bytesfromicmp_seq=4ttl=255time=1.049ms
---Pingstatisticsfor---
5packetstransmitted,5packetsreceived,0.0%packetloss
round-tripmin/avg/max/std-dev=1.049/1.195/1.457/0.140ms
[RoNetwork_Dept]%Aug2211:
49:
29:
3042014RoNetwork_DeptPING/6/PING_STATISTICS:
Pingstatisticsfor5packetstransmitted,5packetsreceived,0.0%packetloss,round-tripmin/avg/max/std-dev=1.049/1.195/1.457/0.140ms.
[RoNetwork_Dept]
RoNetCenter端:
sys
SystemView:
returntoUserViewwithCtrl+Z.
[H3C]sysRoNetCenter
[RoNetCenter]infosync
Info-centersynchronousoutputison.
[RoNetCenter]intlo0
[RoNetCenter-LoopBack0]ipadd32
[RoNetCenter-LoopBack0]intg0/0
[RoNetCenter-GigabitEthernet0/0]ipadd24
[RoNetCenter-GigabitEthernet0/0]undosh
[RoNetCenter-GigabitEthernet0/0]quit
[RoNetCenter]ipro
[RoNetCenter]disipro
Destinations:
14Routes:
14
Destination/MaskProtoPreCostNextHopInterface
Direct00InLoop0
Direct00GE0/0
Direct00GE0/0
Direct00InLoop0
Direct00GE0/0
Direct00InLoop0
Direct00InLoop0
Direct00InLoop0
Direct00InLoop0
Static600GE0/0
Direct00InLoop0
Direct00NULL0
Direct00NULL0
Direct00InLoop0
[RoNetCenter]
配置等价静态路由
RoNetwork_Dept端:
[RoNetwork_Dept]intg0/1
[RoNetwork_Dept-GigabitEthernet0/1]ipadd24
[RoNetwork_Dept-GigabitEthernet0/1]undosh
[RoNetwork_Dept-GigabitEthernet0/1]quit
[RoNetwork_Dept]ipro
[RoNetwork_Dept]disipro
Destinations:
21Routes:
22
Destination/MaskProtoPreCostNextHopInterface
Direct00InLoop0
Direct00GE0/0
Direct00GE0/0
Direct00InLoop0
Direct00GE0/0
Direct00GE0/1
Direct00GE0/1
Direct00InLoop0
Direct00GE0/1
Direct00InLoop0
Direct00InLoop0
Direct00InLoop0
Direct00InLoop0
Direct00Loop0
Direct00Loop0
Direct00InLoop0
Direct00Loop0
Static600GE0/0
GE0/1
Direct00NULL0
Direct00NULL0
Direct00InLoop0
RoNetCenter端:
[RoNetCenter]intg0/1
[RoNetCenter-GigabitEthernet0/1]ipadd24
[RoNetCenter-GigabitEthernet0/1]undosh
[RoNetCenter-GigabitEthernet0/1]quit
[RoNetCenter]ipro
[RoNetCenter]disipro
Destinations:
18Routes:
19
Destination/MaskProtoPreCostNextHopInterface
Direct00InLoop0
Direct00GE0/0
Direct00GE0/0
Direct00InLoop0
Direct00GE0/0
Direct00GE0/1
Direct00GE0/1
Direct00InLoop0
Direct00GE0/1
Direct00InLoop0
Direct00InLoop0
Direct00InLoop0
Direct00InLoop0
Static600GE0/0
GE0/1
Direct00InLoop0
Direct00NULL0
Direct00NULL0
Direct00InLoop0
测试:
[RoNetwork_Dept]ping
Ping(56databytes,pressCTRL_Ctobreak
56bytesfromicmp_seq=0ttl=255time=0.935ms
56bytesfromicmp_seq=1ttl=255time=1.156ms
56bytesfromicmp_seq=2ttl=255time=0.732ms
56bytesfromicmp_seq=3ttl=255time=1.301ms
56bytesfromicmp_seq=4ttl=255time=0.733ms
---Pingstatisticsfor---
5packetstransmitted,5packetsreceived,0.0%packetloss
round-tripmin/avg/max/std-dev=0.732/0.971/1.301/0.227ms
[RoNetCenter]ping-rroute”,记录路由
Ping(56databytes,pressCTRL_Ctobreak
56bytesfromicmp_seq=0ttl=255time=0.827ms
RR:
56bytesfromicmp_seq=1ttl=255time=0.964ms
RR:
56bytesfromicmp_seq=2ttl=255time=1.895ms
RR:
56bytesfromicmp_seq=3ttl=255time=0.673ms
RR:
56bytesfromicmp_seq=4ttl=255time=0.905ms
RR:
---Pingstatisticsfor---
5packetstransmitted,5packetsreceived,0.0%packetloss
round-tripmin/avg/max/std-dev=0.673/1.053/1.895/0.432ms
---数据包被轮流在两条链路上发送,但是奇怪的是,只从一条链路返回,这与GNS3的Cisco路由器不一样,Cisco的是从哪条链路出去就从哪条链路返回:
参考:
R1#ping
Protocol[ip]:
TargetIPaddress:
Repeatcount[5]:
Datagramsize[100]:
Timeoutinseconds[2]:
Extendedcommands[n]:
y
Sourceaddressorinterface:
Typeofservice[0]:
SetDFbitinIPheader?
[no]:
Validatereplydata?
[no]:
Datapattern[0xABCD]:
Loose,Strict,Record,Timestamp,Verbose[none]:
r
Numberofhops[9]:
Loose,Strict,Record,Timestamp,Verbose[RV]:
r
%Noroomforthatoption
Loose,Strict,Record,Timestamp,Verbose[RV]:
Record
%Noroomforthatoption
Loose,Strict,Record,Timestamp,Verbose[RV]:
Sweeprangeofsizes[n]:
Typeescapesequencetoabort.
Sending5,100-byteICMPEchosto,timeoutis2seconds:
PackethasIPoptions:
Totaloptionbytes=39,paddedlength=40
Recordroute:
<*>
(
(
(
(
(
(
(
(
(
Request0timedout
Request1timedout
Replytorequest2(32ms).Receivedpackethasoptions
Totaloptionbytes=40,paddedlength=40
Recordroute:
(
(
(
(<*>回来
(
(
(
(
(
Endoflist
Replytorequest3(48ms).Receivedpackethasoptions
Totaloptionbytes=40,paddedlength=40
Recordroute:
(
(
(
(<*>
(
(
(
(
(
Endoflist
Replytorequest4(24ms).Receivedpackethasoptions
Totaloptionbytes=40,paddedlength=40
Recordroute:
(
(
(
(<*>
(
(
(
(
(
Endoflist
Successrateis60percent(3/5),round-tripmin/avg/max=24/34/48ms
[RoNetwork_Dept]intg0/0
[RoNetwork_Dept-GigabitEthernet0/0]sh-------关闭G0/0接口,看看还能不能ping通
[RoNetwork_Dept-GigabitEthernet0/0]%Aug2212:
11:
22:
9122014RoNetwork_DeptIFNET/3/PHY_UPDOWN:
PhysicalstateontheinterfaceGigabitEthernet0/0changedtodown.
%Aug2212:
11:
22:
9132014RoNetwork_DeptIFNET/5/LINK_UPDOWN:
LineprotocolstateontheinterfaceGigabitEthernet0/0changedtodown.
quit
[RoNetwork_Dept]ping
Ping(56databytes,pressCTRL_Ctobreak
56bytesfromicmp_seq=0ttl=255time=0.676ms
56bytesfromicmp_seq=1ttl=255time=0.626ms
56bytesfromicmp_seq=2ttl=255time=0.756ms
56bytesfromicmp_seq=3ttl=255time=0.952ms
56bytesfromicmp_seq=4ttl=255time=0.740ms
---Pingstatisticsfor---
5packetstransmitted,5packetsreceived,0.0%packetloss
round-tripmin/avg/max/std-dev=0.626/0.750/0.952/0.111ms
[RoNetwork_Dept]%Aug2212:
11:
33:
3572014RoNetwork_DeptPING/6/PING_STATISTICS:
Pingstatisticsfor5packetstransmitted,5packetsreceived,0.0%packetloss,round-tripmin/avg/max/std-dev=0.626/0.750/0.952/0.111ms.
可见,当其中一条链路down了之后,数据包可以通过另一条链路发往目的地。
配置非等价静态路由:
[RoNetwork_Dept]intg0/0
[RoNetwork_Dept-GigabitEthernet0/0]undosh----重新激活G0/0接口
[RoNetwork_Dept-GigabitEthernet0/0]quit
[RoNetwork_Dept]undoipro---删除前面配置的路由
[RoNetwork_Dept]undoipro
[RoNetwork_Dept]ipropreference1–配置非等价静态路由,指定优先级为1
[RoNetwork_Dept]ipro----采用默认的优先级60,比上一条的优先级低
[RoNetwork_Dept]disipro
Destinations:
21Routes:
21
Desti