H3C路由知识学习记录材料-静态路由
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
H3C路由(MSR26-30)
1、进入系统视图
Startup configuration file does not exist.
Performing automatic configuration... Press CTRL_D to break.
------------------------按Ctrl + D键终止设备查找自动配置
Automatic configuration attempt: 1.
Not ready for automatic configuration: no interface available.
Waiting for the next...
Automatic configuration is aborted.-------按Ctrl + D键后放弃自动配置的尝试
Line aux0 is available.
Press ENTER to get started.---------------到这里系统启动完毕,按回车键
<H3C>%Aug 22 09:19:53:318 2014 H3C SHELL/5/SHELL_LOGIN: TTY logged in from aux0.
--------------再按一次回车键
<H3C>
<H3C> system-view
[H3C]
2、修改路由器名称
<H3C>sys
[H3C]sysname 名称
如将默认的路由器名称改为RoNetwork_Dept,Ro表示设备类型为路由器,Network_Dept表示部门名称,以后看到这个名称就知道这是什么设备、在什么位置。
建议以后都采用这种方式来给设备命名,以方便管理。
[H3C]sysname RoNetwork_Dept
[RoNetwork_Dept]
如果要恢复默认名称,使用undo sysname命令:
[RoNetwork_Dept]undo sysname
[H3C]
3、显示路由表
(1)IPv4
显示路由表概要信息:
[RoNetwork_Dept]display ip routing-table
显示路由表详细信息:
[RoNetwork_Dept]display ip routing-table verbose
显示某种路由协议的信息:
[RoNetwork_Dept]display ip routing-table protocol {bgp|direct|guard|isis|ospf|rip|static}
还有其他信息,可使用?显示帮助以便选择:
[RoNetwork_Dept]display ip routing-table ?
(2)IPv6
只需将IPv4的命令中ip替换成ipv6即可。
4、配置接口
<H3C>sys
<H3C> system-view
[RoNetwork_Dept]int g0/0
[RoNetwork_Dept-GigabitEthernet0/0]---------进入接口配置视图
配置IP地址:
[RoNetwork_Dept-GigabitEthernet0/0]ip add 12.0.0.1 ?-----后面跟掩码长度也行,跟掩码也行
INTEGER<1-31> IP mask length
X.X.X.X IP mask
[RoNetwork_Dept-GigabitEthernet0/0]ip add 12.0.0.1 24 ----24表示掩码长度为24位,和255.255.255.0等效[RoNetwork_Dept-GigabitEthernet0/0]undo shutdown-----激活接口
[RoNetwork_Dept-GigabitEthernet0/0]dis int g0/0-----查看接口信息
5、信息回显及tracert
为了防止命令被系统输出的消息打断,可以配置信息回显:
[RoNetwork_Dept]info-center synchronous
为防止tracert超时,链路两端的设备都要开启以下功能:
[RoNetwork_Dept]ip redirects enable 开启设备的ICMP重定向报文的发送功能
[RoNetwork_Dept]ip ttl-expires enable 开启设备的ICMP超时报文的发送功能
[RoNetwork_Dept]ip unreachable enable 开启设备的ICMP目的不可达报文的发送功能
6、配置静态路由
拓扑图:
RoNetwork_Dept端:
<H3C>sys
System View: return to User View with Ctrl+Z.
[H3C]sys RoNetwork_Dept
[RoNetwork_Dept]info sync
Info-center synchronous output is on.
[RoNetwork_Dept]int lo0
[RoNetwork_Dept-LoopBack0]ip add 192.168.1.1 24
[RoNetwork_Dept-LoopBack0]int g0/0
[RoNetwork_Dept-GigabitEthernet0/0]ip add 12.0.0.1 24
[RoNetwork_Dept-GigabitEthernet0/0]undo sh
[RoNetwork_Dept-GigabitEthernet0/0]ip route 192.168.2.2 255.255.255.255 12.0.0.2
[RoNetwork_Dept]%Aug 22 11:45:32:415 2014 RoNetwork_Dept IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet0/0 changed to up.
%Aug 22 11:45:32:416 2014 RoNetwork_Dept IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet0/0 changed to up.-------系统发出的消息,g0/0接口已经up了
Destinations : 17 Routes : 17
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
12.0.0.0/24 Direct 0 0 12.0.0.1 GE0/0
12.0.0.0/32 Direct 0 0 12.0.0.1 GE0/0
12.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
12.0.0.255/32 Direct 0 0 12.0.0.1 GE0/0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
192.168.1.0/24 Direct 0 0 192.168.1.1 Loop0
192.168.1.0/32 Direct 0 0 192.168.1.1 Loop0
192.168.1.1/32 Direct 0 0 127.0.0.1 InLoop0
192.168.1.255/32 Direct 0 0 192.168.1.1 Loop0
192.168.2.2/32 Static 60 0 12.0.0.2 GE0/0
224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0
224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0
255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
[RoNetwork_Dept]ping 192.168.2.2 ---------使用ping命令测试路由是否配置正确
Ping 192.168.2.2 (192.168.2.2): 56 data bytes, press CTRL_C to break
56 bytes from 192.168.2.2: icmp_seq=0 ttl=255 time=1.457 ms
56 bytes from 192.168.2.2: icmp_seq=1 ttl=255 time=1.113 ms
56 bytes from 192.168.2.2: icmp_seq=2 ttl=255 time=1.168 ms
56 bytes from 192.168.2.2: icmp_seq=3 ttl=255 time=1.189 ms
56 bytes from 192.168.2.2: icmp_seq=4 ttl=255 time=1.049 ms
--- Ping statistics for 192.168.2.2 ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 1.049/1.195/1.457/0.140 ms
[RoNetwork_Dept]%Aug 22 11:49:29:304 2014 RoNetwork_Dept PING/6/PING_STATISTICS: Ping statistics for 192.168.2.2: 5 packets transmitted, 5 packets received, 0.0% packet loss, round-trip min/avg/max/std-dev = 1.049/1.195/1.457/0.140 ms.
[RoNetwork_Dept]
RoNetCenter端:
<H3C>sys
System View: return to User View with Ctrl+Z.
[H3C]sys RoNetCenter
[RoNetCenter]info sync
Info-center synchronous output is on.
[RoNetCenter]int lo0
[RoNetCenter-LoopBack0]ip add 192.168.2.2 32
[RoNetCenter-LoopBack0]int g0/0
[RoNetCenter-GigabitEthernet0/0]quit
[RoNetCenter]ip ro 192.168.1.1 255.255.255.255 12.0.0.1 [RoNetCenter]dis ip ro
Destinations : 14 Routes : 14
Destination/Mask Proto Pre Cost NextHop Interface 0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0 12.0.0.0/24 Direct 0 0 12.0.0.2 GE0/0 12.0.0.0/32 Direct 0 0 12.0.0.2 GE0/0 12.0.0.2/32 Direct 0 0 127.0.0.1 InLoop0 12.0.0.255/32 Direct 0 0 12.0.0.2 GE0/0 127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0 127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0 127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0 127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0 192.168.1.1/32 Static 60 0 12.0.0.1 GE0/0 192.168.2.2/32 Direct 0 0 127.0.0.1 InLoop0 224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0 224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0 255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0 [RoNetCenter]
配置等价静态路由
RoNetwork_Dept端:
[RoNetwork_Dept]int g0/1
[RoNetwork_Dept-GigabitEthernet0/1]ip add 21.0.0.1 24
[RoNetwork_Dept-GigabitEthernet0/1]undo sh
[RoNetwork_Dept-GigabitEthernet0/1]quit
[RoNetwork_Dept]ip ro 192.168.2.2 255.255.255.255 21.0.0.2 [RoNetwork_Dept]dis ip ro
Destinations : 21 Routes : 22
Destination/Mask Proto Pre Cost NextHop Interface 0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
12.0.0.255/32 Direct 0 0 12.0.0.1 GE0/0 21.0.0.0/24 Direct 0 0 21.0.0.1 GE0/1 21.0.0.0/32 Direct 0 0 21.0.0.1 GE0/1 21.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0 21.0.0.255/32 Direct 0 0 21.0.0.1 GE0/1 127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0 127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0 127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0 127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0 192.168.1.0/24 Direct 0 0 192.168.1.1 Loop0 192.168.1.0/32 Direct 0 0 192.168.1.1 Loop0 192.168.1.1/32 Direct 0 0 127.0.0.1 InLoop0 192.168.1.255/32 Direct 0 0 192.168.1.1 Loop0 192.168.2.2/32 Static 60 0 12.0.0.2 GE0/0
21.0.0.2 GE0/1 224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0 224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0 255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0 RoNetCenter端:
[RoNetCenter]int g0/1
[RoNetCenter-GigabitEthernet0/1]ip add 21.0.0.2 24
[RoNetCenter-GigabitEthernet0/1]undo sh
[RoNetCenter-GigabitEthernet0/1]quit
[RoNetCenter]ip ro 192.168.1.1 255.255.255.255 21.0.0.1 [RoNetCenter]dis ip ro
Destinations : 18 Routes : 19
Destination/Mask Proto Pre Cost NextHop Interface 0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0 12.0.0.0/24 Direct 0 0 12.0.0.2 GE0/0 12.0.0.0/32 Direct 0 0 12.0.0.2 GE0/0 12.0.0.2/32 Direct 0 0 127.0.0.1 InLoop0 12.0.0.255/32 Direct 0 0 12.0.0.2 GE0/0 21.0.0.0/24 Direct 0 0 21.0.0.2 GE0/1 21.0.0.0/32 Direct 0 0 21.0.0.2 GE0/1 21.0.0.2/32 Direct 0 0 127.0.0.1 InLoop0 21.0.0.255/32 Direct 0 0 21.0.0.2 GE0/1 127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0 127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0 127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0 127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0 192.168.1.1/32 Static 60 0 12.0.0.1 GE0/0
21.0.0.1 GE0/1
255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
测试:
[RoNetwork_Dept]ping 192.168.2.2
Ping 192.168.2.2 (192.168.2.2): 56 data bytes, press CTRL_C to break
56 bytes from 192.168.2.2: icmp_seq=0 ttl=255 time=0.935 ms
56 bytes from 192.168.2.2: icmp_seq=1 ttl=255 time=1.156 ms
56 bytes from 192.168.2.2: icmp_seq=2 ttl=255 time=0.732 ms
56 bytes from 192.168.2.2: icmp_seq=3 ttl=255 time=1.301 ms
56 bytes from 192.168.2.2: icmp_seq=4 ttl=255 time=0.733 ms
--- Ping statistics for 192.168.2.2 ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.732/0.971/1.301/0.227 ms
[RoNetCenter]ping -r 192.168.1.1-------“-r”表示“Record route”,记录路由
Ping 192.168.1.1 (192.168.1.1): 56 data bytes, press CTRL_C to break
56 bytes from 192.168.1.1: icmp_seq=0 ttl=255 time=0.827 ms
RR: 21.0.0.1
12.0.0.2
56 bytes from 192.168.1.1: icmp_seq=1 ttl=255 time=0.964 ms
RR: 12.0.0.1
12.0.0.2
56 bytes from 192.168.1.1: icmp_seq=2 ttl=255 time=1.895 ms
RR: 21.0.0.1
12.0.0.2
56 bytes from 192.168.1.1: icmp_seq=3 ttl=255 time=0.673 ms
RR: 12.0.0.1
12.0.0.2
56 bytes from 192.168.1.1: icmp_seq=4 ttl=255 time=0.905 ms
RR: 21.0.0.1
12.0.0.2
--- Ping statistics for 192.168.1.1 ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.673/1.053/1.895/0.432 ms
---数据包被轮流在两条链路上发送,但是奇怪的是,只从一条链路返回,这与GNS3的Cisco路由器不一样,Cisco的是从哪条链路出去就从哪条链路返回:
参考:
R1#ping
Protocol [ip]:
Target IP address: 192.168.2.2
Repeat count [5]:
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]: r
Number of hops [ 9 ]:
Loose, Strict, Record, Timestamp, Verbose[RV]: r
% No room for that option
Loose, Strict, Record, Timestamp, Verbose[RV]: Record
% No room for that option
Loose, Strict, Record, Timestamp, Verbose[RV]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.2, timeout is 2 seconds: Packet has IP options: Total option bytes= 39, padded length=40 Record route: <*>
(0.0.0.0)
(0.0.0.0)
(0.0.0.0)
(0.0.0.0)
(0.0.0.0)
(0.0.0.0)
(0.0.0.0)
(0.0.0.0)
(0.0.0.0)
Request 0 timed out
Request 1 timed out
Reply to request 2 (32 ms). Received packet has options
Total option bytes= 40, padded length=40
Record route:
(12.0.0.1)—出去
(192.168.2.2)
(12.0.0.2)
(12.0.0.1) <*>回来
(0.0.0.0)
(0.0.0.0)
(0.0.0.0)
(0.0.0.0)
(0.0.0.0)
End of list
Reply to request 3 (48 ms). Received packet has options
Total option bytes= 40, padded length=40
Record route:
(21.0.0.1)
(192.168.2.2)
(0.0.0.0)
(0.0.0.0)
(0.0.0.0)
(0.0.0.0)
(0.0.0.0)
End of list
Reply to request 4 (24 ms). Received packet has options
Total option bytes= 40, padded length=40
Record route:
(12.0.0.1)
(192.168.2.2)
(12.0.0.2)
(12.0.0.1) <*>
(0.0.0.0)
(0.0.0.0)
(0.0.0.0)
(0.0.0.0)
(0.0.0.0)
End of list
Success rate is 60 percent (3/5), round-trip min/avg/max = 24/34/48 ms
[RoNetwork_Dept]int g0/0
[RoNetwork_Dept-GigabitEthernet0/0]sh -------关闭G0/0接口,看看还能不能ping通
[RoNetwork_Dept-GigabitEthernet0/0]%Aug 22 12:11:22:912 2014 RoNetwork_Dept IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet0/0 changed to down.
%Aug 22 12:11:22:913 2014 RoNetwork_Dept IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet0/0 changed to down.
quit
[RoNetwork_Dept]ping 192.168.2.2
Ping 192.168.2.2 (192.168.2.2): 56 data bytes, press CTRL_C to break
56 bytes from 192.168.2.2: icmp_seq=0 ttl=255 time=0.676 ms
56 bytes from 192.168.2.2: icmp_seq=1 ttl=255 time=0.626 ms
56 bytes from 192.168.2.2: icmp_seq=2 ttl=255 time=0.756 ms
56 bytes from 192.168.2.2: icmp_seq=3 ttl=255 time=0.952 ms
56 bytes from 192.168.2.2: icmp_seq=4 ttl=255 time=0.740 ms
--- Ping statistics for 192.168.2.2 ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.626/0.750/0.952/0.111 ms
[RoNetwork_Dept]%Aug 22 12:11:33:357 2014 RoNetwork_Dept PING/6/PING_STATISTICS: Ping statistics for 192.168.2.2: 5 packets transmitted, 5 packets received, 0.0% packet loss, round-trip min/avg/max/std-dev = 0.626/0.750/0.952/0.111 ms.
可见,当其中一条链路down了之后,数据包可以通过另一条链路发往目的地。
配置非等价静态路由:
[RoNetwork_Dept-GigabitEthernet0/0]quit
[RoNetwork_Dept]undo ip ro 192.168.2.2 255.255.255.255 12.0.0.2 ---删除前面配置的路由
[RoNetwork_Dept]undo ip ro 192.168.2.2 255.255.255.255 21.0.0.2---删除前面配置的路由
[RoNetwork_Dept]ip ro 192.168.2.2 255.255.255.255 12.0.0.2 preference 1 –配置非等价静态路由,指定优先级为1 [RoNetwork_Dept]ip ro 192.168.2.2 255.255.255.255 21.0.0.2 ----采用默认的优先级60,比上一条的优先级低[RoNetwork_Dept]dis ip ro
Destinations : 21 Routes : 21
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
12.0.0.0/24 Direct 0 0 12.0.0.1 GE0/0
12.0.0.0/32 Direct 0 0 12.0.0.1 GE0/0
12.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
12.0.0.255/32 Direct 0 0 12.0.0.1 GE0/0
21.0.0.0/24 Direct 0 0 21.0.0.1 GE0/1
21.0.0.0/32 Direct 0 0 21.0.0.1 GE0/1
21.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
21.0.0.255/32 Direct 0 0 21.0.0.1 GE0/1
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
192.168.1.0/24 Direct 0 0 192.168.1.1 Loop0
192.168.1.0/32 Direct 0 0 192.168.1.1 Loop0
192.168.1.1/32 Direct 0 0 127.0.0.1 InLoop0
192.168.1.255/32 Direct 0 0 192.168.1.1 Loop0
192.168.2.2/32 Static 1 0 12.0.0.2 GE0/0---只显示高优先级的路由,出口G0/0
224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0
224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0
255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
[RoNetwork_Dept]dis ip ro 192.168.2.2
Summary Count : 1
Destination/Mask Proto Pre Cost NextHop Interface
192.168.2.2/32 Static 1 0 12.0.0.2 GE0/0
[RoNetwork_Dept]int g0/0
[RoNetwork_Dept-GigabitEthernet0/0]sh –再次关闭G0/0接口,看看路由表的变化
[RoNetwork_Dept-GigabitEthernet0/0]%Aug 22 12:24:56:174 2014 RoNetwork_Dept IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet0/0 changed to down.
%Aug 22 12:24:56:177 2014 RoNetwork_Dept IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet0/0 changed to down.
[RoNetwork_Dept-GigabitEthernet0/0]dis ip ro
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
21.0.0.0/24 Direct 0 0 21.0.0.1 GE0/1
21.0.0.0/32 Direct 0 0 21.0.0.1 GE0/1
21.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
21.0.0.255/32 Direct 0 0 21.0.0.1 GE0/1
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
192.168.1.0/24 Direct 0 0 192.168.1.1 Loop0
192.168.1.0/32 Direct 0 0 192.168.1.1 Loop0
192.168.1.1/32 Direct 0 0 127.0.0.1 InLoop0
192.168.1.255/32 Direct 0 0 192.168.1.1 Loop0
192.168.2.2/32 Static 60 0 21.0.0.2 GE0/1----高优先级的路由不可用后,自动使用低优先级的
224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0
224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0
255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
[RoNetwork_Dept-GigabitEthernet0/0]dis ip ro 192.168.2.2
Summary Count : 1
Destination/Mask Proto Pre Cost NextHop Interface
192.168.2.2/32 Static 60 0 21.0.0.2 GE0/1
小结:
等价静态路由和非等价静态路由都能提供冗余,确保在一条链路出现故障后仍能保持网络的连通性,但是两者存在差别,等价静态路由除了提供冗余外,还能提供负载均衡,数据包会被平均在两条链路上传输,而非等价静态路由中只有高优先级(低代价)的路由是活动的,只有这条路由因为链路故障或接口关闭等原因导致不可用时,低优先级(高代价)的路由才会被启用。
等价静态路由适用于存在多条带宽相同的链路的情况,而非等价静态路由适用于存在多条带宽不同的链路的情况——尤其是存在主链路和备份链路的情况。
7、配置默认路由
拓扑图:
RoNetwork_Dept端:
<H3C>sys
System View: return to User View with Ctrl+Z.
[H3C]sysn RoNetwork_Dept
[RoNetwork_Dept]int lo0
[RoNetwork_Dept-LoopBack0]ip add 192.168.1.1 255.255.255.255 [RoNetwork_Dept-LoopBack0]int g0/0
[RoNetwork_Dept-GigabitEthernet0/0]ip add 12.0.0.1 255.255.255.0 [RoNetwork_Dept-GigabitEthernet0/0]undo sh
[RoNetwork_Dept-GigabitEthernet0/0]quit
[RoNetwork_Dept]ip ro 0.0.0.0 0.0.0.0 12.0.0.2
[RoNetwork_Dept]dis ip ro
Destinations : 14 Routes : 14
Destination/Mask Proto Pre Cost NextHop Interface 0.0.0.0/0 Static 60 0 12.0.0.2 GE0/0 0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0 12.0.0.0/24 Direct 0 0 12.0.0.1 GE0/0 12.0.0.0/32 Direct 0 0 12.0.0.1 GE0/0 12.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0 12.0.0.255/32 Direct 0 0 12.0.0.1 GE0/0 127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0 127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0 127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0 127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0 192.168.1.1/32 Direct 0 0 127.0.0.1 InLoop0 224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0 224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0
255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
RoSoftware_Dept端:
<H3C>sys
System View: return to User View with Ctrl+Z.
[H3C]sysn RoSoftware_Dept
[RoSoftware_Dept]int l0
[RoSoftware_Dept-LoopBack0]ip add 192.168.3.3 255.255.255.255
[RoSoftware_Dept-LoopBack0]int g0/0
[RoSoftware_Dept-GigabitEthernet0/0]ip add 23.0.0.3 255.255.255.0
[RoSoftware_Dept-GigabitEthernet0/0]undo sh
[RoSoftware_Dept-GigabitEthernet0/0]quit
[RoSoftware_Dept]ip ro 0.0.0.0 0.0.0.0 23.0.0.2
[RoSoftware_Dept]dis ip ro
Destinations : 14 Routes : 14
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/0 Static 60 0 23.0.0.2 GE0/0
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
23.0.0.0/24 Direct 0 0 23.0.0.3 GE0/0
23.0.0.0/32 Direct 0 0 23.0.0.3 GE0/0
23.0.0.3/32 Direct 0 0 127.0.0.1 InLoop0
23.0.0.255/32 Direct 0 0 23.0.0.3 GE0/0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
192.168.3.3/32 Direct 0 0 127.0.0.1 InLoop0
224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0
224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0
255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
RoNetCenter端:
<H3C>%Aug 22 13:53:14:358 2014 H3C SHELL/5/SHELL_LOGIN: TTY logged in from aux0. sys
System View: return to User View with Ctrl+Z.
[H3C]sysn RoNetCenter
[RoNetCenter]int g0/0
[RoNetCenter-GigabitEthernet0/0]ip add 12.0.0.2 255.255.255.0
[RoNetCenter-GigabitEthernet0/0]undo sh
[RoNetCenter-GigabitEthernet0/0]int g0/1
[RoNetCenter-GigabitEthernet0/1]ip add 23.0.0.2 255.255.255.0
[RoNetCenter-GigabitEthernet0/1]undo sh
[RoNetCenter-GigabitEthernet0/1]int l0
[RoNetCenter-LoopBack0]ip add 192.168.2.2 255.255.255.255
[RoNetCenter-LoopBack0]quit
[RoNetCenter]ip ro 192.168.1.1 255.255.255.255 12.0.0.1
[RoNetCenter]ip ro 192.168.3.3 255.255.255.255 23.0.0.3
[RoNetCenter]dis ip ro
Destinations : 19 Routes : 19
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
12.0.0.0/24 Direct 0 0 12.0.0.2 GE0/0
12.0.0.0/32 Direct 0 0 12.0.0.2 GE0/0
12.0.0.2/32 Direct 0 0 127.0.0.1 InLoop0
12.0.0.255/32 Direct 0 0 12.0.0.2 GE0/0
23.0.0.0/24 Direct 0 0 23.0.0.2 GE0/1
23.0.0.0/32 Direct 0 0 23.0.0.2 GE0/1
23.0.0.2/32 Direct 0 0 127.0.0.1 InLoop0
23.0.0.255/32 Direct 0 0 23.0.0.2 GE0/1
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
192.168.1.1/32 Static 60 0 12.0.0.1 GE0/0
192.168.2.2/32 Direct 0 0 127.0.0.1 InLoop0
192.168.3.3/32 Static 60 0 23.0.0.3 GE0/1
224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0
224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0
255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
测试:
[RoNetwork_Dept]ping 192.168.3.3
Ping 192.168.3.3 (192.168.3.3): 56 data bytes, press CTRL_C to break
56 bytes from 192.168.3.3: icmp_seq=0 ttl=254 time=2.658 ms
56 bytes from 192.168.3.3: icmp_seq=1 ttl=254 time=1.115 ms
56 bytes from 192.168.3.3: icmp_seq=2 ttl=254 time=1.805 ms
56 bytes from 192.168.3.3: icmp_seq=3 ttl=254 time=1.883 ms
56 bytes from 192.168.3.3: icmp_seq=4 ttl=254 time=3.954 ms
--- Ping statistics for 192.168.3.3 ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 1.115/2.283/3.954/0.968 ms
[RoNetwork_Dept]%Aug 22 13:55:31:626 2014 RoNetwork_Dept PING/6/PING_STATISTICS: Ping statistics for 192.168.3.3: 5 packets transmitted, 5 packets received, 0.0% packet loss, round-trip min/avg/max/std-dev = 1.115/2.283/3.954/0.968 ms.
[RoNetwork_Dept]ping 192.168.2.2
Ping 192.168.2.2 (192.168.2.2): 56 data bytes, press CTRL_C to break
56 bytes from 192.168.2.2: icmp_seq=0 ttl=255 time=0.863 ms
56 bytes from 192.168.2.2: icmp_seq=1 ttl=255 time=0.950 ms
56 bytes from 192.168.2.2: icmp_seq=2 ttl=255 time=1.091 ms
56 bytes from 192.168.2.2: icmp_seq=3 ttl=255 time=1.090 ms
56 bytes from 192.168.2.2: icmp_seq=4 ttl=255 time=1.103 ms
--- Ping statistics for 192.168.2.2 ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.863/1.019/1.103/0.096 ms
[RoNetwork_Dept]%Aug 22 13:56:26:200 2014 RoNetwork_Dept PING/6/PING_STATISTICS: Ping statistics for 192.168.2.2: 5 packets transmitted, 5 packets received, 0.0% packet loss, round-trip min/avg/max/std-dev = 0.863/1.019/1.103/0.096 ms.。