OSPF
子网划分
两个区域划分两个子网,
192.168.1.0000 0000/24
192.168.1.1 000 0000/25 area1
192.168.1.0 000 0000/25 area2
192.168.1.0 000 0000 192.168.1.0/25 骨干 划分三个子网,借两位
192.168.1.0 01 0 0000 192.168.1.32/27 AR1 --- 环回
192.168.1.001 0 0000 192.168.1.32/28
192.168.1.001 1 0000 192.168.1.48/28
192.168.1.0 10 0 0000 192.168.1.64/27 AR2 --- 环回
192.168.1.010 0 0000 192.168.1.64/28
192.168.1.010 1 0000 192.168.1.80/28
192.168.1.0 11 0 0000 192.168.1.96/27 AR3 --- 环回
192.168.1.011 0 0000 192.168.1.96/28
192.168.1.011 0 0000 192.168.1.112/28
IP配置操作代码就不贴了
开启OSPF协议
AR1:
[Huawei]ospf router-id 1.1.1.1
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
AR2:
[Huawei]ospf 1 router-id 2.2.2.2
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
AR3:
[Huawei]ospf 1 router-id 3.3.3.3
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]network 192.168.1.97 0.0.0.0
[Huawei-ospf-1-area-0.0.0.0]network 192.168.1.113 0.0.0.0
[Huawei-ospf-1-area-0.0.0.0]q
[Huawei-ospf-1]area 1
[Huawei-ospf-1-area-0.0.0.1]network 192.168.1.129 0.0.0.0
AR4:
[Huawei]ospf 1 router-id 4.4.4.4
[Huawei-ospf-1]area 1
[Huawei-ospf-1-area-0.0.0.1]network 192.168.1.130 0.0.0.0
DR/BDR选举
AR1:
interface g 0/0/0
ospf dr-priority 0
reset ospf process
Warning: The OSPF process will be reset. Continue? [Y/N]:y
其余类似
OSPF认证
AR1:
interface g 0/0/0
ospf authentication-mode md5 1 cipher 123
AR2:
interface g 0/0/0
ospf authentication-mode md5 1 cipher 123
区域汇总
AR3:
[Huawei]ospf 1
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]abr
[Huawei-ospf-1-area-0.0.0.0]abr-summary 192.168.1.0 255.255.255.128
[Huawei-ospf-1-area-0.0.0.0]q
[Huawei-ospf-1]area 1
[Huawei-ospf-1-area-0.0.0.1]abr
[Huawei-ospf-1-area-0.0.0.1]abr-summary 192.168.1.128 255.255.255.128
[Huawei-ospf-1-area-0.0.0.1]q
全网可达 --- 配置缺省
AR3:
[Huawei-ospf-1]default-route-advertise always //强制下发缺省信息
[Huawei-ospf-1]q
[Huawei]ip rou
[Huawei]ip route-s
[Huawei]ip route-static 0.0.0.0 192.168.1.130
配置空接口防止环路
AR3:
[R3]ip route-static 192.168.1.0 25 NULL 0
[R3]ip route-static 192.168.1.128 25 NULL 0
PING 通