开头
OSPF是个链路状态路由协议
通过 交互链路状态 学习路由表
DR和BDR选举方法
自动选举DR和BDR
网段上routerID最大的路由器将被选举为DR,第二大的将被选举为BDR
实际上DR和BDR根据启动时间顺序选择
手工选择DR和BDR
优先级范围是0~255,数值越大,优先级越高,默认为1
如果优先级相同,则需要比较ROUTER ID
如果路由器的优先级被设置为0,它将不参与DR和DBR的选举
路由器的优先级可以影响一个选择过程,但是它不能强制更换已经存在的DR或DBDR路由器
实验拓扑:
地址规划
IOU1 | lo 0 1.1.1.1/32 | e0/0 10.0.10.1/24 | e0/1 10.0.13.1/24 |
IOU2 | lo 0 2.2.2.2/32 | e0/0 10.0.10.2/24 | e0/1 10.0.11.1/24 |
IOU3 | lo 0 3.3.3.3/32 | e0/0 10.0.11.2/24 | e0/1 10.0.12.1/24 |
IOU4 | lo 0 4.4.4.4/32 | e0/0 10.0.12.2/24 | e0/1 10.0.13.2/24 |
IOU1的配置
Configure terminal
Interface loopback 0
Ip address 1.1.1.1 255.255.255.255
No shutdown
Exit
Interface Ethernet 0/0
Duplex full
Ip address 10.0.10.1 255.255.255.0
No shutdown
Exit
Interface Ethernet 0/1
Duplex full
Ip address 10.0.13.1 255.255.255.0
No shutdown
Exit
Router ospf 1
Router-id 1.1.1.1
Network 10.0.10.0 0.0.0.255 area 0
Network 10.0.13.0 0.0.0.255 area 0
Network 1.1.1.1 0.0.0.0 area 0
exit
IOU2的配置
Configure terminal
Interface loopback 0
Ip address 2.2.2.2 255.255.255.255
No shutdown
Exit
Interface Ethernet 0/0
Duplex full
Ip address 10.0.10.2 255.255.255.0
No shutdown
Exit
Interface Ethernet 0/1
Duplex full
Ip address 10.0.11.1 255.255.255.0
No shutdown
Exit
Router ospf 1
Router-id 2.2.2.2
Network 10.0.10.0 0.0.0.255 area 0
Network 10.0.11.0 0.0.0.255 area 0
Network 2.2.2.2 0.0.0.0 area 0
exit
IOU3的配置
Configure terminal
Interface loopback 0
Ip address 3.3.3.3 255.255.255.255
No shutdown
Exit
Interface Ethernet 0/0
Duplex full
Ip address 10.0.11.2 255.255.255.0
No shutdown
Exit
Interface Ethernet 0/1
Duplex full
Ip address 10.0.12.1 255.255.255.0
No shutdown
Exit
Router ospf 3
Router-id 3.3.3.3
Network 10.0.12.0 0.0.0.255 area 0
Network 10.0.11.0 0.0.0.255 area 0
Network 3.3.3.3 0.0.0.0 area 0
exit
IOU4的配置
Configure terminal
Interface loopback 0
Ip address 4.4.4.4 255.255.255.255
No shutdown
Exit
Interface Ethernet 0/0
Duplex full
Ip address 10.0.12.2 255.255.255.0
No shutdown
Exit
Interface Ethernet 0/1
Duplex full
Ip address 10.0.13.2 255.255.255.0
No shutdown
Exit
Router ospf 1
Router-id 4.4.4.4
Network 10.0.12.0 0.0.0.255 area 0
Network 10.0.13.0 0.0.0.255 area 0
Network 4.4.4.4 0.0.0.0 area 0
exit
使用show命令查看配置是否正确
show IP route
show IP ospf neighbor