トポロジはCCstudyのシナリオとほぼ同じですが、出来れば一括で設定の練習をしたいということでR5を追加して、明示的にルータIDを指定するのと、パッシブインタフェースの設定も合わせて行っています。


■R1
R1(config)#int fa0/0
R1(config-if)#ip address 192.168.0.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#int loopback 0
R1(config-if)#ip address 1.1.1.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#ex
R1(config)#router ospf 100
R1(config-router)#network 192.168.0.1 0.0.0.0 area 0
R1(config-router)#exit
R1(config)#int fa0/0
R1(config-if)#ip ospf priority 100
R1(config-if)#end


■R2
Router(config)#hostname R2
R2(config)#int fa0/0
R2(config-if)#ip address 192.168.0.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#int loopback 0
R2(config-if)#ip address 2.2.2.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#exit
R2(config)#router ospf 100
R2(config-router)#network 192.168.0.2 0.0.0.0 area 0
R2(config-router)#exit
R2(config)#int fa0/0
R2(config-if)#ip ospf priority 0
R2(config-if)#end


■R3
R3(config)#int fa0/0
R3(config-if)#ip address 192.168.0.3 255.255.255.0
R3(config-if)#no shut
R3(config-if)#int loopback 0
R3(config-if)#ip address 3.3.3.3 255.255.255.0
R3(config-if)#no shut
R3(config-if)#ex
R3(config)#router ospf 100
R3(config-router)#network 192.168.0.3 0.0.0.0 area 0
R3(config-router)#exit
R3(config)#int fa0/0
R3(config-if)#ip ospf priority 2
R3(config-if)#end


■R4
R4(config)#int fa0/0
R4(config-if)#ip address 192.168.0.4 255.255.255.0
R4(config-if)#no shut
R4(config-if)#int loopback 0
R4(config-if)#ip address 4.4.4.4 255.255.255.0
R4(config-if)#no shut
R4(config-if)#ex
R4(config)#router ospf 100
R4(config-router)#network 192.168.0.4 0.0.0.0 area 0
R4(config-router)#ex


■R5
R5(config)#int fa0/0
R5(config-if)#ip address 192.168.0.5 255.255.255.0
R5(config-if)#no shut
R5(config-if)#int loopback 0
R5(config-if)#ip addres
R5(config-if)#ip address 5.5.5.5 255.255.255.0
R5(config-if)#no shut
R5(config-if)#ex
R5(config)#router ospf 100
R5(config-router)#network 192.168.0.5 0.0.0.0 area 0
R5(config-router)#ex


■R1のネイバーを確認する
R1#sh ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface
5.5.5.5 1 FULL/DROTHER 00:00:39 192.168.0.5 FastEthernet0/0
4.4.4.4 1 FULL/DROTHER 00:00:30 192.168.0.4 FastEthernet0/0
3.3.3.3 2 FULL/BDR 00:00:35 192.168.0.3 FastEthernet0/0
2.2.2.2 0 FULL/DROTHER 00:00:30 192.168.0.2 FastEthernet0/0


■R1のOSPFインタフェースを確認する
R1#sh ip ospf int fa0/0
FastEthernet0/0 is up, line protocol is up
Internet Address 192.168.0.1/24, Area 0
Process ID 100, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State DR, Priority 100
Designated Router (ID) 1.1.1.1, Interface address 192.168.0.1
Backup Designated router (ID) 3.3.3.3, Interface address 192.168.0.3
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:00
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 2
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 4, Adjacent neighbor count is 4
Adjacent with neighbor 5.5.5.5
Adjacent with neighbor 4.4.4.4
Adjacent with neighbor 3.3.3.3 (Backup Designated Router)
Adjacent with neighbor 2.2.2.2
Suppress hello for 0 neighbor(s)


■R5のルータIDを明示的に指定する
現在、R5のルータIDはループバックインタフェースアドレス5.5.5.5/24が割り当てられています。
それを明示的に100.100.100.100というアドレスに指定します。
R5(config)#router ospf 100
R5(config-router)#router-id 100.100.100.100
Reload or use "clear ip ospf process" command, for this to take effect
R5(config-router)#end
R5#clear ip ospf 100 process
Reset OSPF process? [no]: yes
R5#
Mar 1 01:17:02.943: %OSPF-5-ADJCHG: Process 100, Nbr 1.1.1.1 on FastEthernet0/0 from FULL to DOWN, Neighbor Down: Interface down or detached
Mar 1 01:17:02.943: %OSPF-5-ADJCHG: Process 100, Nbr 2.2.2.2 on FastEthernet0/0 from 2WAY to DOWN, Neighbor Down: Interface down or detached
Mar 1 01:17:02.943: %OSPF-5-ADJCHG: Process 100, Nbr 3.3.3.3 on FastEthernet0/0 from FULL to DOWN, Neighbor Down: Interface down or detached
Mar 1 01:17:02.947: %OSPF-5-ADJCHG: Process 100, Nbr 4.4.4.4 on FastEthernet0/0 from EXSTART to DOWN, Neighbor Down: Interface down or detached
Mar 1 01:17:07.527: %OSPF-5-ADJCHG: Process 100, Nbr 3.3.3.3 on FastEthernet0/0 from LOADING to FULL, Loading Done
Mar 1 01:17:07.531: %OSPF-5-ADJCHG: Process 100, Nbr 1.1.1.1 on FastEthernet0/0 from LOADING to FULL, Loading Done


