FortiGate でダイナミック DNS を設定する方法(v6.2.4)

ファイアウォール(UTM)
スポンサーリンク

はじめに

動的に割り当てられる IP アドレスとドメイン名の対応を、動的に登録、および管理する仕組みをダイナミック DNS (DDNS) といいます。

FortiGate では、FortiGate 自身が持つ IP アドレスを DDNS サーバに対して動的に登録する DDNS 機能があります。DDNS サーバとしては以下を使用できます。

  • FortiGuard(公開 DNS サーバ)
    • ベースライセンスが必要 ライセンスが無くても使用可能でした
    • DNS サーバとして FortiGuard を利用する設定にする必要がある
  • FortiGate が対応しているいくつかの DDNS サービス
    • DDNS サービスプロバイダとの契約が必要

FortiGuard DDNS についてはベースライセンスさえあれば利用できます。
ライセンスが無くても使用可能でした。

作業環境

  • 型番:FortiGate 60E
  • ファームウェアバージョン:v6.2.4

DDNS の設定方法

DDNS サーバとして FortiGuard を使用する場合

GUI にて [ネットワーク] → [DNS] と選択し、DNS 設定画面を開きます。[DNSサーバ] として [FortiGuard サーバを利用] を選択し、画面中ほどにある [FortiGuard DDNS] を有効化します。するとDDNS の設定項目が表示されるため、各項目を設定していきます。

  • インターフェース
    • DDNS で IP アドレスを管理するインターフェースを指定します
  • パブリックIPアドレスを使う
    • OFF ⇒ 指定したインターフェースの IP アドレスが DDNS に登録されます
    • ON ⇒ インターネットとの境界にある NAT デバイスで変換後の パブリック IP アドレスが DDNS に登録されます
  • サーバ
    • 使用する DDNS サーバ(FortiGuard)のドメインを選択します。以下の3つから任意のサーバを選択できます
      • fortiddns.com
      • fortidyndns.com
      • float-zone.com
  • ユニークなロケーション
    • 任意のドメイン接頭辞を指定します
      • ドメインは <ユニークなロケーション>.<サーバ> になります
      • ドメインが既に使用されている場合は使用できません
      • GUI で [利用可!] と表記されていれば使用できます
  • ドメイン
    • DDNS サーバに登録されるドメインが表示されます

各項目を設定できたら [適用] をクリックします。

DDNS の設定は以上です。

設定後、CLI でコンフィグを確認すると以下のようになっています。

config system ddns
    edit 1
        set ddns-server FortiGuardDDNS
        set ddns-domain "myfg01a.fortiddns.com"
        set use-public-ip disable
        set monitor-interface "internal2"
    next
end

動作確認

FortiGate から作成したドメインに対して ping を打って名前解決できるかを確認します。

FW01 # execute ping myfg01a.fortiddns.com
PING myfg01a.fortiddns.com (192.168.100.11): 56 data bytes
64 bytes from 192.168.100.11: icmp_seq=0 ttl=255 time=0.1 ms
64 bytes from 192.168.100.11: icmp_seq=1 ttl=255 time=0.1 ms
64 bytes from 192.168.100.11: icmp_seq=2 ttl=255 time=0.1 ms
64 bytes from 192.168.100.11: icmp_seq=3 ttl=255 time=0.1 ms
64 bytes from 192.168.100.11: icmp_seq=4 ttl=255 time=0.1 ms

--- myfg01a.fortiddns.com ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 0.1/0.1/0.1 ms

名前解決できていることが確認できます。

次に DDNS でモニタインターフェースと設定しているインターフェースの IP アドレスを 192.168.100.11 から 192.168.100.12 へ変更してから再度 ping を打ってみます。

ここで DNS キャッシュを確認します。

FW01 # diagnose test application dnsproxy 7
#略
vfid=0, name=myfg01a.fortiddns.com, ttl=300:38:1538
         192.168.100.11 (ttl=300)
#略

古い情報の DNS キャッシュが残っているので DNS キャッシュをすべて削除します。

FW01 # diagnose test application dnsproxy 1
worker idx: 0

それでは対象のドメインに対して ping を打ちます。

FW01 # execute ping myfg01a.fortiddns.com
PING myfg01a.fortiddns.com (192.168.100.12): 56 data bytes
64 bytes from 192.168.100.12: icmp_seq=0 ttl=255 time=0.1 ms
64 bytes from 192.168.100.12: icmp_seq=1 ttl=255 time=0.1 ms
64 bytes from 192.168.100.12: icmp_seq=2 ttl=255 time=0.1 ms
64 bytes from 192.168.100.12: icmp_seq=3 ttl=255 time=0.1 ms
64 bytes from 192.168.100.12: icmp_seq=4 ttl=255 time=0.1 ms

--- myfg01a.fortiddns.com ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 0.1/0.1/0.1 ms

解決された結果の IP アドレスが変更後の IP アドレスになっていることが確認できます。

FortiGate が対応している DDNS サービス

DDNS サーバとして FortiGuard 以外の DDNS サービスを使用することもできます。

FortiGate が対応している DDNS サービスは以下の通りです。なお、有料サービスが多いです。

# set ddns-server
dyndns.org        members.dyndns.org and dnsalias.com
dyns.net          www.dyns.net
tzo.com           rh.tzo.com
vavic.com         Peanut Hull
dipdns.net        dipdnsserver.dipdns.com
now.net.cn        ip.todayisp.com
dhs.org           members.dhs.org
easydns.com       members.easydns.com
genericDDNS       Generic DDNS based on RFC2136.
FortiGuardDDNS    FortiGuard DDNS service.
noip.com          dynupdate.no-ip.com

FortiGuard 以外を使用する場合の設定は CLI で行う必要があります。

設定項目は使用する DDNS サービスによって異なります。対象サービスへのログイン情報などを設定する必要があります。

参考資料

DDNS | Cookbook
Technical Tip: DDNS update with public IP on internal firewalls
Description This article describes how to update the DDNS with a public IP on an internal firewall. In previous FortiOS versions, defining a DDNS in a non-edge ...
Technical Tip: How to update IP address with FortiGuard DDNS service and upstream router
Description This article describes how to update the public IP address when a upstream router is being used. This article provides a sample configuration for Fo...

―――――――――――――

タイトルとURLをコピーしました