OSPF配置
基础配置:
<Huawei>reset ospf 1 process //重启ospf进程,在手动指定了id后都需要执行此命令
[Huawei]router id xxxxx //给整个设备指定id,对所有协议生效
[Huawei]ospf 1 router-id xxx //对某个进程指定id
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.1]network 1.1.1.1 0.0.0.0 //IP+反掩码
[Huawei-ospf-1-area-0.0.0.1]network 12.12.12.0 0.0.0.3
[Huawei]display ospf 1 brief //查看进程1的配置信息
[Huawei]display ospf peer brief //查看邻居关系表
[Huawei]display ip routing-table //查看路由表
ospf x
area x //区域x
[Huawei-ospf-1]import-route rip x //引入rip让ospf知道rip存在
[Huawei-rip-1]import-route ospf x //引入ospf让rip知道ospf存在
为了可以通信,需要在不同进程之间相互引入
重发静态路由:
import-route static
重发默认路由:
[Huawei-ospf-1]default-route-advertise always //ospf中用
[AR1-rip-1]default-route originate //rip中用
dis ip routing-table protocol rip 查看rip路由表
[Huawei-ospf-1-area-0.0.0.1]stub //设置为stub网络
[Huawei-ospf-1-area-0.0.0.1]stub no //当完全末梢区域设置成功后,R5中将不会存在其他area区域中的路由条目,只会存在一条OSPF条目:0.0.0.0,需要在stub基础上
[Huawei-ospf-1-area-0.0.0.1]nssa no-summary //设置nssa区域,跟末梢区域的区别是能够引入外部路由
abr汇总:
[Huawei-ospf-1-area-0.0.0.0]abr-summary 172.16.8.0 255.255.254.0
asbr汇总:
[Huawei-ospf-1]asbr-summary xxxx 255.255.254.0
关于汇总:在一个区域内的所以路由器(包括ABR,ASBR)都能汇总,相当于多宣布一条路由,这条路由是个大的集合包,就会替代集合包里面的条目,从而达到减少路由条目的目的。路由汇总的极限就是默认路由,默认路由优先级最低
认证:
[Huawei-GigabitEthernet0/0/0]ospf authentication-mode md5 10 cipher abc123
方法2:
[Huawei-ospf-1-area-0.0.0.1]authentication-mode simple abc123

浙公网安备 33010602011771号