OSPF网络类型的配置
liyuning - BY - 2008-8-20 16:19:45

试验标题:

OSPF 的网络类型更改配置

网络类型:

OSPF协议的五种网络类型

:1.POINT-TO-POINT(点到点网络)

2.广播多路访问(BROADCAST)

3.非广播多路访问(NBMA)

4.点到多点网络(POINT-TO-MULTIPOINT)

5.虚链路(VIRTUAL LINKS)

 试验拓扑:


 

 

试验配置:

R1的预配置:

Router>
Router>
Router>ena
Router#
Router#
Router#CONF t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#
Router(config)#host R1
R1(config)#
R1(config)#
R1(config)#line cons 0
R1(config-line)#no exec-timeout
R1(config-line)#logg synchronous
R1(config-line)#end
R1#
*Aug 20 00:50:35.511: %SYS-5-CONFIG_I: Configured from console by console
R1#
R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#inter s3/0
R1(config-if)#enc
R1(config-if)#encapsulation frame-relay
R1(config-if)#no frame-relay inverse-arp
R1(config-if)#frame-relay map ip 192.168.0.2 102 b
R1(config-if)#ip add 192.168.0.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#exit
R1(config)#
*Aug 20 00:52:32.155: %LINK-3-UPDOWN: Interface Serial3/0, changed state to up
R1(config)#
*Aug 20 00:52:43.155: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial3/0, changed state to up
R1(config)#router ospf 64
R1(config-router)#network 192.168.0.1 0.0.0.0 area 0
R1(config-router)#exit
R1(config)#end
R1#

 

 

R2的预配置:

 

 

Router>
Router>ena
Router#
Router#
Router#
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#host R2
R2(config)#
R2(config)#line con 0
R2(config-line)#no exec-tim
R2(config-line)#logg syn
R2(config-line)#logg synchronous
R2(config-line)#end
R2#
*Aug 20 00:50:52.671: %SYS-5-CONFIG_I: Configured from console by console
R2#
R2#
R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#inter ser3/0
R2(config-if)#enc frame-relay
R2(config-if)#no frame-relay inverse-arp
R2(config-if)#frame-relay map ip 192.168.0.1 201 b
R2(config-if)#ip add 192.168.0.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#exit
R2(config)#
*Aug 20 00:53:51.255: %LINK-3-UPDOWN: Interface Serial3/0, changed state to up
R2(config)#
*Aug 20 00:54:02.255: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial3/0, changed state to up
R2(config)#
R2(config)#
R2(config)#router ospf 64
R2(config-router)#net 192.168.0.2 0.0.0.0 area 0
R2(config-router)#exit
R2(config)#end

 

查看R1的配置接口:

R1#show ip ospf interface
Serial3/0 is up, line protocol is up
  Internet Address 192.168.0.1/24, Area 0
  Process ID 64, Router ID 192.168.0.1, Network Type NON_BROADCAST, Cost: 64   //显示网络类型为非广播
  Transmit Delay is 1 sec, State WAITING, Priority 1  
  No designated router on this network
  No backup designated router on this network
  Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5
    oob-resync timeout 120
    Hello due in 00:00:20
    Wait time before Designated router selection 00:00:50
  Index 1/1, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 0, maximum is 0
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 0, Adjacent neighbor count is 0
  Suppress hello for 0 neighbor(s)
R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#inte s3/0
R1(config-if)#ip ospf net
R1(config-if)#ip ospf network bro
R1(config-if)#ip ospf network broadcast
R1(config-if)#end
R1#sho
*Aug 20 00:59:46.747: %SYS-5-CONFIG_I: Configured from console by console
R1#show ip ospf inter 

更改R1的网络协议类型:

R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#inte s3/0
R1(config-if)#ip ospf net
R1(config-if)#ip ospf network bro
R1(config-if)#ip ospf network broadcast
R1(config-if)#end

 

再次在R1接口上查看:

R1#show ip ospf inter
R1#show ip ospf inter
Serial3/0 is up, line protocol is up
  Internet Address 192.168.0.1/24, Area 0
  Process ID 64, Router ID 192.168.0.1, Network Type BROADCAST, Cost: 64
  Transmit Delay is 1 sec, State DROTHER, Priority 1   ///显示网络类型已被更改为广播类型
  Designated Router (ID) 192.168.0.2, Interface address 192.168.0.2
  Backup Designated router (ID) 192.168.0.2, Interface address 192.168.0.2
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:03
  Index 1/1, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 0, maximum is 0
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 1, Adjacent neighbor count is 0
  Suppress hello for 0 neighbor(s)

