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

DMVPN 【CCIEメモ_20251010-11】

Posted at

禁煙してたんだけど、やっと離脱症状が落ち着いてきた。

参考資料・時間

資料:
CCIE Enterprise Infrastructure Foundation lab
DMVPN Lab 3

勉強時間:
20251010 : 約4.5時間
20251011 : 約3時間

学習内容

DMVPNのフェーズごとに最適なルーティングプロトコルの設定

Dual-Hub構成


NHSのクラスタリング

DMVPNにて、Spoke側は複数のNHSをクラスタ化することが可能。
これにより、優先的に接続するNHSをメトリック以外の形で選択できる。

設定変更前

interface Tunnel100
 ip address 100.1.1.4 255.255.255.0
 no ip redirects
 ip nhrp network-id 100
 ip nhrp nhs 100.1.1.1 nbma 16.1.1.1 multicast
 ip nhrp nhs 100.1.1.2 nbma 26.1.1.2 multicast
 tunnel source 46.1.1.4
 tunnel mode gre multipoint
end

追加設定

# クラスタリング設定
ip hnrp nhs 100.1.1.1 priority 1 cluster 1
ip hnrp nhs 100.1.1.1 priority 2 cluster 1

この設定を投入すると、以下の設定が上書きされることで、
DMVPN接続が切断される。

 ip nhrp nhs 100.1.1.1 nbma 16.1.1.1 multicast
 ip nhrp nhs 100.1.1.2 nbma 26.1.1.2 multicast

そのため、マッピング設定を追加で投入する。最終形は以下。

interface Tunnel100
 ip address 100.1.1.4 255.255.255.0
 no ip redirects
 ip nhrp map 100.1.1.1 16.1.1.1
 ip nhrp map 100.1.1.2 26.1.1.2
 ip nhrp map multicast 16.1.1.1
 ip nhrp map multicast 26.1.1.2
 ip nhrp network-id 100
 ip nhrp nhs 100.1.1.1 priority 1 cluster 1
 ip nhrp nhs 100.1.1.2 priority 2 cluster 1
 tunnel source 46.1.1.4
 tunnel mode gre multipoint
オプション
# スポークが同時に接続できるNHS数を変更
 cluster 1の最大数を1に変更

 ip nhrp nhs cluster 1 max-connections 1


# スポークはNHSに対して5秒間の間に応答がない場合、次の優先度のNHSに接続を行う。
 ip nhrp registration timeout 5

# 副系から高優先度NHSに戻る際、何秒待機するかを指定
 ip nhrp registration timeout 5

変更前後での比較

# 変更前
      3.0.0.0/24 is subnetted, 1 subnets
D        3.3.3.0 [90/27008256] via 100.1.1.2, 00:00:08, Tunnel100
                 [90/27008256] via 100.1.1.1, 00:00:08, Tunnel100
      5.0.0.0/24 is subnetted, 2 subnets
D        5.5.0.0 [90/28288000] via 100.1.1.2, 00:00:08, Tunnel100
                 [90/28288000] via 100.1.1.1, 00:00:08, Tunnel100
D        5.5.1.0 [90/28288000] via 100.1.1.2, 00:00:08, Tunnel100
                 [90/28288000] via 100.1.1.1, 00:00:08, Tunnel100
      123.0.0.0/24 is subnetted, 1 subnets
D        123.1.1.0 [90/26880256] via 100.1.1.2, 00:00:08, Tunnel100
                   [90/26880256] via 100.1.1.1, 00:00:08, Tunnel100


# 変更後
Gateway of last resort is not set

      3.0.0.0/24 is subnetted, 1 subnets
D        3.3.3.0 [90/27008256] via 100.1.1.1, 00:02:11, Tunnel100
      5.0.0.0/24 is subnetted, 2 subnets
D        5.5.0.0 [90/28288000] via 100.1.1.1, 00:02:11, Tunnel100
D        5.5.1.0 [90/28288000] via 100.1.1.1, 00:02:11, Tunnel100
      123.0.0.0/24 is subnetted, 1 subnets
D        123.1.1.0 [90/26880256] via 100.1.1.1, 00:02:11, Tunnel100

プライオリティ値の低い(=優先度の高い)100.1.1.1に対してセッションを作成している、

