2.1实验目的
1.掌握静态路由的配置方法;
2. 掌握动态路由(RIP与OSPF)的配置方法。
2.2 设备需求
(1) 2台路由器; (2) 2台PC机;
(3) 2根Console控制台电缆(一端接交换机或路由器的Console端口,一端接PC机串口)。
2.3实验环境
图4-1静态路由和动态路由的配置
2.4实验内容和步骤
1.静态路由的配置 路由器A的配置:
进入超级终端,进入用户视图。
< MSR3040> sys 进入系统视图 [MSR3040]sysname RTA
[RTA] display current-configuration 查看当前配置,看以太网接口与广域网接口(串口) ...... #
interface Serial5/0 link-protocol ppp #
- 1 -
interface Serial5/1 link-protocol ppp #
interface Serial5/2 link-protocol ppp #
interface Serial5/3 link-protocol ppp ......
interface GigabitEthernet0/0 port link-mode route #
interface GigabitEthernet0/1 port link-mode route
说明:本次实验中连线如下:
1. V.35电缆是连接在Serial5/0
2. PC机的网线连接在GigabitEthernet0/0 [RTA]
[RTA] interface GigabitEthernet0/0 可能简写:int g5/0 进入以太网接口0 [RTA- GigabitEthernet0/0] ip address 202.101.1.1 255.255.255.0 [RTA-GigabitEthernet0/0] interface Serial0
[RTA-Serial5/0] ip address 192.168.0.1 255.255.255.0 [RTA-Serial5/0] quit
[RTA] ip route-static 202.101.5.0 255.255.255.0 192.168.0.2 [RTA]
路由器B的配置:
[RTB]interface GigabitEthernet0/0
[RTB-GigabitEthernet0/0] ip address 202.101.5.1 255.255.255.0 [RTB-GigabitEthernet0/0] interface Serial5/0 [RTB-Serial5/0] ip address 192.168.0.2 255.255.255.0 [RTB-Serial5/0] quit
[RTB] ip route-static 202.101.1.0 255.255.255.0 192.168.0.1 [RTB] dis ip rout (显示路由表) Routing Tables:
Destination/Mask Proto Pref Metric Nexthop Interface 127.0.0.0/8 Direct 0 0 127.0.0.1 LoopBack0
- 2 -
127.0.0.1/32 Direct 0 0 127.0.0.1 LoopBack0 192.168.0.0/24 Direct 0 0 192.168.0.1 Serial5/0 192.168.0.1/32 Direct 0 0 192.168.0.1 Serial5/0 192.168.0.2/32 Direct 0 0 127.0.0.1 LoopBack0
202.101.1.0/24 Static 60 0 192.168.0.1 Serial5/0 (静态路由表项) 202.101.5.0/24 Direct 0 0 202.101.5.1 GigabitEthernet0/0 202.101.5.1/32 Direct 0 0 127.0.0.1 LoopBack0
[RTB]
在PCA机的命令窗口ping PCB:ping 202.101.5.2,显示结果如下:
图4-2 PCA机的命令窗口ping PCB
从图4-2中,可知PCA与PCB是连通的,实验成功。
2.RIP动态路由的配置 路由器A的配置:
[RTA] undo ip rout 202.101.5.0 24 192.168.0.2 (取消静态路由) [RTA] rip
[RTA - rip-1] network 192.168.0.0 [RTA - rip-1] network 202.101.1.0 [RTA - rip-1]quit
[RTA] display ip routing-table 显示路由表 Routing Tables: Public
Destinations : 8 Routes : 8
- 3 -
Destination/Mask Proto Pre Cost NextHop Interface 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 192.168.0.0/24 Direct 0 0 192.168.0.1 S5/0 192.168.0.1/32 Direct 0 0 127.0.0.1 InLoop0 192.168.0.2/32 Direct 0 0 192.168.0.2 S5/0 202.101.1.0/24 Direct 0 0 202.101.1.1 GE0/0 202.101.1.1/32 Direct 0 0 127.0.0.1 InLoop0 202.101.5.0/24 RIP 100 1 192.168.0.2 S5/0
路由器B的配置: [RTB] rip
[RTB - rip-1] network 192.168.0.0 [RTB - rip-1] network 202.101.5.0 [RTB - rip-1] quit
[RTB] display ip routing-table Routing Tables: Public
Destinations : 8 Routes : 8
Destination/Mask Proto Pre Cost NextHop 127.0.0.0/8 Direct 0 0 127.0.0.1 127.0.0.1/32 Direct 0 0 127.0.0.1 192.168.0.0/24 Direct 0 0 192.168.0.2 192.168.0.1/32 Direct 0 0 192.168.0.1 192.168.0.2/32 Direct 0 0 127.0.0.1 202.101.1.0/24 RIP 100 1 192.168.0.1 202.101.5.0/24 Direct 0 0 202.101.5.1 202.101.5.1/32 Direct 0 0 127.0.0.1 3.OSPF动态路由的配置 路由器A的配置:
[RTA] undo rip (取消RIP路由)
Warning : Undo RIP process? [Y/N]: y [RTA] interface loopback 0
[RTA-LoopBack0] ip address 1.1.1.1 255.255.255.255 [RTA-LoopBack0] quit [RTA] route ID 1.1.1.1 [RTA] ospf 1
[RTA-ospf-1] area 0
[RTA-ospf-1-area-0.0.0.0] network 1.1.1.1 0.0.0.0
- 4 -
Interface InLoop0 InLoop0 S5/0 S5/0 InLoop0 S5/0 GE0/0 InLoop0 [RTA-ospf-1-area-0.0.0.0] network 192.168.0.0 0.0.0.255 [RTA-ospf-1-area-0.0.0.0] network 202.101.1.0 0.0.0.255 [RTA-ospf-1-area-0.0.0.0] quit [RTA-ospf-1] quit [RTA]
[RTA] display ip routing-table 路由器RTB配置好后再执行该命令 Routing Tables: Public
Destinations : 10 Routes : 10
Destination/Mask Proto Pre Cost NextHop Interface 1.1.1.1/32 Direct 0 0 127.0.0.1 2.2.2.2/32 OSPF 10 1562 192.168.0.2 127.0.0.0/8 Direct 0 0 127.0.0.1 127.0.0.1/32 Direct 0 0 127.0.0.1 192.168.0.0/24 Direct 0 0 192.168.0.1 192.168.0.1/32 Direct 0 0 127.0.0.1 192.168.0.2/32 Direct 0 0 192.168.0.2 202.101.1.0/24 Direct 0 0 202.101.1.1 202.101.1.1/32 Direct 0 0 127.0.0.1 202.101.5.0/24 OSPF 10 1563 192.168.0.2
路由器B的配置:
[RTB] undo rip (取消RIP路由) [RTB] interface loopback 0
[RTB-LoopBack0] ip address 2.2.2.2 255.255.255.255 [RTB-LoopBack0] quit [RTB] route id 2.2.2.2 [RTB] ospf 1 [RTB-ospf-1] area 0
[RTB-ospf-1-area-0.0.0.0] network 2.2.2.2 0.0.0.0 [RTB-ospf-1-area-0.0.0.0] network 192.168.0.0 0.0.0.255 [RTB-ospf-1-area-0.0.0.0] network 202.101.5.0 0.0.0.255 [RTB-ospf-1-area-0.0.0.0] quit [RTB-ospf-1] quit [RTB]
[RTB]display ip routing-table Routing Tables: Public
Destinations : 10 Routes : 10
Destination/Mask Proto Pre Cost NextHop - 5 -
InLoop0 S5/0 InLoop0 InLoop0 S5/0 InLoop0 S5/0 GE0/0 InLoop0 S5/0 Interface
1.1.1.1/32 OSPF 10 1562 192.168.0.1 S5/0 2.2.2.2/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 192.168.0.0/24 Direct 0 0 192.168.0.2 S5/0 192.168.0.1/32 Direct 0 0 192.168.0.1 S5/0 192.168.0.2/32 Direct 0 0 127.0.0.1 InLoop0 202.101.1.0/24 202.101.5.0/24 202.101.5.1/32
OSPF 10 1563 Direct 0 0 Direct 0 0 192.168.0.1 202.101.5.1 127.0.0.1 - 6 -
S5/0 GE0/0 InLoop0
因篇幅问题不能全部显示,请点此查看更多更全内容
Copyright © 2019- huatuo0.com 版权所有 湘ICP备2023021991号-1
违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务