如下拓扑:
只配置串口:
在R1上:
配置接口
1(config)#int s1/1
1(config-if)#ip add 192.168.1.1 255.255.255.0
1(config-if)#no shut
1(config-if)#exit
启动协议:
1(config)#router ospf 1
1(config-router)#net 192.168.1.0 0.0.0.255 area 0
1(config-router)#
在R2上:
配置接口:
2(config-if)#int s1/1
2(config-if)#ip add 192.168.2.1 255.255.255.0
2(config-if)#clock rate 56000
2(config-if)#no shut
启动协议:
2(config)#router ospf 1
2(config-router)#net 192.168.1.0 0.0.0.255 area 0
2(config-router)#net 192.168.2.0 0.0.0.255 area 0
2(config-router)#
在R3上:
配置接口:
3(config)#int s1/0
3(config-if)#ip add 192.168.2.2 255.255.255.0
3(config-if)#no shut
3(config-if)#
3(config-if)#exit
3(config)#router ospf 1
3(config-router)#net 192.168.2.0 0.0.0.255 area 0
3(config-router)#
测试:
在R1上:
1#show ip ospf nei
1#show ip ospf nei
1#show ip ospf nei 没有ADJ信息发生,hello后,形成邻居直接加载邻居数据库。(没选举)
Mar 12 09:28:25.707: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.1.2 on Serial1/1 from LOADING to FULL, Loading Done 没有选举那些步骤,直接LOADING
1#show ip ospf nei
Neighbor ID Pri State Dead Time Address Interface
192.168.1.2 0 FULL/ - 00:00:39 192.168.1.2 Serial1/1
1#
PPP网络:(二层封装的协议经常为PPP,默认为HDLC)
1#show int s1/1
Serial1/1 is up, line protocol is up
Hardware is M4T
Internet address is 192.168.1.1/24
MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation HDLC, crc 16, loopback not set
Keepalive set (10 sec)
Restart-Delay is 0 secs
Last input 00:00:04, output 00:00:05, output hang never
Last clearing of "show interface" counters never
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: weighted fair
Output queue: 0/1000/64/0 (size/max total/threshold/drops)
Conversations 0/1/256 (active/max active/max total)
Reserved Conversations 0/0 (allocated/max allocated)
Available Bandwidth 1158 kilobits/sec
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
69 packets input, 6060 bytes, 0 no buffer
Received 27 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
58 packets output, 4954 bytes, 0 underruns
0 output errors, 0 collisions, 1 interface resets
0 output buffer failures, 0 output buffers swapped out
2 carrier transitions DCD=up DSR=up DTR=up RTS=up CTS=up
1#
查看该接口的网络类型:
1#show ip ospf int s1/1
Serial1/1 is up, line protocol is up
Internet Address 192.168.1.1/24, Area 0
Process ID 1, Router ID 192.168.1.1, Network Type POINT_TO_POINT, Cost: 64(网络类型:点到点)
Transmit Delay is 1 sec, State POINT_TO_POINT
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:03
Supports Link-local Signaling (LLS)
Cisco NSF helper support enabled
IETF NSF helper support enabled
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 192.168.1.2
Suppress hello for 0 neighbor(s)
试验完成。