■R5でトポロジーテーブル(LSDB)を確認する
R5#sh ip ospf database

OSPF Router with ID (100.100.100.100) (Process ID 100)

Router Link States (Area 0)

Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 165 0x80000003 0x006EE5 1
2.2.2.2 2.2.2.2 40 0x80000003 0x00301B 1
3.3.3.3 3.3.3.3 1830 0x80000002 0x00F34F 1
4.4.4.4 4.4.4.4 1429 0x80000002 0x00B584 1
100.100.100.100 100.100.100.100 88 0x80000002 0x00270F 1

Net Link States (Area 0)

Link ID ADV Router Age Seq# Checksum
192.168.0.1 1.1.1.1 59 0x80000006 0x0056AA


■R5のfa0/1にパッシブインタフェースを設定する
R5(config)#int fa0/1
R5(config-if)#ip address 10.10.10.10 255.255.255.0
R5(config-if)#no shut
R5(config-if)#ex
R5(config)#router ospf 100
R5(config-router)#network 10.10.10.10 0.0.0.0 area 0
R5(config-router)#passive-interface fa0/1
R5(config-router)#end


■R5にパッシブインタフェースが設定されているか確認する
R5#sh ip protocols
Routing Protocol is "ospf 100"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Router ID 100.100.100.100
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
Maximum path: 4
Routing for Networks:
10.10.10.10 0.0.0.0 area 0
192.168.0.5 0.0.0.0 area 0
Reference bandwidth unit is 100 mbps
Passive Interface(s):
FastEthernet0/1
Routing Information Sources:
Gateway Distance Last Update
Distance: (default is 110)


■R5でOSPFの送出パケットを確認する
10秒間隔でHELLOパケットが送出されていますが、fa0/1からはOSPFパケットは送出されていません。
R5#debug ip ospf packet
OSPF packet debugging is on
R5#
Mar 1 01:34:32.259: OSPF: rcv. v:2 t:1 l:60 rid:2.2.2.2
aid:0.0.0.0 chk:8E5D aut:0 auk: from FastEthernet0/0
Mar 1 01:34:32.911: OSPF: rcv. v:2 t:1 l:60 rid:4.4.4.4
aid:0.0.0.0 chk:8E5C aut:0 auk: from FastEthernet0/0
Mar 1 01:34:35.743: OSPF: rcv. v:2 t:1 l:60 rid:1.1.1.1
aid:0.0.0.0 chk:9DF9 aut:0 auk: from FastEthernet0/0
Mar 1 01:34:37.495: OSPF: rcv. v:2 t:1 l:60 rid:3.3.3.3
aid:0.0.0.0 chk:9E5B aut:0 auk: from FastEthernet0/0
Mar 1 01:34:42.259: OSPF: rcv. v:2 t:1 l:60 rid:2.2.2.2
aid:0.0.0.0 chk:8E5D aut:0 auk: from FastEthernet0/0
Mar 1 01:34:42.911: OSPF: rcv. v:2 t:1 l:60 rid:4.4.4.4
aid:0.0.0.0 chk:8E5C aut:0 auk: from FastEthernet0/0
Mar 1 01:34:45.743: OSPF: rcv. v:2 t:1 l:60 rid:1.1.1.1
aid:0.0.0.0 chk:9DF9 aut:0 auk: from FastEthernet0/0
Mar 1 01:34:47.495: OSPF: rcv. v:2 t:1 l:60 rid:3.3.3.3
aid:0.0.0.0 chk:9E5B aut:0 auk: from FastEthernet0/0


■10.10.10.100/24から192.168.0.1/24にping
C:\Documents and Settings\10.10.10.100>ping 192.168.0.1

Pinging 192.168.0.1 with 32 bytes of data:

Reply from 192.168.0.1: bytes=32 time=1ms TTL=155
Reply from 192.168.0.1: bytes=32 time=1ms TTL=155
Reply from 192.168.0.1: bytes=32 time=2ms TTL=155
Reply from 192.168.0.1: bytes=32 time=2ms TTL=155

Ping statistics for 192.168.0.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 2ms, Average = 1ms

C:\Documents and Settings\USER>