Huawei IPSec VPN の構成

目次

コンセプト

ステージ1

ステージ2

IPSec 構成の実験

 最初に基本設定を実行して、ルートが到達可能であることを確認します

 構成フェーズ 1

ike プロポーザルの構成

ike ネイバーの構成

構成フェーズ 2

関心のあるストリームを定義する

インターフェイスに ipsec ポリシーを適用する

結果テスト


コンセプト

IPSec はフレームワークであり、特定のプロトコルを具体的に指すのではなく、さまざまなプロトコル グループとネゴシエーションから構成されるフレームワークを定義します。フレームワークには、主に暗号化アルゴリズム、認証アルゴリズム、カプセル化プロトコル、カプセル化モード、鍵の有効期間などが含まれます。

IPSecVPN 確立の前提: 2 つのサイト間で IP データ ストリームを安全に送信するには、最初にそれらの間で使用される暗号化アルゴリズム、カプセル化技術、およびキーについて互いにネゴシエートする必要があります。

これは 2 つのフェーズに分かれています。最初のフェーズは管理接続を確立するフェーズで、2 番目のフェーズはデータ接続を確立するフェーズです。

フェーズ 1:

2 つのピア デバイス間に安全な管理接続を確立します。実際のデータはこの接続を通過しません。この管理接続は、ネゴシエーション プロセスの第 2 フェーズを保護するために使用されます。

フェーズ 1 で交渉する内容:

1. 両当事者が暗号化に使用する暗号化アルゴリズム (des、3des、aes)

2. ダイジェスト(完全性)認証方式(MD5、SHA)

3. 鍵共有方式の採用(事前共有鍵、CAデジタル署名、公開鍵認証)

4. 使用する鍵強度 DH グループ (暗号強度が大きいほど、暗号強度は高くなります)

5. 管理接続の有効期間 (デフォルトは 1 日、単位は秒)

6. ネゴシエーション モード (メイン モードまたはアグレッシブ モード)

フェーズ 2:

ピアが安全な管理接続を確立した後、安全なデータ接続を構築するためのセキュリティ パラメータをネゴシエートできます. このネゴシエーション プロセスは安全で暗号化されています. ネゴシエーションが完了すると、2 つのサイト間に安全なデータ接続が確立されます。

フェーズ 2 で交渉する内容:

1. 送信モード(トンネルモードまたは送信モード)

2. パッケージ技術(ESP、AH)

3. 送信時のデータ暗号化方式(des、3des、aes)

4. 送信時のデータの認証方式(MD5、SHA)

3. 対象の定義 (IPSec を使用する必要があるトラフィックの定義)

IPSec 構成の実験

トポロジー

 最初に基本設定を実行して、ルートが到達可能であることを確認します

AR1

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys ar1
[ar1]int g0/0/0
[ar1-GigabitEthernet0/0/0]ip add 192.168.1.254 24
Sep  8 2022 15:22:35-08:00 ar1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
 on the interface GigabitEthernet0/0/0 has entered the UP state. 
[ar1-GigabitEthernet0/0/0]
[ar1-GigabitEthernet0/0/0]int g0/0/1
[ar1-GigabitEthernet0/0/1]ip add 12.1.1.1 24
Sep  8 2022 15:23:06-08:00 ar1 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
 on the interface GigabitEthernet0/0/1 has entered the UP state. 
[ar1-GigabitEthernet0/0/1]quit
[ar1]ip rou	
[ar1]ip route
[ar1]ip route-static 0.0.0.0 0 12.1.1.2

AR2

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys ar2
[ar2]int g0/0/0
[ar2-GigabitEthernet0/0/0]ip add 12.1.1.2 24
Sep  8 2022 15:23:55-08:00 ar2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface GigabitEthernet0/0/0 has entered the UP state. 
[ar2-GigabitEthernet0/0/0]int g0/0/1
[ar2-GigabitEthernet0/0/1]ip add 23.1.1.2 24
Sep  8 2022 15:24:05-08:00 ar2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
 on the interface GigabitEthernet0/0/1 has entered the UP state. 
[ar2-GigabitEthernet0/0/1]quit
[ar2]
[ar2]ip rou	
[ar2]ip route
[ar2]ip route-static 172.16.1.0 24 23.1.1.3 
[ar2]ip rou	
[ar2]ip route
[ar2]ip route-static 192.168.1.0 24 12.1.1.1