R2的网络类型没更改前:

R2#show ip ospf inter
R2#show ip ospf interface
Serial3/0 is up, line protocol is up
  Internet Address 192.168.0.2/24, Area 0
  Process ID 64, Router ID 192.168.0.2, Network Type NON_BROADCAST, Cost: 64
  Transmit Delay is 1 sec, State DR, Priority 1
  Designated Router (ID) 192.168.0.2, Interface address 192.168.0.2
  No backup designated router on this network
  Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5
    oob-resync timeout 120
    Hello due in 00:00:10
  Index 1/1, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 0, maximum is 0
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 0, Adjacent neighbor count is 0
  Suppress hello for 0 neighbor(s)
R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#inter s3/0
R2(config-if)#ip ospf netw
R2(config-if)#ip ospf network bro
R2(config-if)#ip ospf network broadcast
R2(config-if)#end

R2的网络类型更改后:

R2#show ip ospf inter
R2#show ip ospf interface
Serial3/0 is up, line protocol is up
  Internet Address 192.168.0.2/24, Area 0
  Process ID 64, Router ID 192.168.0.2, Network Type NON_BROADCAST, Cost: 64
  Transmit Delay is 1 sec, State DR, Priority 1
  Designated Router (ID) 192.168.0.2, Interface address 192.168.0.2
  No backup designated router on this network
  Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5
    oob-resync timeout 120
    Hello due in 00:00:10
  Index 1/1, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 0, maximum is 0
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 0, Adjacent neighbor count is 0
  Suppress hello for 0 neighbor(s)
R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#inter s3/0
R2(config-if)#ip ospf netw
R2(config-if)#ip ospf network bro
R2(config-if)#ip ospf network broadcast
R2(config-if)#end

调试R2和R1的OSPF的邻接关系的建立:

 

