IPアンナンバード(ip unnumbered)
IOS12.2以降を搭載したCiscoルータを用意します。
下の図を見てください。

Router_A、Router_BのS0インターフェイスには、一意のIPアドレスを設定する必要があります。VLSMに対応していないルーティングプロトコルを使用する場合、「ホストビット数-2」のIPアドレスを失ってしまうことになります。
たとえ、VLSMに対応したルーティングプロトコルを使用したとしても、1つのネットワークアドレス(サブネット)を失うことになります。
「ip unnumbered」コマンドを使用すると、シリアルインターフェイスにIPアドレスを割り当てなくても、シリアルインターフェイスを有効にすることができます。

「ip unnumbered」を設定することで、ネットワークアドレスとアドレス空間を節約することができます。
「ip unnumbered」コマンド
「ip unnumbered」コマンドは、IPアドレスを設定しているインターフェイスから借り、コマンドで設定したインターフェイスに割り当てることで、2つのインターフェイスでIPアドレスを共有します。
Router(config-if)#ip unnumbered {type} {number}
「type」、「number」の指定には、IPアドレスを借りたいインターフェイスを指定します。このコマンドを実行したインターフェイスに借りたIPアドレスが割り当てます。 その結果、IPアドレスをが共有されることになります。
ちなみに、他のインターフェイスからIPアドレスを借りているインターフェイスのこと「unnumberedインターフェイス」と呼びます。
上の図でRouter_Aの設定は、以下のようになります。
●Router_A
Router_A(config)#int f0
Router_A(config)#ip address 172.16.0.1 255.255.255.0
Router_A(config)#no shutdown
Router_A(config)#exit
Router_A(config)#int s0
Router_A(config-if)#ip unnumbered f0
Router_A(config-if)#clock rate 64000
Router_A(config-if)#no shutdown
それでは、Router_A、Router_Bを設定してゆきましょう!ルーティングプロトコルには、RIPv2を使用します。
●Router_Aの設定
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Router_A
!
boot-start-marker
boot-end-marker
!
enable password cisco
!
no aaa new-model
ip subnet-zero
!
ip cef
!
interface FastEthernet0
ip address 172.16.0.1 255.255.255.0
speed auto
!
interface Serial0
ip unnumbered FastEthernet0
clockrate 64000
no fair-queue
!
router rip
version 2
network 172.16.0.0
!
ip classless
no ip http server
!
line con 0
line aux 0
line vty 0 4
password cisco
login
!
end
●Router_Bの設定
!
version 12.1
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname Router_B
!
enable password ccna
!
memory-size iomem 25
ip subnet-zero
!
interface Serial0
ip unnumbered FastEthernet0
no fair-queue
!
interface Serial1
no ip address
shutdown
!
interface FastEthernet0
ip address 172.16.1.1 255.255.255.0
no keepalive
speed auto
!
router rip
version 2
network 172.16.0.0
!
ip classless
no ip http server
!
line con 0
transport input none
line aux 0
line vty 0 4
password ccna
login
!
end
●show ip interface brief
設定が完了したら、F0、S0の2つのインターフェイスでIPアドレスを共有しているかを確認してみます。インターフェイスの要約を確認するために「show ip interface brief」でインターフェイスの状態を確認します。
Router#show ip interface brief
Router_A上で、「show ip interface brief」を実行します。
●「show ip interface brief」コマンドの出力
Router_A#show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0 172.16.0.1 YES NVRAM up up
Serial0 172.16.0.1 YES TFTP up up
「ip unnumbered」コマンドを使用することで、F0のアドレスをS0インターフェイスとで共有していることが確認できます。
●show ip interface serial 0
「show ip interface serial 0」コマンドを使ってインターフェイスのステータスを確認します。
●「show ip interface serial 0」コマンドの出力
Router_A#show ip interface serial 0
Serial0 is up, line protocol is up
Interface is unnumbered. Using address of FastEthernet0 (172.16.0.1)
Broadcast address is 255.255.255.255
MTU is 1500 bytes
Helper address is not set
Directed broadcast forwarding is disabled
Multicast reserved groups joined: 224.0.0.9
Outgoing access list is not set
Inbound access list is not set
・
・「Interface is unnumbered. Using address of FastEthernet0 (172.16.0.1)」
の出力から、F0のアドレスをS0インターフェイスとで共有していることが確認できます。
最後に、「show ip route」コマンドを使ってルーティングテーブルを表示させます。
●「show ip route」コマンドの出力
Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
C 172.16.0.0/24 is directly connected, FastEthernet0
R 172.16.0.0/16 [120/1] via 172.16.1.1, 00:00:10, Serial0
R 172.16.1.0/24 [120/1] via 172.16.1.1, 00:00:10, Serial0