AR3

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys ar3
[ar3]int g0/0/0
[ar3-GigabitEthernet0/0/0]ip add 172.16.1.254 24
Sep  8 2022 15:24:55-08:00 ar3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface GigabitEthernet0/0/0 has entered the UP state. 
[ar3-GigabitEthernet0/0/0]int g0/0/1
[ar3-GigabitEthernet0/0/1]ip add 23.1.1.3 24
Sep  8 2022 15:25:11-08:00 ar3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
 on the interface GigabitEthernet0/0/1 has entered the UP state. 
[ar3-GigabitEthernet0/0/1]quit
[ar3]ip route-static 0.0.0.0 0 23.1.1.2

接続性のテスト

 構成フェーズ 1

ike プロポーザルの構成

[ar1]ike proposal 1
[ar1-ike-proposal-1]encryption-algorithm aes-cbc-256
[ar1-ike-proposal-1]authentication-algorithm sha1
[ar1-ike-proposal-1]authentication-method pre-share 
[ar1-ike-proposal-1]dh group14
[ar1-ike-proposal-1]sa duration 1200
[ar1-ike-proposal-1]quit


AR3

[ar3]ike proposal 1
[ar3-ike-proposal-1]encryption-algorithm aes-cbc-256
[ar3-ike-proposal-1]authentication-algorithm sha1
[ar3-ike-proposal-1]authentication-method pre	
[ar3-ike-proposal-1]authentication-method pre-share 
[ar3-ike-proposal-1]dh group14
[ar3-ike-proposal-1]sa duration 1200
[ar3-ike-proposal-1]quit

ike ネイバーの構成

[ar1]ike peer 1 v2
[ar1-ike-peer-1]remote-address 23.1.1.3
[ar1-ike-peer-1]pre-shared-key s	
[ar1-ike-peer-1]pre-shared-key simple 123456789
[ar1-ike-peer-1]ike-proposal 1
[ar1-ike-peer-1]quit
[ar3]ike peer 1 v2
[ar3-ike-peer-1]remote-address 12.1.1.1 
[ar3-ike-peer-1]pre-shared-key simple 123456789
[ar3-ike-peer-1]ike-proposal 1

構成フェーズ 2

関心のあるストリームを定義する

IPSecVPN トラフィックに使用する必要がある高度な ACL

[ar1]acl 3000
[ar1-acl-adv-3000]rule permit ip source 192.168.1.0 0.0.0.255 destination 172.16
.1.0 0.0.0.255
[ar1-acl-adv-3000]quit
[ar3]acl 3000
[ar3-acl-adv-3000]rule permit ip source 172.16.1.0 0.0.0.255 destination 192.168
.1.0 0.0.0.255
[ar3-acl-adv-3000]quit

IPSec プロポーザルの定義

[ar1]ipsec proposal 1
[ar1-ipsec-proposal-1]encapsulation-mode tunnel
[ar1-ipsec-proposal-1]esp authentication-algorithm sha1
[ar1-ipsec-proposal-1]esp encryption-algorithm aes-256
[ar1-ipsec-proposal-1]quit
[ar3]ipsec proposal 1
[ar3-ipsec-proposal-1]encapsulation-mode tunnel
[ar3-ipsec-proposal-1]esp encryption-algorithm aes-256
[ar3-ipsec-proposal-1]esp authentication-algorithm sha1
[ar3-ipsec-proposal-1]quit

IPsec ポリシー

[ar1]ipsec policy 1 1 isakmp 
[ar1-ipsec-policy-isakmp-1-1]security acl 3000
[ar1-ipsec-policy-isakmp-1-1]proposal 1
[ar1-ipsec-policy-isakmp-1-1]ike-peer 1
[ar3]ipsec policy 1 1 isakmp 
[ar3-ipsec-policy-isakmp-1-1]security acl 3000	
[ar3-ipsec-policy-isakmp-1-1]proposal 1
[ar3-ipsec-policy-isakmp-1-1]ike-peer 1

インターフェイスに ipsec ポリシーを適用する

[ar1]int g0/0/1
[ar1-GigabitEthernet0/0/1]ipsec ポリシー 1

[ar3]int g0/0/1 
[ar3-GigabitEthernet0/0/1]ipsec ポリシー 1

結果テスト

pc2 ping pc1

 AR1 と AR2 の間のパケットをキャプチャする

IPsec データ パケットは通常の ICMP とはかなり異なり、データが暗号化されていることがわかります。

AR1 でステージ 1 の接続を問い合わせる

 フェーズ2について再度お問い合わせください

 簡単な IPSecVPN 実験の設定が完了しました。間違いがありましたらご指摘ください。! !

おすすめ

転載: blog.csdn.net/caolongbin/article/details/126764302