OSPF基本配置

 

R0上做如下设置

R0(config)#int s0/0                                                                                                                                    

R0(config-if)#no shutdown                                                         

R0(config-if)#ip add 172.16.1.1 255.255.255.0

R0(config-if)#int lo 0

R0(config-if)#no shutdown

R0(config-if)#ip add 1.1.1.1 255.255.255.0

R0(config-if)#router ospf 1                                             ospf进程号,本地有意义

R0(config-router)#network 1.1.1.0 0.0.0.255 area 0          network 网络号 反向掩码 area 区域号(一个区域的必须一致,否则无法形成邻接关系)

R0(config-router)#network 172.16.1.0 0.0.0.255 area 0

R0#sh ip ospf neighbor                                                  查看ospf邻居表

Neighbor ID     Pri   State           Dead Time   Address         Interface                 

2.2.2.2           1   FULL/  -        00:00:31                                      full表示已经达成邻接关系

    Neighbor is up for 00:38:51    172.16.1.2      Serial0/0

R0#sh ip ospf database                                                  查看ospf数据库

            OSPF Router with ID (1.1.1.1) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age                 Seq#           Checksum Link count

1.1.1.1         1.1.1.1               511         0x80000004 0xE718            3

2.2.2.2         2.2.2.2               390         0x80000006 0xD0A2           5

3.3.3.3         3.3.3.3               300         0x80000004 0xC0CD           3

 

R1上做如下设置

R1(config)#int s0/0

R1(config-if)#no shutdown

R1(config-if)#ip add 172.16.1.2 255.255.255.0

R1(config-if)#int s0/1

R1(config-if)#no shutdown

R1(config-if)#ip add 192.168.1.2 255.255.255.0

R1(config-if)#int lo 0

R1(config-if)#no shutdown

R1(config-if)#ip add 2.2.2.2 255.255.255.0

R1(config-if)#router ospf 2

R1(config-router)#network 2.2.2.0 0.0.0.255 area 0

R1(config-router)#network 192.168.1.0 0.0.0.255 area 0

R1(config-router)#network 172.16.1.0 0.0.0.255 area 0

 

R2上做如下设置

R2(config)#int s0/0

R2(config-if)#no shutdown

R2(config-if)#ip add 192.168.1.1 255.255.255.0

R2(config-if)#int lo 0

R2(config-if)#no shutdown

R2(config-if)#ip add 3.3.3.3 255.255.255.0

R2(config-if)#router ospf 3

R2(config-router)#network 3.3.3.0 0.0.0.255 area 0

R2(config-router)#network 192.168.1.0 0.0.0.255 area 0

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值