冗長性の確認

R4#sh ip nhrp nhs redundancy

Legend: E=Expecting replies, R=Responding, W=Waiting
No.  Interface  Cluster             NHS Priority  Cur-State  Cur-Queue Prev-State Prev-Queue
 1  Tunnel100        1       100.1.1.1        1         RE    Running          E    Running
 2  Tunnel100        1       100.1.1.2        2          W    Waiting         RE    Running

No.  Interface  Cluster   Status  Max-Con  Total-NHS Registering/UP  Expecting  Waiting Fallback
 1  Tunnel100        1   Enable        1          2              1          0        1        5


DHCPとNHRPの組み合わせ

動的にトンネルセッションを張るにあたり、
固定でトンネルIPを設定せずに、DHCPでアドレスを取得する。
DHCPクライアントはDMVPNのHUBに対してDHCP Discoverを送信。

以下、構成

           [R3]
            │ DHCP-Server
 ┌──────────┴──────────┐
 │                     │
[R5]                 [R6]
 │ primary-HUB         │ Backup-HUB
 └──────────┬──────────┘
            │
         [ISP]
            │
           [R7] Spoke

クリアすべき問題点がいくつか存在する。

・DHCPはブロードキャストであるため、インターネットを超えない。
・DHCPサーバはインターネットを超えた先にある。
・トンネルセッションを確立前にIPアドレスの割り当てが必要。

また、DMVPNのスポーク設定ではNHSのトンネルIPとNBMAアドレスが分かっている。

そのため、
・DMVPNのHUBはDHCPサーバとしての役割を持たせる。
・DHCPブロードキャストをユニキャストとして送信。

これを分解すると
〇HUB側設定
 ・HUBをDHCPリレーエージェントとして設定する。

 ・DHCPをブロードキャストではなく、ユニキャストで送信するよう設定

〇Spoke側設定
 ・DHCPフレームのブロードキャストフラグを削除

という設定を実施する。

〇HUB側追加設定

# トンネル内の通信で、DHCPフレームをユニキャストで送信
ip dhcp support tunnel unicast

interface Tunnel100
# DHCPリレーエージェント設定
 ip helper-address 3.3.3.3


〇Spoke側追加設定

interface Tunnel100
# DHCPフレームのOfferフレームにてbroadcastを使用させない
 ip dhcp client broadcast-flag clear

最終構成

R5(Primary-HUB)
ip dhcp support tunnel unicast
!
interface Tunnel100
 ip address 100.1.1.5 255.255.255.0
 ip helper-address 3.3.3.3 ! DHCP-SV-IP
 no ip redirects
 ip nhrp network-id 100
 ip nhrp redirect
 tunnel source 45.1.1.5
 tunnel mode gre multipoint


R6(Backup-HUB)
ip dhcp support tunnel unicast
!
interface Tunnel100
 ip address 100.1.1.6 255.255.255.0
 ip helper-address 3.3.3.3
 no ip redirects
 ip nhrp network-id 111
 ip nhrp redirect
 tunnel source 46.1.1.6
 tunnel mode gre multipoint


R7(Spoke)
interface Tunnel100
 ip dhcp client broadcast-flag clear
 ip address dhcp
 no ip redirects
 ip nhrp map 100.1.1.5 45.1.1.5
 ip nhrp map 100.1.1.6 46.1.1.6
 ip nhrp map multicast 45.1.1.5
 ip nhrp map multicast 46.1.1.6
 ip nhrp network-id 100
 ip nhrp nhs 100.1.1.5 priority 1 cluster 1
 ip nhrp nhs 100.1.1.6 priority 2 cluster 1
 ip nhrp nhs cluster 1 max-connections 1
 ip nhrp registration timeout 5
 tunnel source 47.1.1.7
 tunnel mode gre multipoint

動作:

  1. SpokeはGREでトンネリングした状態でDHCP Discoveryを発信

  2. HUBはDHCP Discoveryを受信。GREでトンネリングしてDHCP Offerを返す

  3. SpokeはDHCP Offerを受信。GREでトンネリングしてDHCP Requestを返す

  4. HUBはDHCP Requestを受信。GREでトンネリングしてDHCPで払い出したトンネルインターフェースのIPに対してDHCP ACKを送信。

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