摘要:配置静态路由的组网需求、配置步骤(各接口的IP地址、静态路由、主机、检查结果)。
关键词:实验;静态路由基本功能配置;IP地址;掩码;路由;网关
对于计算机系学生,静态路由基本功能配置实验尤为重要。通过在主机上书写指令建立路由,最后实现两台计算机可以互通。这个过程对之后学习其他各种协议的配置起承上启下的作用。
1.组网需求
路由器各接口及主机的IP地址和掩码。要求采用静态路由,任意两台主机之间都能互通。
2.配置步骤
(1)配置各接口的IP地址(略)
(2)配置静态路由
# 在 Router A 上配置缺省路由。
<RouterA> system-view
[RouterA] ip route-static 0.0.0.0 0.0.0.0 1.1.4.2
# 在 Router B 上配置两条静态路由。
<RouterB> system-view
[RouterB] ip route-static 1.1.2.0 255.255.255.0 1.1.4.1
[RouterB] ip route-static 1.1.3.0 255.255.255.0 1.1.5.6
# 在 Router C 上配置缺省路由。
<RouterC> system-view
[RouterC] ip route-static 0.0.0.0 0.0.0.0 1.1.5.5
(3)配置主机
配置 Host A 的缺省网关为 1.1.2.3,Host B 的缺省网关为 1.1.6.1,Host C 的缺省网关为 1.1.3.1,具体配置过程略。
(4)检查配置结果
# 显示 Router A 的 IP 路由表。
[RouterA] display ip routing-table
Routing Tables: Public
Destinations : 7 Routes : 7
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/0 Static 60 0 1.1.4.2 Eth1/2
1.1.2.0/24 Direct 0 0 1.1.2.3 Eth1/1
1.1.2.3/32 Direct 0 0 127.0.0.1 InLoop0
1.1.4.0/30 Direct 0 0 1.1.4.1 Eth1/2
1.1.4.1/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
# 显示 Router B 的 IP 路由表。
期刊文章分类查询,尽在期刊图书馆
[RouterB] display ip routing-table
Routing Tables: Public
Destinations : 10 Routes : 10
Destination/Mask Proto Pre Cost NextHop Interface
1.1.2.0/24 Static 60 0 1.1.4.1 Eth1/1
1.1.3.0/24 Static 60 0 1.1.5.6 Eth1/2
1.1.4.0/30 Direct 0 0 1.1.4.2 Eth1/1
1.1.4.2/32 Direct 0 0 127.0.0.1 InLoop0
1.1.5.0/30 Direct 0 0 1.1.5.5 Eth1/2
1.1.5.5/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
1.1.6.0/24 Direct 0 0 1.1.6.1 Eth1/3
1.1.6.1/32 Direct 0 0 127.0.0.1 InLoop0
# 在 Host B 上使用 ping 命令验证 Host A 是否可达(主机安装的操作系统为 Windows XP)。
C:\Documents and Settings\Administrator>ping 1.1.2.2
Pinging 1.1.2.2 with 32 bytes of data:
Reply from 1.1.2.2: bytes=32 time=1ms TTL=126
Reply from 1.1.2.2: bytes=32 time=1ms TTL=126
Reply from 1.1.2.2: bytes=32 time=1ms TTL=126
Reply from 1.1.2.2: bytes=32 time=1ms TTL=126
Ping statistics for 1.1.2.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 1ms, Average = 1ms
# 在 Host B 上使用 tracert 命令验证 Host A 是否可达。
C:\Documents and Settings\Administrator>tracert 1.1.2.2
Tracing route to 1.1.2.2 over a maximum of 30 hops
1 <1 ms <1 ms <1 ms 1.1.6.1
2 <1 ms <1 ms <1 ms 1.1.4.1
3 1 ms <1 ms <1 ms 1.1.2.2
Trace complete.
参考文献
[1]《H3C MSR 系列路由器 三层技术-IP路由配置指导》
论文作者:王宇博
论文发表刊物:《基层建设》2019年第31期
论文发表时间:2020/4/20
标签:路由论文; 静态论文; 主机论文; 网关论文; 地址论文; 基本功能论文; 接口论文; 《基层建设》2019年第31期论文;