1. 关于本实验
这个实验使用与静态路由实验相同的拓扑,以此突显动态路由协议的灵活性,帮助读者理解OSPF的基础概念、配置和排错。
2. 实验目的
理解OSPF的基本概念。
掌握单区域OSPF的配置。
掌握OSPF邻居状态的解读。
掌握通过Cost控制OSPF选路的方法。
掌握OSPF默认路由发布的方法。
掌握OSPF认证的配置方法。
3. 实验组网介绍
![](https://img-blog.csdnimg.cn/img_convert/280382da4d6e493e6ce34749ad921b87.png)
设备 | 接口 | IP地址 | 子网掩码 | 默认网关 |
AR1 | G0/0/0 G0/0/1 G0/0/2 Lo0 | 172.16.10.1 10.10.14.1 10.10.12.1 10.10.0.1 | 255.255.255.0 255.255.255.0 255.255.255.0 255.255.255.255 | |
AR2 | G0/0/0 G0/0/1 Lo0 | 10.10.12.2 10.10.23.2 10.10.0.2 | 255.255.255.0 255.255.255.0 255.255.255.255 | |
AR3 | G0/0/0 G0/0/1 G0/0/2 Lo0 | 172.16.30.3 10.10.34.3 10.10.23.3 10.10.0.3 | 255.255.255.0 255.255.255.0 255.255.255.0 255.255.255.255 | |
AR4 | G0/0/0 G0/0/1 Lo0 | 10.10.14.4 10.10.34.4 10.10.0.4 | 255.255.255.0 255.255.255.0 255.255.255.255 | |
PC1 | E0/0/1 | 172.16.10.10 | 255.255.255.0 | 172.16.10.1 |
PC2 | E0/0/1 | 172.16.30.10 | 255.255.255.0 | 172.16.30.3 |
4. 实验任务列表
建立单区域OSPF。
通过开销进行选路。
通过OSPF发布默认路由。
配置OSPF认证。
5. 实验配置任务
建立单区域OSPF。
1.路由器上的基础IP地址配置。
![](https://img-blog.csdnimg.cn/img_convert/bd7bfd964e327fcea887066ba211ab91.png)
![](https://img-blog.csdnimg.cn/img_convert/6d897f38c9075a379f9cc0e94763dfb4.png)
![](https://img-blog.csdnimg.cn/img_convert/fe93c1b135de35c22beffabb0f3d8853.png)
![](https://img-blog.csdnimg.cn/img_convert/1eb8cd8e59a5c00c1b8131dadada21ff.png)
2.查看AR2的路由表是否已构建直连路由。
![](https://img-blog.csdnimg.cn/img_convert/840e1d176082108590b0a8f661e5017c.png)
2.在AR1、AR2上配置OSPF。
![](https://img-blog.csdnimg.cn/img_convert/fdf30005fc768807356bfeffe46c307a.png)
![](https://img-blog.csdnimg.cn/img_convert/17215f1c685aa68f1d7018d86fe1feea.png)
3.在AR2上查看OSPF邻居AR1。
![](https://img-blog.csdnimg.cn/img_convert/7683c61f0d3d9fb8c80ca270b3ceacc9.png)
4.在AR3上配置OSPF。
![](https://img-blog.csdnimg.cn/img_convert/967c6496307829a87ef499ff136524a0.png)
5.在AR3上启用OSPF的接口。
![](https://img-blog.csdnimg.cn/img_convert/28d64eb5beb0f965014c9636a23da936.png)
6.在AR3上查看OSPF邻居详细信息。
![](https://img-blog.csdnimg.cn/img_convert/a1869a9a443cf5176f51ef5a91c1c668.png)
7.在AR2上查看路由表中的OSPF路由。
![](https://img-blog.csdnimg.cn/img_convert/2484791c12e2784e1d055fd3c500340c.png)
8.从PC1向PC2发起ping测试。
![](https://img-blog.csdnimg.cn/img_convert/c07f363bd5d8c031e0c5470cbe5da7c8.png)
9.在AR4上配置OSPF。
![](https://img-blog.csdnimg.cn/img_convert/ee7ee736e495ad65c70490946720030a.png)
10.查看AR4上的OSPF邻居关系。
![](https://img-blog.csdnimg.cn/img_convert/e057927ef363e8716e98cd760280128f.png)
11.查看AR1、AR3路由表中的OSPF路由。
![](https://img-blog.csdnimg.cn/img_convert/c6283a4e94e520a88b8004b2a68806d5.png)
![](https://img-blog.csdnimg.cn/img_convert/c2348ed375564b739982023a71f2996b.png)
通过开销进行选路。
1.更改AR1、AR3的 G0/0/1接口的OSPF开销为5。
![](https://img-blog.csdnimg.cn/img_convert/846631779f68dc15cb3b69fbf6469ba6.png)
![](https://img-blog.csdnimg.cn/img_convert/e6cdefc6824f545a0d0fb253a7d3a416.png)
2.查看变更后AR1、AR3路由表中的OSPF路由。
![](https://img-blog.csdnimg.cn/img_convert/ead8dee407be6733c2a52080aaf5f7af.png)
![](https://img-blog.csdnimg.cn/img_convert/76e83babdfb6d158acdaaf4281432bd9.png)
3.验证备用路由的效果,关闭AR1的G0/0/2接口。
![](https://img-blog.csdnimg.cn/img_convert/fcf26ceae79547eb0151bb5155bce35a.png)
4.查看链路断开后的AR1、AR2、AR3路由表。
![](https://img-blog.csdnimg.cn/img_convert/e6cb54a691892870d7b3d2baee8eeb8a.png)
![](https://img-blog.csdnimg.cn/img_convert/66a9d6eb4a8a0b0cfa81c8a09e89e09c.png)
![](https://img-blog.csdnimg.cn/img_convert/ec56750c251007cf78585104003271d2.png)
![](https://img-blog.csdnimg.cn/img_convert/244142915f7aaf8f2f8da12b33cbd96a.png)
5.PC1上的持续ping测试。
![](https://img-blog.csdnimg.cn/img_convert/a87d9877e42bc7cc6a72a8da11c4ce56.png)
6.再次启用AR1的G0/0/2接口。
![](https://img-blog.csdnimg.cn/img_convert/fbc922517a930af9d7ff5b79884e9c62.png)
通过OSPF发布默认路由。
1.使用AR1向OSPF发布默认路由。
![](https://img-blog.csdnimg.cn/img_convert/cc16df9fa960361280f3f986409c66db.png)
2.在AR1上创建新的环回接口。
![](https://img-blog.csdnimg.cn/img_convert/2347215bdcddef3472e0faf50420c57e.png)
3.查看AR3的IP路由表。
![](https://img-blog.csdnimg.cn/img_convert/0c4d0c16331943bbec897f8283c2712c.png)
![](https://img-blog.csdnimg.cn/img_convert/aad4c130c96eab42a4d64c634f276dc4.png)
4.验证默认路由的效果。
![](https://img-blog.csdnimg.cn/img_convert/ad0a5317ab0a5b853ab352659be26feb.png)
配置OSPF认证。
1.在路由器上配置OSPF区域认证。
![](https://img-blog.csdnimg.cn/img_convert/bb3a9320a113dd3b4e811d0914223c78.png)
![](https://img-blog.csdnimg.cn/img_convert/c4201f9d9d8e8a073e537e358e935eb6.png)
![](https://img-blog.csdnimg.cn/img_convert/24c76ed7575467033a95d18b2b23e3d8.png)
![](https://img-blog.csdnimg.cn/img_convert/e2dfbe00f861043c476cac0ed29029cf.png)
2.AR2的邻居关系建立时长。
![](https://img-blog.csdnimg.cn/img_convert/d1a11572a6c4623be3f8c391a20bb9aa.png)
3.在AR1的G0/0/2接口上配置接口认证。
![](https://img-blog.csdnimg.cn/img_convert/27b7a7a68f7dee6988d3c73b9061ca94.png)
4.在AR2的G0/0/0接口上配置接口认证。
![](https://img-blog.csdnimg.cn/img_convert/b23aef7564bab8011f46b063d05d1704.png)