R1#clear ip ospf pr
R1#clear ip ospf process
Reset ALL OSPF processes? [no]: y
R1#
*Aug 20 01:02:24.247: OSPF: Interface Serial3/0 going Down
*Aug 20 01:02:24.247: OSPF: 192.168.0.1 address 192.168.0.1 on Serial3/0 is dead, state DOWN
*Aug 20 01:02:24.251: OSPF: Neighbor change Event on interface Serial3/0
*Aug 20 01:02:24.251: OSPF: DR/BDR election on Serial3/0
*Aug 20 01:02:24.251: OSPF: Elect BDR 0.0.0.0
*Aug 20 01:02:24.255: OSPF: Elect DR 192.168.0.2
*Aug 20 01:02:24.255: OSPF: Elect BDR 0.0.0.0
*Aug 20 01:02:24.255: OSPF: Elect DR 192.168.0.2
*Aug 20 01:02:24.259:        DR: 192.168.0.2 (Id)   BDR: none
*Aug 20 01:02:24.259: OSPF: 192.168.0.2 address 192.168.0.2 on Serial3/0 is dead, state DOWN
*Aug 20 01:02:24.263: %OSPF-5-ADJCHG: Process 64, Nbr 192.168.0.2 on Serial3/0 from FULL to DOWN, Neighbor Down: Interface down or detached
*Aug 20 01:02:24.267: OSPF: Neighbor change Event on interface Serial3/0
*Aug 20 01:02:24.267: OSPF: DR/BDR election on Serial3/0
*Aug 20 01:02:24.271: OSPF: Elect BDR 0.0.0.0
*Aug 20 01:02:24.271: OSPF: Elect DR
R1#0.0.0.0
*Aug 20 01:02:24.271:        DR: none    BDR: none
*Aug 20 01:02:24.275: OSPF: Remember old DR 192.168.0.2 (id)
*Aug 20 01:02:24.411: OSPF: Interface Serial3/0 going Up
*Aug 20 01:02:24.691: OSPF: 2 Way Communication to 192.168.0.2 on Serial3/0, state 2WAY
*Aug 20 01:02:24.695: OSPF: Backup seen Event before WAIT timer on Serial3/0
*Aug 20 01:02:24.695: OSPF: DR/BDR election on Serial3/0
*Aug 20 01:02:24.695: OSPF: Elect BDR 192.168.0.1
*Aug 20 01:02:24.699: OSPF: Elect DR 192.168.0.2
*Aug 20 01:02:24.699: OSPF: Elect BDR 192.168.0.1
*Aug 20 01:02:24.699: OSPF: Elect DR 192.168.0.2
*Aug 20 01:02:24.703:        DR: 192.168.0.2 (Id)   BDR: 192.168.0.1 (Id)
*Aug 20 01:02:24.703: OSPF: Send DBD to 192.168.0.2 on Serial3/0 seq 0x259C opt 0x52 flag 0x7 len 32
*Aug 20 01:02:24.759: OSPF: Build router LSA for area 0, router ID 192.168.0.1, seq 0x80000001
*Aug 20 01:02:24.767: OSPF: Rcv DBD from 192.168.0.2 on Serial3/0 seq 0x10E7 opt 0x52 flag 0x7 len 32  mtu 1500 stat
R1#e EXSTART
*Aug 20 01:02:24.767: OSPF: NBR Negotiation Done. We are the SLAVE
*Aug 20 01:02:24.771: OSPF: Send DBD to 192.168.0.2 on Serial3/0 seq 0x10E7 opt 0x52 flag 0x2 len 52
*Aug 20 01:02:24.975: OSPF: Rcv DBD from 192.168.0.2 on Serial3/0 seq 0x10E8 opt 0x52 flag 0x3 len 72  mtu 1500 state EXCHANGE
*Aug 20 01:02:24.979: OSPF: Send DBD to 192.168.0.2 on Serial3/0 seq 0x10E8 opt 0x52 flag 0x0 len 32
*Aug 20 01:02:25.147: OSPF: Rcv DBD from 192.168.0.2 on Serial3/0 seq 0x10E9 opt 0x52 flag 0x1 len 32  mtu 1500 state EXCHANGE
*Aug 20 01:02:25.151: OSPF: Exchange Done with 192.168.0.2 on Serial3/0
*Aug 20 01:02:25.151: OSPF: Send LS REQ to 192.168.0.2 length 24 LSA count 2
*Aug 20 01:02:25.155: OSPF: Send DBD to 192.168.0.2 on Serial3/0 seq 0x10E9 opt 0x52 flag 0x0 len 32
*Aug 20 01:02:25.771: OSPF: Rcv LS UPD from 192.168.0.2 on Serial3/0 length 100 LSA count 2
*Aug 20 01:02:25.775: OSPF: Synchronized with 192.168.0.2 on Serial3/0, state FULL
*Aug 20 01:02:25.775: %OSPF-5-
R1#ADJCHG: Process 64, Nbr 192.168.0.2 on Serial3/0 from LOADING to FULL, Loading Done
R1#
*Aug 20 01:02:27.811: OSPF: Rcv LS UPD from 192.168.0.2 on Serial3/0 length 60 LSA count 1
*Aug 20 01:02:28.019: OSPF: Rcv LS UPD from 192.168.0.2 on Serial3/0 length 64 LSA count 1
*Aug 20 01:02:28.023: OSPF: Rcv LS UPD from 192.168.0.2 on Serial3/0 length 60 LSA count 1
R1#
*Aug 20 01:02:30.755: OSPF: Build router LSA for area 0, router ID 192.168.0.1, seq 0x80000003
R1#
*Aug 20 01:02:32.571: OSPF: Neighbor change Event on interface Serial3/0
*Aug 20 01:02:32.575: OSPF: DR/BDR election on Serial3/0
*Aug 20 01:02:32.575: OSPF: Elect BDR 192.168.0.1
*Aug 20 01:02:32.575: OSPF: Elect DR 192.168.0.2
*Aug 20 01:02:32.579:        DR: 192.168.0.2 (Id)   BDR: 192.168.0.1 (Id)
R1#
更改R1和R2的网络类型改为点到点:

