0
1

More than 1 year has passed since last update.

[Oracle Cloud] 相互接続された VCN とオンプレミスで DNSピアリング(Forwarding)してみてみた

Last updated at Posted at 2023-01-09

DNS はホスト名を IP アドレスに変換するために使用される機能です。Oracle Cloud Infrastructure(OCI)内では、各VCNに独自のリゾルバがあり、VCNおよびインターネット内で名前を解決できます。
OCI プライベート DNS の実装により、オンプレミスに配置された他の DNS リゾルバまたはリファレンス アーキテクチャに従う他の VCN とのピアリング関係を確立できます。
定義したルールに基づいて、VCN リゾルバーはリクエストを別のリゾルバーに転送(Forwarding)します。同様に、他のリゾルバーからのリクエストをリッスンできます。
ということで、相互接続した複数のOCIリージョンとオンプレミス間をお互い DNS Forwarding して名前解決できるようにしてみてみます。

■ 構成

構成2.jpg

次を参考に構成図の内容を構築しておきます。
今回は、CISCO 841M へ接続した Raspberry Pi へ Bind9 をインストールして DNSサーバーを作成し、OCI と 相互に DNS Forwardingをして名前解決できるようにします。
そして追加で、Oracle Base Database Service の Oracle Real Application Clusters(RAC)構成でも名前解決できることを確認するために、RAC の 複数のIPアドレスで構成されるSCANホスト名に対して名前解決できて通信できることを確認します。

・参考
 - Private DNS: Private DNSで PeeringしたVCNどうしホスト名(FQDN)で通信できるようにしてみてみた
  - Remote Peering: リージョン間を Remote VCN Peering してみてみた
  - Trunsit Peering: DRGで東京リージョンを経由して、オンプレミスと 大阪リージョンを接続してみてみた
  - VPN BGP: Cisco 841M ルーターを IKEv2 と BGPで IPSec VPN接続してみてみた

■ Raspberry Pi へ DNSサーバー構築

Raspberry Pi は Debian系OS の Raspbianです。
ということで、apt-getコマンドで パッケージをインストールします。

● Bind9 インストール

1) Raspbery Piログイン

