ospf配置

Ospf配置
拓扑
在这里插入图片描述
先为各台路由器配置ip
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1
[R1]user-interface console 0
[R1-ui-console0]idle-timeout 0
[R1-ui-console0]quit
[R1]quit
undo ter monitor
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[R1]interface GigabitEthernet0/0/0
[R1-GigabitEthernet0/0/0]ip add 17.1.1.1 24
[R1-GigabitEthernet0/0/0]quit
[R1]interface Ethernet0/0/0
[R1-Ethernet0/0/0]ip add 13.1.1.1 24
[R1-Ethernet0/0/0]quit
[R1]interface Ethernet0/0/1
[R1-Ethernet0/0/1]ip add 12.1.1.1 24
[R1-Ethernet0/0/1]quit
[R1]interface LoopBack 0
[R1-LoopBack0]ip add 1.1.1.1 24
[R1-LoopBack0]quit

sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R2
[R2]user-interface console 0
[R2-ui-console0]idle-timeout 0
[R2-ui-console0]quit
[R2]quit
undo ter monitor
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[R2]interface Ethernet0/0/0
[R2-Ethernet0/0/0]ip add 12.1.1.2 24
[R2-Ethernet0/0/0]quit
[R2]interface Ethernet0/0/1
[R2-Ethernet0/0/1]ip add 25.1.1.1 24
[R2-Ethernet0/0/1]quit
[R2]interface GigabitEthernet0/0/0
[R2-GigabitEthernet0/0/0]ip add 29.1.1.1 24
[R2-GigabitEthernet0/0/0]quit
[R2]interface LoopBack 0
[R2-LoopBack0]ip add 2.2.2.2 24
[R2-LoopBack0]quit

sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R3
[R3]user-interface console 0
[R3-ui-console0]quit
[R3]quit
sys
Enter system view, return user view with Ctrl+Z.
[R3]user-interface console 0
[R3-ui-console0]idle-timeout 0
[R3-ui-console0]quit
[R3]quit
undo ter monitor
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[R3]interface Ethernet0/0/1
[R3-Ethernet0/0/1]ip add 13.1.1.2 24
[R3-Ethernet0/0/1]quit
[R3]interface Ethernet0/0/0
[R3-Ethernet0/0/0]ip add 34.1.1.1 24
[R3-Ethernet0/0/0]quit
[R3]interface LoopBack 0
[R3-LoopBack0]ip add 3.3.3.3 24
[R3-LoopBack0]quit

sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R4
[R4]user-interface console 0
[R4-ui-console0]idle-timeout 0
[R4-ui-console0]quit
[R4]quit
undo ter monitor
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[R4]interface Ethernet0/0/0
[R4-Ethernet0/0/0]ip add 34.1.1.2 24
[R4-Ethernet0/0/0]quit

sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R5
[R5]user-interface console 0
[R5-ui-console0]idle-timeout 0
[R5-ui-console0]quit
[R5]quit
undo ter monitor
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[R5]interface Ethernet0/0/0
[R5-Ethernet0/0/0]ip add 25.1.1.2 24
[R5-Ethernet0/0/0]quit
[R5]interface Ethernet0/0/1
[R5-Ethernet0/0/1]ip add 56.1.1.1 24
[R5-Ethernet0/0/1]quit
[R5]interface LoopBack 0
[R5-LoopBack0]ip add 5.5.5.5 24
[R5-LoopBack0]quit

sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R6
[R6]user-interface console 0
[R6-ui-console0]id
[R6-ui-console0]idle-timeout 0
[R6-ui-console0]quit
[R6]quit
undo ter monitor
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[R6]interface Ethernet0/0/0
[R6-Ethernet0/0/0]ip add 56.1.1.2 24
[R6-Ethernet0/0/0]quit
[R6]interface LoopBack 0
[R6-LoopBack0]ip add 6.6.6.6 24
[R6-LoopBack0]quit

sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R7
[R7]user-interface console 0
[R7-ui-console0]idle-timeout 0
[R7-ui-console0]quit
[R7]quit
undo ter monitor
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[R7]interface Ethernet0/0/0
[R7-Ethernet0/0/0]ip add 17.1.1.2 24
[R7-Ethernet0/0/0]quit
[R7]interface Ethernet0/0/1
[R7-Ethernet0/0/1]ip add 78.1.1.1 24
[R7-Ethernet0/0/1]quit
[R7]interface LoopBack 0
[R7-LoopBack0]ip add 7.7.7.7 24
[R7-LoopBack0]quit

sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R8
[R8]user-interface console 0
[R8-ui-console0]idle-timeout 0
[R8]quit
undo ter monitor
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[R8]interface Ethernet0/0/0
[R8-Ethernet0/0/0]ip add 78.1.1.2 24
[R8-Ethernet0/0/0]quit
[R8]interface LoopBack 0
[R8-LoopBack0]ip add 8.8.8.8 24
[R8-LoopBack0]quit

sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R9
[R9]user-interface console 0
[R9-ui-console0]idle-timeout 0
[R9-ui-console0]quit
[R9]quit
undo ter monitor
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[R9]interface Ethernet0/0/0
[R9-Ethernet0/0/0]ip add 29.1.1.2 24
[R9-Ethernet0/0/0]quit
[R9]interface Ethernet0/0/1
[R9-Ethernet0/0/1]ip add 91.1.1.1 24
[R9-Ethernet0/0/1]quit
[R9]interface LoopBack 0
[R9-LoopBack0]ip add 9.9.9.9 24
[R9-LoopBack0]quit

sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R10
[R10]user-interface console 0
[R10-ui-console0]idle-timeout 0
[R10-ui-console0]quit
[R10]quit
undo ter monitor
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[R10]interface Ethernet0/0/0
[R10-Ethernet0/0/0]ip add 91.1.1.2 24
[R10-Ethernet0/0/0]quit
[R10]interface LoopBack 0
[R10-LoopBack0]ip add 10.10.10.10 24
[R10-LoopBack0]quit

测试直连连通性
在这里插入图片描述在这里插入图片描述在这里插入图片描述
在这里插入图片描述在这里插入图片描述在这里插入图片描述在这里插入图片描述
在这里插入图片描述在这里插入图片描述在这里插入图片描述

配置ospf
[R1]ospf 100 router-id 1.1.1.1
[R1-ospf-100]area 0
[R1-ospf-100-area-0.0.0.0]network 12.1.1.0 0.0.0.255
[R1-ospf-100-area-0.0.0.0]network 1.1.1.1 0.0.0.0
[R1-ospf-100-area-0.0.0.0]quit
[R1-ospf-100]area 1
[R1-ospf-100-area-0.0.0.1]network 13.1.1.0 0.0.0.255
[R1-ospf-100-area-0.0.0.1]quit
[R1-ospf-100]area 3
[R1-ospf-100-area-0.0.0.3]network 17.1.1.0 0.0.0.255
[R1-ospf-100-area-0.0.0.3]quit
[R1-ospf-100]quit

