2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[Oracle Cloud] 落とし穴。予約済みのprivateIPについて (主にDBCS)

Posted at

はじめに

OCIに限らず、システム設計をする上でIPアドレスの割り振り設計は重要です
特にcloud等のサービスを使用する場合は、
制約がないか、つまりはサービスとして予約アドレスが存在しないかを確認する必要があります
本書ではOCIにおける予約アドレスの情報を整理します

VCN仕様

https://speakerdeck.com/ocise/ociji-shu-zi-liao-jia-xiang-kuraudonetutowaku-vcn-gai-yao
image.png
ここでのポイントは、

  • VCNのサイズは、/30 ~ /16
  • VCNで利用不可なのは、
    • 169.254.0.0/16
    • 192.168.16.16/28 ※これが重要、詳細後述

続いてサブネット、
image.png
ここでのポイント、

  • IPアドレスのうち、最初の2つと最後の一つは予約済みで使用不可
    • 10.0.0.0/24の場合は、
      • 10.0.0.0
      • 10.0.0.1
      • 10.0.0.255

頭とおしりはネットワークアドレス、ブロードキャストアドレスなので、
予約アドレスというよりは当たり前なのでは...と思いますが、

大事なのは最初から二番目(ネットワークアドレスを除けば先頭)が利用不可ということです
因みに二番目のアドレスはGWに使われています

DBCS仕様

さて、本題はここからです
結論としては既に上記にて触れましたが、
192.168.16.16/28
という極めて利用シーンの多そうなアドレス帯が使用できないということです

...ところが実機を確認すると
アドレスのレンジが上記と若干異なります
実際にDBCSのインスタンスにsshログインし、
ifconfigを打ってみます

[opc@dbhp1128 ~]$ ifconfig -a
ens3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9000
        inet 10.50.0.2  netmask 255.255.255.0  broadcast 10.50.0.255
        ether 02:00:17:00:12:7f  txqueuelen 1000  (Ethernet)
        RX packets 886788979  bytes 1232258229040 (1.1 TiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1137775390  bytes 3280516030839 (2.9 TiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens4: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9000
        inet 192.168.16.18  netmask 255.255.255.0  broadcast 192.168.16.255
        ether 02:00:17:00:12:81  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 8078  bytes 1913720 (1.8 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 0  (Local Loopback)
        RX packets 111933085  bytes 562376766864 (523.7 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 111933085  bytes 562376766864 (523.7 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[opc@dbhp1128 ~]$

10.50.0.2
は通常通りアサインしたアドレス、
...で、問題なのは、
192.168.16.18
ネットマスクが、
255.255.255.0
となっています
/24 になっている!!???

因みにルートテーブルは下記の通り、

[opc@dbhp1128 ~]$ netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         10.50.0.1       0.0.0.0         UG        0 0          0 ens3
10.50.0.0       0.0.0.0         255.255.255.0   U         0 0          0 ens3
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 ens3
192.168.16.0    0.0.0.0         255.255.255.0   U         0 0          0 ens4
[opc@dbhp1128 ~]$
[opc@dbhp1128 ~]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.5 (Maipo)
[opc@dbhp1128 ~]$

やはり見間違いではなく、/24
しかも 192.168.16.0/24 なんてメジャーなレンジ、
Oracle Cloud内に限らず、
例えばVPN越しに接続したオンプレ環境と
バッティングする可能性は大いにあると言えます

ありがとうございました

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?