实验目的
- 掌握利用终端配置路由器时的连接方法和参数设置;
- 掌握路由器的常见模式及其转换命令;
- 掌握配置路由器的步骤和方法;
- 掌握检查路由器配置和状态的命令;
- 掌握不同同路由的优先级;
- 掌握自治系统内及自治系统间路由的概念、原理和用途;
- 掌握静态路由、RIP 路由、OSPF 路由、BGP 路由的配置和测试(排错)方法。
实验要求
- 请在参阅大量资料的基础上,自行规划一个至少包括三个自治系统(AS)的拓扑。每个 AS 内至少包括三台路由器,AS 内分别使用静态路由、OSPF 路由和 RIP 路由。AS 间使用 BGP 路由。
- 请先规划各个端口的所在的网段(点分十迚制地址中标识网络的部分必须包括组长学号的后两位,其余网段相应地++1)。规划结果记入表中,配置各个端口的 IP 地址等。
- 详细记录 BGP 路由的规划、配置的过程,测试的过程,使用 display interface brief 展示各个设备的接口配置情况,使用 dis IP routing-table 等命令查看路由表,不同 AS 的不同网段间连通性展示。对不同路由协议的收敛时间做出比较。
4.记录遇到的问题和解决方法。
实验拓扑
各个设备接口配置ip
int g0/0 --------进入某个接口
ip add ip地址 子网掩码(xxx.xxx.xxx.xxx) --------配置ip
-
配完一个ping一个,检查连通性
-
dis int b -------查看接口开启状态 没开启的接口ping不通
-
PC接口若没开启,连接的路由器的接口无法手动开启
-
路由器接口手动开启:
shutdown -----先关闭 undo shutdown ------开启
-
配完一个路由器保存一个
save
各个设备配置router-id
router id x.x.x.x
- 不配置的话到后面配置rip和ospf路由时会自动选择一个接口作为router id
- 先配置了ospf,后设置router id要求重启
先退出系统模式,在用户模式下重启ospf reset ospf process
各个设备配置loopback0地址
- 设置值为router id 子网掩码32
int lo0 ------------ 进入loopback0接口
ip add x.x.x.x(ip) 255.255.255.255
各个设备(除PC)开启路由追踪设置
-
使tracert命令有效
ip unreachable enable ip ttl-expires enable
-
查看路由路径
tracert x.x.x.x ----------- 当前路由器到ip x.x.x.x的途径路线 tracert -a x.x.x.x y.y.y.y -------- ip x.x.x.x到ip y.y.y.y的途径路线
AS100配置静态路由
ip route-static 目的ip 子网掩码 下一跳ip
RA1
配置去往94网段、2.2.2.2和3.3.3.3的路由
[RA1]ip route-static 192.168.94.0 24 192.168.95.1
[RA1]ip route-static 2.2.2.2 32 192.168.96.2
[RA1]ip route-static 1.1.1.1 32 192.168.95.1
RA2
配置去往94网段、95网段、1.1.1.1和3.3.3.3的路由
[RA2]ip route-static 192.168.95.0 24 192.168.96.1
[RA2]ip route-static 192.168.94.0 24 192.168.96.1
[RA2]ip route-static 1.1.1.1 32 192.168.96.1
[RA2]ip route-static 3.3.3.3 32 192.168.96.1
RA3
配置去往96网段、1.1.1.1和2.2.2.2的路由
[RA3]ip route-static 192.168.96.0 24 192.168.95.2
[RA3]ip route-static 1.1.1.1 32 192.168.95.2
[RA3]ip route-static 2.2.2.2 32 192.168.95.2
-
查看路由表
dis ip routing-table protocol static ---------查看静态 dis ip routing-table ------- 查看全部
AS200配置OSPF路由
ospf 1 -------------- 告知使用ospf路由,给定进程号,不给默认为1
area 0.0.0.0 --------- 划分区域 目前只有一个区
network 直连的网络ip 反掩码(如255.255.255.0的反掩码是0.0.0.255)
network 回环接口ip 反掩码
RB1
[RB1]ospf 1
[RB1-ospf-1]area 0.0.0.0
[RB1-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0
[RB1-ospf-1-area-0.0.0.0]network 192.168.98.0 0.0.0.255
[RB1-ospf-1-area-0.0.0.0]network 192.168.99.0 0.0.0.255
[RB1-ospf-1-area-0.0.0.0]network 192.168.100.0 0.0.0.255
RB2
[RB2]ospf 1
[RB2-ospf-1]area 0.0.0.0
[RB2-ospf-1-area-0.0.0.0]network 5.5.5.5 0.0.0.0
[RB2-ospf-1-area-0.0.0.0]network 192.168.97.0 0.0.0.255
[RB2-ospf-1-area-0.0.0.0]network 192.168.101.0 0.0.0.255
[RB2-ospf-1-area-0.0.0.0