R1(config)#inter s3/0
R1(config-if)#ip ospf netr
R1(config-if)#ip ospf net
R1(config-if)#ip ospf network po
R1(config-if)#ip ospf network point-to-p
R1(config-if)#ip ospf network point-to-point
R1(config-if)#
*Aug 20 01:06:29.027: OSPF: Interface Serial3/0 going Down
*Aug 20 01:06:29.027: OSPF: 192.168.0.1 address 192.168.0.1 on Serial3/0 is dead, state DOWN
*Aug 20 01:06:29.031: OSPF: Neighbor change Event on interface Serial3/0
*Aug 20 01:06:29.031: OSPF: DR/BDR election on Serial3/0
*Aug 20 01:06:29.035: OSPF: Elect BDR 0.0.0.0
*Aug 20 01:06:29.035: OSPF: Elect DR 192.168.0.2
*Aug 20 01:06:29.035: OSPF: Elect BDR 0.0.0.0
*Aug 20 01:06:29.039: OSPF: Elect DR 192.168.0.2
*Aug 20 01:06:29.039:        DR: 192.168.0.2 (Id)   BDR: none
*Aug 20 01:06:29.039: OSPF: 192.168.0.2 address 192.168.0.2 on Serial3/0 is dead, state DOWN
*Aug 20 01:06:29.043: %OSPF-5-ADJCHG: Process 64, Nbr 192.168.0.2 on Serial3/0 from FULL to DOWN, Neighbor Down: Interface down or detached
R1(config-if)#
*Aug 20 01:06:29.047: OSPF: Neighbor change Event on interface Serial3/0
*Aug 20 01:06:29.047: OSPF: DR/BDR election on Serial3/0
*Aug 20 01:06:29.051: OSPF: Elect BDR 0.0.0.0
*Aug 20 01:06:29.051: OSPF: Elect DR 0.0.0.0
*Aug 20 01:06:29.051:        DR: none    BDR: none
*Aug 20 01:06:29.055: OSPF: Remember old DR 192.168.0.2 (id)
*Aug 20 01:06:29.059: OSPF: Interface Serial3/0 going Up
*Aug 20 01:06:29.263: OSPF: 2 Way Communication to 192.168.0.2 on Serial3/0, state 2WAY
*Aug 20 01:06:29.263: OSPF: Send DBD to 192.168.0.2 on Serial3/0 seq 0x1170 opt 0x52 flag 0x7 len 32
*Aug 20 01:06:29.519: OSPF: Rcv DBD from 192.168.0.2 on Serial3/0 seq 0xF9 opt 0x52 flag 0x7 len 32  mtu 1500 state EXSTART
*Aug 20 01:06:29.523: OSPF: NBR Negotiation Done. We are the SLAVE
*Aug 20 01:06:29.523: OSPF: Send DBD to 192.168.0.2 on Serial3/0 seq 0xF9 opt 0x52 flag 0x2 len 92
*Aug 20 01:06:29.539: OSPF: Build router LSA for area 0, router ID 192.168.0.1, seq 0x80000004
*Aug 20 01:06:30.1
R1(config-if)#67: OSPF: Rcv DBD from 192.168.0.2 on Serial3/0 seq 0xFA opt 0x52 flag 0x3 len 72  mtu 1500 state EXCHANGE
*Aug 20 01:06:30.171: OSPF: Send DBD to 192.168.0.2 on Serial3/0 seq 0xFA opt 0x52 flag 0x0 len 32
*Aug 20 01:06:30.175: OSPF: Rcv LS UPD from 192.168.0.2 on Serial3/0 length 64 LSA count 1
*Aug 20 01:06:30.667: OSPF: Rcv DBD from 192.168.0.2 on Serial3/0 seq 0xFB opt 0x52 flag 0x1 len 32  mtu 1500 state EXCHANGE
*Aug 20 01:06:30.671: OSPF: Exchange Done with 192.168.0.2 on Serial3/0
*Aug 20 01:06:30.675: OSPF: Send LS REQ to 192.168.0.2 length 12 LSA count 1
*Aug 20 01:06:30.675: OSPF: Send DBD to 192.168.0.2 on Serial3/0 seq 0xFB opt 0x52 flag 0x0 len 32
*Aug 20 01:06:31.055: OSPF: Rcv LS UPD from 192.168.0.2 on Serial3/0 length 64 LSA count 1
*Aug 20 01:06:31.059: OSPF: Synchronized with 192.168.0.2 on Serial3/0, state FULL
R1(config-if)#
*Aug 20 01:06:31.063: %OSPF-5-ADJCHG: Process 64, Nbr 192.168.0.2 on Serial3/0 from LOADING to FULL, Loading Done
R1(config-if)#
*Aug 20 01:06:32.407: OSPF: Rcv LS UPD from 192.168.0.2 on Serial3/0 length 60 LSA count 1
R1(config-if)#
*Aug 20 01:06:33.559: OSPF: Rcv LS UPD from 192.168.0.2 on Serial3/0 length 64 LSA count 1
R1(config-if)#
*Aug 20 01:06:35.491: OSPF: Build router LSA for area 0, router ID 192.168.0.1, seq 0x80000005
*Aug 20 01:06:36.163: OSPF: Rcv LS UPD from 192.168.0.2 on Serial3/0 length 76 LSA count 1
R1(config-if)#
R1(config-if)#
R1(config-if)#
*Aug 20 01:07:21.243: OSPF: Cannot see ourself in hello from 192.168.0.2 on Serial3/0, state INIT
*Aug 20 01:07:21.571: OSPF: 2 Way Communication to 192.168.0.2 on Serial3/0, state 2WAY
*Aug 20 01:07:21.575: OSPF: Send DBD to 192.168.0.2 on Serial3/0 seq 0xB28 opt 0x52 flag 0x7 len 32
*Aug 20 01:07:21.579: OSPF: Rcv DBD from 192.168.0.2 on Serial3/0 seq 0x1D27 opt 0x52 flag 0x7 len 32  mtu 1500 state EXSTART
*Aug 20 01:07:21.583: OSPF: NBR Negotiation Done. We are the SLAVE
*Aug 20 01:07:21.583: OSPF: Send DBD to 192.168.0.2 on Serial3/0 seq 0x1D27 opt 0x52 flag 0x2 len 92
*Aug 20 01:07:21.747: OSPF: Build router LSA for area 0, router ID 192.168.0.1, seq 0x80000006
R1(config-if)#
*Aug 20 01:07:21.771: OSPF: Rcv DBD from 192.168.0.2 on Serial3/0 seq 0x1D28 opt 0x52 flag 0x3 len 72  mtu 1500 state EXCHANGE
*Aug 20 01:07:21.775: OSPF: Send DBD to 192.168.0.2 on Serial3/0 seq 0x1D28 opt 0x52 flag 0x0 len 32
R1(config-if)#
*Aug 20 01:07:23.639: OSPF: Rcv DBD from 192.168.0.2 on Serial3/0 seq 0x1D29 opt 0x52 flag 0x1 len 32  mtu 1500 state EXCHANGE
*Aug 20 01:07:23.643: OSPF: Exchange Done with 192.168.0.2 on Serial3/0
*Aug 20 01:07:23.643: OSPF: Send LS REQ to 192.168.0.2 length 12 LSA count 1
*Aug 20 01:07:23.651: OSPF: Send DBD to 192.168.0.2 on Serial3/0 seq 0x1D29 opt 0x52 flag 0x0 len 32
*Aug 20 01:07:24.591: OSPF: Rcv LS UPD from 192.168.0.2 on Serial3/0 length 64 LSA count 1
*Aug 20 01:07:24.595: OSPF: Synchronized with 192.168.0.2 on Serial3/0, state FULL
R1(config-if)#
*Aug 20 01:07:24.595: %OSPF-5-ADJCHG: Process 64, Nbr 192.168.0.2 on Serial3/0 from LOADING to FULL, Loading Done
R1(config-if)#
*Aug 20 01:07:27.715: OSPF: Build router LSA for area 0, router ID 192.168.0.1, seq 0x80000007
R1(config-if)#
*Aug 20 01:07:30.063: OSPF: Rcv LS UPD from 192.168.0.2 on Serial3/0 length 60 LSA count 1
*Aug 20 01:07:30.863: OSPF: Rcv LS UPD from 192.168.0.2 on Serial3/0 length 76 LSA count 1
R1(config-if)#
R1(config-if)#
R1(config-if)#end
R1#
R1#

R2的网络类型改为点到点:

R2(config)#inter ser3/0
R2(config-if)#ip ospf net
R2(config-if)#ip ospf network po
R2(config-if)#ip ospf network point-to-po
R2(config-if)#ip ospf network point-to-point
R2(config-if)#
*Aug 20 01:07:36.511: %OSPF-5-ADJCHG: Process 64, Nbr 192.168.0.1 on Serial3/0 from FULL to DOWN, Neighbor Down: Interface down or detached
R2(config-if)#
*Aug 20 01:07:37.643: %OSPF-5-ADJCHG: Process 64, Nbr 192.168.0.1 on Serial3/0 from LOADING to FULL, Loading Done


R2(config-if)#

发表评论:

    昵称:
    密码:
    主页:
    标题:

Powered by Oblog.