user@mac-book ~ % ssh pi@192.168.0.250
	pi@192.168.0.250's password:
	Linux raspberrypi 5.4.83-v7+ #1379 SMP Mon Dec 13 13:08:57 GMT 2020 armv7l

	The programs included with the Debian GNU/Linux system are free software;
	the exact distribution terms for each program are described in the
	individual files in /usr/share/doc/*/copyright.

	Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
	permitted by applicable law.
	Last login: Mon Dec 19 20:24:09 2022
pi@raspberrypi:~ $

2) Install bind9

pi@raspberrypi:~ $ sudo apt-get install bind9
	パッケージリストを読み込んでいます... 完了
	依存関係ツリーを作成しています
	状態情報を読み取っています... 完了
	以下の追加パッケージがインストールされます:
	bind9utils dns-root-data python3-ply
	提案パッケージ:
	bind9-doc dnsutils ufw python-ply-doc
	以下のパッケージが新たにインストールされます:
	bind9 bind9utils dns-root-data python3-ply
	アップグレード: 0 個、新規インストール: 4 個、削除: 0 個、保留: 0 個。
	1,080 kB のアーカイブを取得する必要があります。
	この操作後に追加で 3,653 kB のディスク容量が消費されます。
	続行しますか? [Y/n] Y
	取得:1 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian buster/main armhf python3-ply all 3.11-3 [65.1 kB]
	取得:2 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian buster/main armhf bind9utils armhf 1:9.11.5.P4+dfsg-5.1+deb10u2 [422 kB]
	取得:3 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian buster/main armhf dns-root-data all 2019031302 [5,396 B]
	取得:4 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian buster/main armhf bind9 armhf 1:9.11.5.P4+dfsg-5.1+deb10u2 [587 kB]
	1,080 kB を 3秒 で取得しました (312 kB/s)
	パッケージを事前設定しています ...
	以前に未選択のパッケージ python3-ply を選択しています。
	(データベースを読み込んでいます ... 現在 163637 個のファイルとディレクトリがインストールされています。)
	.../python3-ply_3.11-3_all.deb を展開する準備をしています ...
	python3-ply (3.11-3) を展開しています...
	以前に未選択のパッケージ bind9utils を選択しています。
	.../bind9utils_1%3a9.11.5.P4+dfsg-5.1+deb10u2_armhf.deb を展開する準備をしています ...
	bind9utils (1:9.11.5.P4+dfsg-5.1+deb10u2) を展開しています...
	以前に未選択のパッケージ dns-root-data を選択しています。
	.../dns-root-data_2019031302_all.deb を展開する準備をしています ...
	dns-root-data (2019031302) を展開しています...
	以前に未選択のパッケージ bind9 を選択しています。
	.../bind9_1%3a9.11.5.P4+dfsg-5.1+deb10u2_armhf.deb を展開する準備をしています ...
	bind9 (1:9.11.5.P4+dfsg-5.1+deb10u2) を展開しています...
	python3-ply (3.11-3) を設定しています ...
	dns-root-data (2019031302) を設定しています ...
	bind9utils (1:9.11.5.P4+dfsg-5.1+deb10u2) を設定しています ...
	bind9 (1:9.11.5.P4+dfsg-5.1+deb10u2) を設定しています ...
	グループ `bind' (グループ ID 124) を追加しています...
	完了。
	システムユーザ `bind' (UID 115) を追加しています...
	新しいユーザ `bind' (UID 115) をグループ `bind' に追加しています...
	ホームディレクトリ `/var/cache/bind' は作成しません。
	wrote key file "/etc/bind/rndc.key"
	Created symlink /etc/systemd/system/multi-user.target.wants/bind9.service → /lib/systemd/system/bind9.service.
	bind9-pkcs11.service is a disabled or a static unit, not starting it.
	bind9-resolvconf.service is a disabled or a static unit, not starting it.
	man-db (2.8.5-2) のトリガを処理しています ...
	systemd (241-7~deb10u5+rpi1) のトリガを処理しています ...

● dnsutils インストール

DNS 関連の各種クライアントプログラムである dnsutilsをインストール

pi@raspberrypi:~ $ sudo apt-get install dnsutils
	パッケージリストを読み込んでいます... 完了
	依存関係ツリーを作成しています... 50%

	依存関係ツリーを作成しています
	状態情報を読み取っています... 完了
	以下の追加パッケージがインストールされます:
	libirs161
	提案パッケージ:
	rblcheck
	以下のパッケージが新たにインストールされます:
	dnsutils libirs161
	アップグレード: 0 個、新規インストール: 2 個、削除: 0 個、保留: 0 個。
	596 kB のアーカイブを取得する必要があります。
	この操作後に追加で 952 kB のディスク容量が消費されます。
	取得:1 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian buster/main armhf libirs161 armhf 1:9.11.5.P4+dfsg-5.1+deb10u2 [235 kB]
	取得:2 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian buster/main armhf dnsutils armhf 1:9.11.5.P4+dfsg-5.1+deb10u2 [360 kB]
	596 kB を 2秒 で取得しました (247 kB/s)
	以前に未選択のパッケージ libirs161:armhf を選択しています。
	(データベースを読み込んでいます ... 現在 163790 個のファイルとディレクトリがインストールされています。)
	.../libirs161_1%3a9.11.5.P4+dfsg-5.1+deb10u2_armhf.deb を展開する準備をしています ...
	libirs161:armhf (1:9.11.5.P4+dfsg-5.1+deb10u2) を展開しています...
	以前に未選択のパッケージ dnsutils を選択しています。
	.../dnsutils_1%3a9.11.5.P4+dfsg-5.1+deb10u2_armhf.deb を展開する準備をしています ...
	dnsutils (1:9.11.5.P4+dfsg-5.1+deb10u2) を展開しています...
	libirs161:armhf (1:9.11.5.P4+dfsg-5.1+deb10u2) を設定しています ...
	dnsutils (1:9.11.5.P4+dfsg-5.1+deb10u2) を設定しています ...
	libc-bin (2.28-10+rpi1) のトリガを処理しています ...
	man-db (2.8.5-2) のトリガを処理しています ...

■ Raspberry Pi へ ファイアウォール (UFW)設定

● Uncomplicated FireWall (ufw)インストール

ファイアウォール (ufw) をインストールして DNS 53番ポートのみアクセスできるようにします。

pi@raspberrypi:~ $ sudo apt-get install ufw
	パッケージリストを読み込んでいます... 完了
	依存関係ツリーを作成しています
	状態情報を読み取っています... 完了
	以下のパッケージが新たにインストールされます:
	ufw
	アップグレード: 0 個、新規インストール: 1 個、削除: 0 個、保留: 0 個。
	164 kB のアーカイブを取得する必要があります。
	この操作後に追加で 852 kB のディスク容量が消費されます。
	取得:1 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian buster/main armhf ufw all 0.36-1 [164 kB]
	164 kB を 2秒 で取得しました (78.9 kB/s)
	パッケージを事前設定しています ...
	以前に未選択のパッケージ ufw を選択しています。
	(データベースを読み込んでいます ... 現在 163812 個のファイルとディレクトリがインストールされています。)
	.../archives/ufw_0.36-1_all.deb を展開する準備をしています ...
	ufw (0.36-1) を展開しています...
	ufw (0.36-1) を設定しています ...

	Creating config file /etc/ufw/before.rules with new version

	Creating config file /etc/ufw/before6.rules with new version

	Creating config file /etc/ufw/after.rules with new version

	Creating config file /etc/ufw/after6.rules with new version
	Created symlink /etc/systemd/system/multi-user.target.wants/ufw.service → /lib/systemd/system/ufw.service.
	man-db (2.8.5-2) のトリガを処理しています ...
	rsyslog (8.1901.0-1) のトリガを処理しています ...
	systemd (241-7~deb10u5+rpi1) のトリガを処理しています ...

● ファイアウォール (UFW)設定

1) ステータス確認

有効化するとsshの接続を切断されるので注意
まずは、初期状態 inactive であることを確認

pi@raspberrypi:~ $ sudo ufw status
	Status: inactive

2) SSH 22/tcp 有効化

pi@raspberrypi:~ $ sudo ufw allow 22/tcp
	Rules updated
	Rules updated (v6)

3) DNS 53/tcp 有効化

pi@raspberrypi:~ $ sudo ufw allow 53/tcp
	Rules updated
	Rules updated (v6)

4) DNS 53/udp 有効化

pi@raspberrypi:~ $ sudo ufw allow 53/udp
	Rules updated
	Rules updated (v6)

5) ファイアウォール (UFW)有効化

pi@raspberrypi:~ $ sudo ufw enable
	Command may disrupt existing ssh connections. Proceed with operation (y|n)?  y
	Firewall is active and enabled on system startup

6) ステータス確認

pi@raspberrypi:~ $ sudo ufw status verbose
	Status: active
	Logging: on (low)
	Default: deny (incoming), allow (outgoing), disabled (routed)
	New profiles: skip

	To                         Action      From
	--                         ------      ----
	53/udp                     ALLOW IN    Anywhere
	22/tcp                     ALLOW IN    Anywhere
	53/tcp                     ALLOW IN    Anywhere
	53/udp (v6)                ALLOW IN    Anywhere (v6)
	22/tcp (v6)                ALLOW IN    Anywhere (v6)
	53/tcp (v6)                ALLOW IN    Anywhere (v6)

■ DNSサーバー設定

● 初期ディレクトリ確認

pi@raspberrypi:~ $ ls -l /etc/bind
	合計 48
	-rw-r--r-- 1 root root 2761  8月 25 17:10 bind.keys
	-rw-r--r-- 1 root root  237  8月 25 17:10 db.0
	-rw-r--r-- 1 root root  271  8月 25 17:10 db.127
	-rw-r--r-- 1 root root  237  8月 25 17:10 db.255
	-rw-r--r-- 1 root root  353  8月 25 17:10 db.empty
	-rw-r--r-- 1 root root  270  8月 25 17:10 db.local
	-rw-r--r-- 1 root bind  463  8月 25 17:10 named.conf
	-rw-r--r-- 1 root bind  498  8月 25 17:10 named.conf.default-zones
	-rw-r--r-- 1 root bind  165  8月 25 17:10 named.conf.local
	-rw-r--r-- 1 root bind  846  8月 25 17:10 named.conf.options
	-rw-r----- 1 bind bind   77  2月  2 20:55 rndc.key
	-rw-r--r-- 1 root root 1317  8月 25 17:10 zones.rfc1918

● named.conf確認

pi@raspberrypi:~ $ cat /etc/bind/named.conf
	// This is the primary configuration file for the BIND DNS server named.
	//
	// Please read /usr/share/doc/bind9/README.Debian.gz for information on the
	// structure of BIND configuration files in Debian, *BEFORE* you customize
	// this configuration file.
	//
	// If you are just adding zones, please do that in /etc/bind/named.conf.local

	include "/etc/bind/named.conf.options";
	include "/etc/bind/named.conf.local";
	#include "/etc/bind/named.conf.default-zones";

● /etc/bind/named.conf.options設定

1) バックアップ

pi@raspberrypi:~ $ sudo cp /etc/bind/named.conf.options /etc/bind/named.conf.options.org

2) デフォルト確認

pi@raspberrypi:~ $ cat /etc/bind/named.conf.options
acl localnet {
    127.0.0.1;
    192.168.0.0/24;
};

options {
	directory "/var/cache/bind";

    allow-query { localnet; };
    allow-transfer { none; };

	// If there is a firewall between you and nameservers you want
	// to talk to, you may need to fix the firewall to allow multiple
	// ports to talk.  See http://www.kb.cert.org/vuls/id/800113

	// If your ISP provided one or more IP addresses for stable
	// nameservers, you probably want to use them as forwarders.
	// Uncomment the following block, and insert the addresses replacing
	// the all-0's placeholder.

	// forwarders {
	// 	0.0.0.0;
	// };
    forwarders { 10.0.1.253; 10.0.1.254; 1.1.1.1; };
//    forward only;

	//========================================================================
	// If BIND logs error messages about the root key being expired,
	// you will need to update your keys.  See https://www.isc.org/bind-keys
	//========================================================================
	dnssec-validation auto;

	listen-on-v6 { none; };
};

3) 設定

設定項目
・listen-on port [ポート番号] { [IPアドレス]; …. };
	DNSサービスへのアクセスが可能なものを指定
	LISTENするIPアドレスを指定
・allow-query-cache { [IPアドレス、ネットワークアドレスまたはACL名]}
	DNSクエリーを許可するネットワークを定義して制限
・forwarders
	再帰問い合わせ先を指定
・recursion
	再帰問い合わせ機能を利用する場合 yes 
pi@raspberrypi:~ $ cat /etc/bind/named.conf.options
	options {
	  directory "/var/cache/bind";
	  listen-on port 53 { localhost; 192.168.0.0/24; };
	  allow-query { localhost; 192.168.0.0/24; 10.0.0.0/8; };
	  forwarders { 192.168.0.1; 10.0.250.251; };
	  recursion yes;
	};

4) 設定確認

pi@raspberrypi:~ $ cat /etc/bind/named.conf.options
options {
	directory "/var/cache/bind";
	listen-on port 53 { localhost; 192.168.0.0/24; };
	allow-query { localhost; 192.168.0.0/24; 10.0.0.252; };
	forwarders { 10.0.250.251; };
	recursion yes;
};

● /etc/bind/named.conf.local 設定

1) バックアップ

pi@raspberrypi:~ $ sudo cp /etc/bind/named.conf.local /etc/bind/named.conf.local.org

2) デフォルト確認

pi@raspberrypi:~ $ cat /etc/bind/named.conf.local
//
// Do any local configuration here
//

// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";
zone "shirok.ga" IN {
          type master;
          file "/etc/bind/shirok.ga.db";
          check-names ignore;
};

zone "100.168.192.in-addr.arpa" IN {
          type master;
          file "/etc/bind/100.168.192.rev";
};

3) 設定

pi@raspberrypi:~ $ cat /etc/bind/named.conf.local
zone "shirok.net" IN {
  type master;
  file "shirok.net.zone";
};

● /var/cache/bind/shirok.net.zone 設定

pi@raspberrypi:~ $ cat /var/cache/bind/shirok.net.zone

$TTL 86400

@ IN SOA shirok.net root.shirok.net (
  2017062705
  3600
  900
  604800
  86400
)

@               IN NS           raspberrypi
raspberrypi     IN A            192.168.0.250
router          IN A            192.168.0.1
mac-book    	IN A            192.168.0.2
dns             IN CNAME        raspberrypi

■ Bind設定の検証

1) named-checkconf で /etc/bind/named.conf ファイルを検証

pi@raspberrypi:~ $ sudo /usr/sbin/named-checkconf
pi@raspberrypi:~ $ 
<-- なにも出力されなければ成功

2) named-checkzoneでzoneファイルを検証

pi@raspberrypi:~ $ sudo /usr/sbin/named-checkzone shirok.net /var/cache/bind/shirok.net.zone
	zone shirok.net/IN: loaded serial 2017062705
	OK

■ BIND9 起動

1) BIND9 起動

pi@raspberrypi:~ $ sudo systemctl start bind9

2) BIND9 再起動

pi@raspberrypi:~ $ sudo systemctl restart bind9

3) BIND9 状態確認

pi@raspberrypi:~ $ sudo systemctl status bind9
● bind9.service - BIND Domain Name Server
   Loaded: loaded (/lib/systemd/system/bind9.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2022-12-18 12:45:05 JST; 29s ago
     Docs: man:named(8)
  Process: 924 ExecStart=/usr/sbin/named $OPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 925 (named)
    Tasks: 7 (limit: 2063)
   CGroup: /system.slice/bind9.service
           └─925 /usr/sbin/named -u bind

12月 18 12:45:05 raspberrypi named[925]: command channel listening on ::1#953
12月 18 12:45:05 raspberrypi named[925]: managed-keys-zone: journal file is out of date: removing journal file
12月 18 12:45:05 raspberrypi named[925]: managed-keys-zone: loaded serial 901
12月 18 12:45:05 raspberrypi named[925]: zone shirok.net/IN: loading from master file shirok.net.zone failed: file not found
12月 18 12:45:05 raspberrypi named[925]: zone shirok.net/IN: not loaded due to errors.
12月 18 12:45:05 raspberrypi named[925]: all zones loaded
12月 18 12:45:05 raspberrypi named[925]: running
12月 18 12:45:05 raspberrypi systemd[1]: Started BIND Domain Name Server.
12月 18 12:45:07 raspberrypi named[925]: managed-keys-zone: Key 20326 for zone . acceptance timer complete: key now trusted
12月 18 12:45:07 raspberrypi named[925]: resolver priming query complete

■ BIND9 動作確認

● /etc/resolv.conf 設定

root@raspberrypi:/etc/bind# cat /etc/resolv.conf
	# Generated by resolvconf
	nameserver 192.168.0.1

● ローカル・ドメイン PCへの名前解決確認

1) nslookup 確認

pi@raspberrypi:~ $ nslookup raspberrypi.shirok.net
	Server:		192.168.0.250
	Address:	192.168.0.250#53

	Name:	raspberrypi.shirok.net
	Address: 192.168.0.250

pi@raspberrypi:~ $ nslookup mac-book.shirok.net
	Server:		192.168.0.250
	Address:	192.168.0.250#53

	Name:	mac-book.shirok.net
	Address: 192.168.0.2

2) 名前での ping確認

pi@raspberrypi:~ $ ping raspberrypi.shirok.net -c 3
	PING raspberrypi.shirok.net (192.168.0.250) 56(84) bytes of data.
	64 bytes from 192.168.0.250 (192.168.0.250): icmp_seq=1 ttl=64 time=0.184 ms
	64 bytes from 192.168.0.250 (192.168.0.250): icmp_seq=2 ttl=64 time=0.185 ms
	64 bytes from 192.168.0.250 (192.168.0.250): icmp_seq=3 ttl=64 time=0.156 ms

	--- raspberrypi.shirok.net ping statistics ---
	3 packets transmitted, 3 received, 0% packet loss, time 37ms
	rtt min/avg/max/mdev = 0.156/0.175/0.185/0.013 ms

pi@raspberrypi:~ $ ping mac-book.shirok.net -c 4
	PING mac-book.shirok.net (192.168.0.2) 56(84) bytes of data.
	64 bytes from 192.168.0.2 (192.168.0.2): icmp_seq=1 ttl=64 time=0.823 ms
	64 bytes from 192.168.0.2 (192.168.0.2): icmp_seq=2 ttl=64 time=1.07 ms
	64 bytes from 192.168.0.2 (192.168.0.2): icmp_seq=3 ttl=64 time=0.989 ms
	64 bytes from 192.168.0.2 (192.168.0.2): icmp_seq=4 ttl=64 time=1.07 ms

	--- mac-book.shirok.net ping statistics ---
	4 packets transmitted, 4 received, 0% packet loss, time 7ms
	rtt min/avg/max/mdev = 0.823/0.987/1.073/0.105 ms

■ OCI Private DNS設定

プライベートDNSリゾルバは、VCN内のDNS解決を、VCN間とVCN間とオンプレミス・ネットワーク間に提供します。

● TOKYO-VCN のプライベート・リゾルバのルール設定

1) プライベート・リゾルバの詳細画面

「プライベート・リゾルバの詳細」画面で、「リソース」列の「ルール」をクリック
VCN-10.0.0.0-Private-Resolva-Rule01.jpg

2) ルール画面

「ルールの管理」をクリックし、osaka.oraclevcn.com と shirok.net の問い合わせ先を設定し、「変更の保存」をクリック

設定項目
・osaka.oraclevcn.com の問い合わせ先設定
	・ルール条件: [ドメイン]し、問合せの元のドメイン(最大10個のホスト名)に基づいてルーティング決定がされます。
	・ルール・アクション: このフィールドは読取り専用です。「転送」が唯一のオプションです。
	・ソース・エンドポイント: ルール条件が満たされたときに問合せを転送するために使用されるプライベート・エンドポイントを選択
	・宛先IPアドレス: 転送する VCN_OSAKA の Listning エンドポイント・アドレス 10.5.250.251 を入力

・shirok の問い合わせ先設定
	・ルール条件: [ドメイン]し、問合せの元のドメイン(最大10個のホスト名)に基づいてルーティング決定がされます。
	・ルール・アクション: このフィールドは読取り専用です。「転送」が唯一のオプションです。
	・ソース・エンドポイント: ルール条件が満たされたときに問合せを転送するために使用されるプライベート・エンドポイントを選択
	・宛先IPアドレス: 転送するオンプレミス の DNSサーバーのアドレス 192.168.0.250 を入力

VCN-10.0.0.0-Private-Resolva-Rule02.jpg

3) 設定確認

VCN-10.0.0.0-Private-Resolva-Rule03.jpg

● OSAKA-VCN のプライベート・リゾルバのルール設定

1) プライベート・リゾルバの詳細画面

「プライベート・リゾルバの詳細」画面で、「リソース」列の「ルール」をクリック
VCN-10.5.0.0-Private-Resolva-Rule01.jpg

2) ルール画面

「ルールの管理」をクリックし、tokyo.oraclevcn.com と shirok.net の問い合わせ先を設定し、「変更の保存」をクリック

設定項目
・tokyo.oraclevcn.com の問い合わせ先設定
	- ルール条件: [ドメイン]し、問合せの元のドメイン(最大10個のホスト名)に基づいてルーティング決定がされます。
	- ルール・アクション: このフィールドは読取り専用です。「転送」が唯一のオプションです。
	- ソース・エンドポイント: ルール条件が満たされたときに問合せを転送するために使用されるプライベート・エンドポイントを選択
	- 宛先IPアドレス: 転送する VCN_OSAKA の Listning エンドポイント・アドレス 10.0.250.251 を入力

・shirok.net の問い合わせ先設定
	- ルール条件: [ドメイン]し、問合せの元のドメイン(最大10個のホスト名)に基づいてルーティング決定がされます。
	- ルール・アクション: このフィールドは読取り専用です。「転送」が唯一のオプションです。
	- ソース・エンドポイント: ルール条件が満たされたときに問合せを転送するために使用されるプライベート・エンドポイントを選択
	- 宛先IPアドレス: 転送するオンプレミス の DNSサーバーのアドレス 10.0.250.251 もしくは 192.168.0.250 を入力

VCN-10.5.0.0-Private-Resolva-Rule02.jpg

3) 設定確認

VCN-10.5.0.0-Private-Resolva-Rule03.jpg

■ オンプレミス -> OCI への名前解決確認

● On-Premises -> OCI Tokyo-Inst への名前解決確認

1) nslookup

pi@raspberrypi:~ $ nslookup tokyo-inst.private.tokyo.oraclevcn.com
	Server:		192.168.0.250
	Address:	192.168.0.250#53

	Non-authoritative answer:
	Name:	tokyo-inst.private.tokyo.oraclevcn.com
	Address: 10.0.0.2

2) ping確認

pi@raspberrypi:~ $ ping tokyo-inst.private.tokyo.oraclevcn.com -c 3
	PING tokyo-inst.private.tokyo.oraclevcn.com (10.0.0.2) 56(84) bytes of data.
	64 bytes from 10.0.0.2 (10.0.0.2): icmp_seq=1 ttl=60 time=10.4 ms
	64 bytes from 10.0.0.2 (10.0.0.2): icmp_seq=2 ttl=60 time=23.4 ms
	64 bytes from 10.0.0.2 (10.0.0.2): icmp_seq=3 ttl=60 time=38.2 ms

	--- tokyo-inst.private.tokyo.oraclevcn.com ping statistics ---
	3 packets transmitted, 3 received, 0% packet loss, time 6ms
	rtt min/avg/max/mdev = 10.377/23.967/38.173/11.356 ms

● On-Premises -> OCI Osaka への名前解決確認

1) nslookup

root@raspberrypi:/var/cache/bind# nslookup osaka-inst.private.osaka.oraclevcn.com
	Server:		192.168.0.250
	Address:	192.168.0.250#53

	Non-authoritative answer:
	Name:	osaka-inst.private.osaka.oraclevcn.com
	Address: 10.5.0.2

2) ping確認

root@raspberrypi:/var/cache/bind# ping osaka-inst.private.osaka.oraclevcn.com -c 3
	PING osaka-inst.private.osaka.oraclevcn.com (10.5.0.2) 56(84) bytes of data.
	64 bytes from 10.5.0.2 (10.5.0.2): icmp_seq=1 ttl=59 time=27.3 ms
	64 bytes from 10.5.0.2 (10.5.0.2): icmp_seq=2 ttl=59 time=20.6 ms
	64 bytes from 10.5.0.2 (10.5.0.2): icmp_seq=3 ttl=59 time=27.8 ms

	--- osaka-inst.private.osaka.oraclevcn.com ping statistics ---
	3 packets transmitted, 3 received, 0% packet loss, time 5ms
	rtt min/avg/max/mdev = 20.585/25.215/27.763/3.284 ms

■ OCI Tokyo -> オンプレミス への名前解決確認

● OCI Tokyo -> On-Premises への名前解決確認

1) nslookup 確認

[root@tokyo-db-inst01 ~]# nslookup raspberrypi.shirok.net
	Server:		169.254.169.254
	Address:	169.254.169.254#53

	Non-authoritative answer:
	Name:	raspberrypi.shirok.net
	Address: 192.168.0.250

[root@tokyo-db-inst01 ~]# nslookup mac-book.shirok.net
	Server:		169.254.169.254
	Address:	169.254.169.254#53

	Non-authoritative answer:
	Name:	mac-book.shirok.net
	Address: 192.168.0.2

2) ping 確認

[root@tokyo-db-inst01 ~]# ping raspberrypi.shirok.net -c 3
	PING raspberrypi.shirok.net (192.168.0.250) 56(84) bytes of data.
	64 bytes from 192.168.0.250 (192.168.0.250): icmp_seq=1 ttl=61 time=5.82 ms
	64 bytes from 192.168.0.250 (192.168.0.250): icmp_seq=2 ttl=61 time=22.0 ms
	64 bytes from 192.168.0.250 (192.168.0.250): icmp_seq=3 ttl=61 time=5.85 ms

	--- raspberrypi.shirok.net ping statistics ---
	3 packets transmitted, 3 received, 0% packet loss, time 2001ms
	rtt min/avg/max/mdev = 5.826/11.228/22.006/7.621 ms


[root@tokyo-db-inst01 ~]# ping mac-book.shirok.net -c 3
	PING mac-book.shirok.net (192.168.0.2) 56(84) bytes of data.
	64 bytes from 192.168.0.2 (192.168.0.2): icmp_seq=1 ttl=61 time=11.4 ms
	64 bytes from 192.168.0.2 (192.168.0.2): icmp_seq=2 ttl=61 time=20.8 ms
	64 bytes from 192.168.0.2 (192.168.0.2): icmp_seq=3 ttl=61 time=32.8 ms

	--- mac-book.shirok.net ping statistics ---
	3 packets transmitted, 3 received, 0% packet loss, time 2003ms
	rtt min/avg/max/mdev = 11.401/21.697/32.835/8.770 ms

● OCI Osaka -> オンプレミス への名前解決確認

1) nslookup 確認

[opc@osaka-inst01 ~]$ nslookup raspberrypi.shirok.net
	Server:		169.254.169.254
	Address:	169.254.169.254#53

	Non-authoritative answer:
	Name:	raspberrypi.shirok.net
	Address: 192.168.0.2

[opc@osaka-inst01 ~]$ nslookup  mac-book.shirok.net
	Server:		169.254.169.254
	Address:	169.254.169.254#53

	Non-authoritative answer:
	Name:	mac-book.shirok.net
	Address: 192.168.0.2

2) ping 確認

[opc@osaka-inst01 ~]$ ping raspberrypi.shirok.net -c 3
	PING raspberrypi.shirok.net (192.168.0.2) 56(84) bytes of data.
	64 bytes from 192.168.0.2 (192.168.0.2): icmp_seq=1 ttl=60 time=16.0 ms
	64 bytes from 192.168.0.2 (192.168.0.2): icmp_seq=2 ttl=60 time=15.3 ms
	64 bytes from 192.168.0.2 (192.168.0.2): icmp_seq=3 ttl=60 time=15.6 ms

	--- raspberrypi.shirok.net ping statistics ---
	3 packets transmitted, 3 received, 0% packet loss, time 2003ms
	rtt min/avg/max/mdev = 15.375/15.706/16.073/0.286 ms

[opc@osaka-inst01 ~]$ ping mac-book.shirok.net -c 3
	PING mac-book.shirok.net (192.168.0.2) 56(84) bytes of data.
	64 bytes from 192.168.0.2 (192.168.0.2): icmp_seq=1 ttl=60 time=20.9 ms
	64 bytes from 192.168.0.2 (192.168.0.2): icmp_seq=2 ttl=60 time=17.7 ms
	64 bytes from 192.168.0.2 (192.168.0.2): icmp_seq=3 ttl=60 time=18.0 ms

	--- mac-book.shirok.net ping statistics ---
	3 packets transmitted, 3 received, 0% packet loss, time 2003ms
	rtt min/avg/max/mdev = 17.733/18.901/20.917/1.431 ms

■ On-Premises -> OCI Oracle RAC SCANホスト名への名前解決確認

Oracle Base Database Service の Oracle Real Application Clusters(RAC)構成でも名前解決できることを確認するために、RAC の SCANアドレスに対して名前解決できて通信できることを確認
private.tokyo.oraclevcn.com

● On-Premises -> OCI rac19c-scan への名前解決確認

1) nslookup 確認

pi@raspberrypi:~ $ nslookup private.tokyo.oraclevcn.com
	Server:		192.168.0.2
	Address:	192.168.0.2#53

	Non-authoritative answer:
	Name:	private.tokyo.oraclevcn.com
	Address: 10.0.0.132
	Name:	private.tokyo.oraclevcn.com
	Address: 10.0.0.122
	Name:	private.tokyo.oraclevcn.com
	Address: 10.0.0.112

2) ping確認

pi@raspberrypi:~ $ ping private.tokyo.oraclevcn.com -c 3
	PING private.tokyo.oraclevcn.com (10.0.0.122) 56(84) bytes of data.
	64 bytes from 10.0.0.122 (10.0.0.122): icmp_seq=1 ttl=60 time=25.4 ms
	64 bytes from 10.0.0.122 (10.0.0.122): icmp_seq=2 ttl=60 time=29.8 ms
	64 bytes from 10.0.0.122 (10.0.0.122): icmp_seq=3 ttl=60 time=26.2 ms

	--- private.tokyo.oraclevcn.com ping statistics ---
	3 packets transmitted, 3 received, 0% packet loss, time 6ms
	rtt min/avg/max/mdev = 25.433/27.132/29.770/1.890 ms

■ 参考

● OCIドキュメント
  - 仮想クラウド・ネットワークのDNS
  - Private DNS
● Oracle Speakerdeck
  - OCI技術資料 : 仮想クラウド・ネットワーク (VCN) 詳細
● ユースケース
  - VCNとオンプレミス・ネーム・サーバー間の接続
  - プライベートDNSの実装
● Oracle Help Center Learn
  - Configure private DNS zones views and resolversプライベート DNS ゾーンのビューとリゾルバーを構成する
● Oracle Architecture Center
  - Use private DNS in interconnected VCNs and On-premises
● Raspberry Pi
  - Raspberry Pi OS
● bind9
  - wiki.debian.org: Bind9
  - bind9
  - bind9-dnsutils
● Qiita
  - VPN BGP: Cisco 841M ルーターを IKEv2 と BGPで IPSec VPN接続してみてみた
  - Remote Peering: リージョン間を Remote VCN Peering してみてみた
  - Trunsit Peering: DRGで東京リージョンを経由して、オンプレミスと 大阪リージョンを接続してみてみた
  - Private DNS: Private DNSで PeeringしたVCNどうしホスト名(FQDN)で通信できるようにしてみてみた

0
1
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
0
1