[R2]ospf 100 router-id 2.2.2.2
[R2-ospf-100]area 0
[R2-ospf-100-area-0.0.0.0]network 12.1.1.0 0.0.0.255
[R2-ospf-100-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[R2-ospf-100-area-0.0.0.0]quit
[R2-ospf-100]area 2
[R2-ospf-100-area-0.0.0.2]network 25.1.1.0 0.0.0.255
[R2-ospf-100-area-0.0.0.2]quit
[R2-ospf-100]area 4
[R2-ospf-100-area-0.0.0.4]network 29.1.1.0 0.0.0.255
[R2-ospf-100-area-0.0.0.4]quit
[R2-ospf-100]quit

[R3]ospf 100 router-id 3.3.3.3
[R3-ospf-100]area 1
[R3-ospf-100-area-0.0.0.1]network 13.1.1.0 0.0.0.255
[R3-ospf-100-area-0.0.0.1]network 34.1.1.0 0.0.0.255
[R3-ospf-100-area-0.0.0.1]network 3.3.3.3 0.0.0.0
[R3-ospf-100-area-0.0.0.1]quit
[R3-ospf-100]quit

[R4]ospf 100 router-id 4.4.4.4
[R4-ospf-100]area 1
[R4-ospf-100-area-0.0.0.1]network 34.1.1.0 0.0.0.255
[R4-ospf-100-area-0.0.0.1]network 4.4.4.4 0.0.0.0
[R4-ospf-100-area-0.0.0.1]quit
[R4-ospf-100]quit

[R5]ospf 100 router-id 5.5.5.5
[R5-ospf-100]area 2
[R5-ospf-100-area-0.0.0.2]network 25.1.1.0 0.0.0.255
[R5-ospf-100-area-0.0.0.2]network 56.1.1.0 0.0.0.255
[R5-ospf-100-area-0.0.0.2]network 5.5.5.5 0.0.0.0
[R5-ospf-100-area-0.0.0.2]quit
[R5-ospf-100]quit

[R6]ospf 100 router-id 6.6.6.6
[R6-ospf-100]area 2
[R6-ospf-100-area-0.0.0.2]network 56.1.1.0 0.0.0.255
[R6-ospf-100-area-0.0.0.2]network 6.6.6.6 0.0.0.0
[R6-ospf-100-area-0.0.0.2]quit
[R6-ospf-100]quit

[R7]ospf 100 router-id 7.7.7.7
[R7-ospf-100]area 3
[R7-ospf-100-area-0.0.0.3]network 17.1.1.0 0.0.0.255
[R7-ospf-100-area-0.0.0.3]network 78.1.1.0 0.0.0.255
[R7-ospf-100-area-0.0.0.3]network 7.7.7.7 0.0.0.0
[R7-ospf-100-area-0.0.0.3]quit
[R7-ospf-100]quit

[R8]ospf 100 router-id 8.8.8.8
[R8-ospf-100]area 3
[R8-ospf-100-area-0.0.0.3]network 78.1.1.0 0.0.0.255
[R8-ospf-100-area-0.0.0.3]network 8.8.8.8 0.0.0.0
[R8-ospf-100-area-0.0.0.3]quit
[R8-ospf-100]quit

[R9]ospf 100 router-id 9.9.9.9
[R9-ospf-100]area 4
[R9-ospf-100-area-0.0.0.4]network 29.1.1.0 0.0.0.255
[R9-ospf-100-area-0.0.0.4]network 91.1.1.0 0.0.0.255
[R9-ospf-100-area-0.0.0.4]network 9.9.9.9 0.0.0.0
[R9-ospf-100-area-0.0.0.4]quit
[R9-ospf-100]quit

[R10]ospf 100 router-id 10.10.10.10
[R10-ospf-100]area 4
[R10-ospf-100-area-0.0.0.4]network 91.1.1.0 0.0.0.255
[R10-ospf-100-area-0.0.0.4]network 10.10.10.10 0.0.0.0
[R10-ospf-100-area-0.0.0.4]quit
[R10-ospf-100]quit

查看路由表
在这里插入图片描述
OSPF扩展配置
1、认证–邻居间的身份核实
1)接口认证–在邻居间相连的接口上做两个邻居之间的认证
[R1]interface Ethernet0/0/1
[R1-Ethernet0/0/1]ospf authentication-mode md5 1 cipher hcip
在相连俩接口上同时启用认证否则链接会断开
在这里插入图片描述
在这里插入图片描述
2、缺省–在连接运营商的边界路由器上配置
[r1]ospf 1
[r1-ospf-1]default-route-advertise //非强制下发缺省
[r1-ospf-1]default-route-advertise always //强制下发缺省

非强制:若要在协议内下发缺省成功,路由器本身应该有缺省路由
强制:总是能够下发缺省
3、静默接口–只接收不发送协议报文,只能用于连接用户的接口,禁止用于路由器之间的接口
[r1]ospf 1
[r1-ospf-1]silent-interface GigabitEthernet 0/0/0
Ospf三种表的查看
1) 邻居表
在这里插入图片描述
2) 数据库表
在这里插入图片描述
3) 路由表
在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值