2017年5月5日金曜日

OSPF Loopbackのオリジナルプレフィックス広告

◾️OSPF Loopbackのオリジナルプレフィックス広告

 【課題】
  ・R2のLoopbackアドレス(192.168.200.1/24)をエリア0へ広告する。
   ただし、広告ルートのプレフィックスは/32ではなくオリジナルプレフィックスにて
   広告する事。
  
 【補足】
   OSPF上のLoopbackアドレスではデフォルトでは/32で経路広告される仕様です。
   ※デフォルトではOSPFネットワークタイプはLOOPBACKであり、例えLookback IPの
   プレフィックスが/24でも/32で広告される。

◾️検証環境図



①検証環境 事前設定確認


(1)OSPFネイバー確認

 OSPFネイバーが正常に張れている事を確認する。
R1#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.2           1   FULL/DR         00:00:30    192.168.12.2    Ethernet0/1
4.4.4.4           1   FULL/DR         00:00:34    192.168.14.4    Ethernet0/0


R2#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1           1   FULL/BDR        00:00:33    192.168.12.1    Ethernet0/1
3.3.3.3           1   FULL/DR         00:00:38    192.168.23.3    Ethernet0/0


R3#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
4.4.4.4           1   FULL/DR         00:00:36    192.168.34.4    Ethernet0/1
2.2.2.2           1   FULL/BDR        00:00:33    192.168.23.2    Ethernet0/0


R4#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
3.3.3.3           1   FULL/BDR        00:00:34    192.168.34.3    Ethernet0/1
1.1.1.1           1   FULL/BDR        00:00:37    192.168.14.1    Ethernet0/0

(2)R2のLoopback200のインターフェース状態を確認する。
 設定上は192.168.200.1/24で設定されている事を確認する。

R2#show run int loopback 200

Building configuration...

Current configuration : 87 bytes
!
interface Loopback200
 ip address 192.168.200.1 255.255.255.0      //プレフィックス/24で設定されている
 ip ospf 1 area 0
end


R2#show ip ospf interface brief 

Interface    PID   Area            IP Address/Mask    Cost  State Nbrs F/C
Lo200        1     0               192.168.200.1/24   1     LOOP  0/0
Et0/1        1     0               192.168.12.2/24    10    BDR   1/1
Et0/0        1     0               192.168.23.2/24    10    BDR   1/1


R2#show ip ospf interface loopback 200

Loopback200 is up, line protocol is up 
  Internet Address 192.168.200.1/24, Area 0, Attached via Interface Enable
  Process ID 1, Router ID 2.2.2.2, Network Type LOOPBACK, Cost: 1
  Topology-MTID    Cost    Disabled    Shutdown      Topology Name
        0           1         no          no            Base
  Enabled by interface config, including secondary ip addresses
  Loopback interface is treated as a stub Host
※ネットワークタイプがLOOPBACKになっている。IPアドレスは/24になっている。


R2#sh ip ospf database router 


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

Router Link States (Area 0)

  LS age: 727
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 2.2.2.2
  Advertising Router: 2.2.2.2
  LS Seq Number: 80000009
  Checksum: 0xE4C2
  Length: 72
  Number of Links: 4

    Link connected to: a Stub Network
     (Link ID) Network/subnet number: 192.168.200.1
     (Link Data) Network Mask: 255.255.255.255     //  /24ではなく/32になっている。
      Number of MTID metrics: 0
       TOS 0 Metrics: 1

(3)R4にてR2のLoopback200(192.168.200.0/24)の経路を確認する。
 /32になっている事を確認する。

R4#sh ip route | section 192.168.200.0

      192.168.200.0/32 is subnetted, 1 subnets
O        192.168.200.1 [110/21] via 192.168.34.3, 00:03:53, Ethernet0/1
                       [110/21] via 192.168.14.1, 00:03:53, Ethernet0/0


③設定変更1(ospfネットワークタイプを変更する。)


(1)R2にてネットワークタイプをLOOPBACKからpoint-to-pointへ変更する。

R2(config)#int loopback 200

R2(config-if)#ip ospf network point-to-point 

(2)R2にて設定確認する。
R2#show ip ospf interface brief 
Interface    PID   Area            IP Address/Mask    Cost  State Nbrs F/C
Lo200        1     0               192.168.200.1/24   1     P2P   0/0
Et0/1        1     0               192.168.12.2/24    10    BDR   1/1
Et0/0        1     0               192.168.23.2/24    10    BDR   1/1


R2#show ip ospf interface loopback 200

Loopback200 is up, line protocol is up 
  Internet Address 192.168.200.1/24, Area 0, Attached via Interface Enable
  Process ID 1, Router ID 2.2.2.2, Network Type POINT_TO_POINT, Cost: 1
  Topology-MTID    Cost    Disabled    Shutdown      Topology Name
        0           1         no          no            Base
  Enabled by interface config, including secondary ip addresses
  Transmit Delay is 1 sec, State POINT_TO_POINT
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
  Supports Link-local Signaling (LLS)
  Cisco NSF helper support enabled
  IETF NSF helper support enabled
  Index 4/4, 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#sh ip ospf database router                


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

Router Link States (Area 0)

  LS age: 1088
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 1.1.1.1
  Advertising Router: 1.1.1.1
  LS Seq Number: 80000008
  Checksum: 0x52B9
  Length: 60
  Number of Links: 3


    Link connected to: a Stub Network

     (Link ID) Network/subnet number: 192.168.200.0
     (Link Data) Network Mask: 255.255.255.0        //  /32になっている。
      Number of MTID metrics: 0
       TOS 0 Metrics: 1

(3)R4にてR2のLoopback200(192.168.200.0/24)の経路を確認する。
 /24(オリジナルプレフィックス)になっている事を確認する。

R4#sh ip route | section 192.168.200.0

O     192.168.200.0/24 [110/21] via 192.168.34.3, 00:03:42, Ethernet0/1
                       [110/21] via 192.168.14.1, 00:03:42, Ethernet0/0