gorosuke5656の日記

ネットワーク好きで個人で色々勉強しています😀 ですので内容はメーカーの公式見解ではありません🙇‍♀️

Juniper SRXにおけるRouteBaseVPN構築時におけるトラブル事例(バーチャルルータ使用)


単なる私のケアレスミスですが。。(^^;)   以下記載します

【全体構成と発生事象】

①【構成内容と事象概要】

 Ubunto→Netscreen-50(対向ホストとして代用)間の通信をRoute-BaseVPNで
 暗号化する設定を実施
   【SRX100B、SRX100H2(機器節約のためVirtual-Routerを設定(VR2)】

 UbuntoからPINGをNS-50を送信したところPING応答なし
 VPN通信も確立されていない

 以下で切り分けを実施


〇ログ設定について
 Security Policyにマッチした通信についてはPolicylogのファイルに残るように設定済み
admin@SRX100H2> show configuration system syslog
file PolicyLog {
    user info;
    match RT_FLOW;
    explicit-priority;
}

② 【疎通確認及び現状】
(1) ubuntoからPINGを実施
gorosuke@ubuntu:~$ ping 10.1.7.1
PING 10.1.7.1 (10.1.7.1) 56(84) bytes of data.
^C
--- 10.1.7.1 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2026ms
  → PING応答なし

(2) SRX100BによるVPN接続確認
(IKEの状態)
admin@SRX100B> show security ike security-associations brief
Index   Remote Address  State  Initiator cookie  Responder cookie  Mode
4150072 172.16.7.254    UP     a151c5ecd888a9e7  068285bb532f5eef  Main

IPSECの状態)
admin@SRX100B> show security ipsec security-associations brief
  Total active tunnels: 1
  ID    Gateway          Port  Algorithm       SPI      Life:sec/kb  Mon vsys
  <131073 172.16.7.254   500   ESP:aes-128/sha1 dc588c47 3272/ unlim  -   root
  >131073 172.16.7.254   500   ESP:aes-128/sha1 1852e0f2 3272/ unlim  -   root

IPSEC統計情報)
admin@SRX100B> show security ipsec statistics
ESP Statistics:
  Encrypted bytes:             1064
  Decrypted bytes:                0
  Encrypted packets:              7
  Decrypted packets:              0
AH Statistics:
  Input bytes:                    0
  Output bytes:                   0
  Input packets:                  0
  Output packets:                 0
Errors:
  AH authentication failures: 0, Replay errors: 0
  ESP authentication failures: 0, ESP decryption failures: 0
  Bad headers: 0, Bad trailers: 0

admin@SRX100B>
   ⇒ Encryptoされているが、対応からの応答なし(Decryptoのカウンタが0。。。)
  対向VPN装置【SRX100H2(VR2)】が怪しそう。。


③【対向VPN装置(SRX100H2:VR2)】の設定状況を確認
(1) st0.0の状態確認
admin@SRX100H2> show interfaces terse | match st0.0
st0.0                   up    up   inet     192.168.1.1/24

(2) ルーティングテーブルの状態

dmin@SRX100H2> show route

inet.0: 2 destinations, 2 routes (2 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

192.168.1.0/24     *[Direct/0] 00:13:35
                    > via st0.0
192.168.1.1/32     *[Local/0] 00:13:38
                      Local via st0.0

VR1.inet.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

172.16.8.0/24      *[Direct/0] 00:32:29
                    > via fe-0/0/3.0
172.16.8.254/32    *[Local/0] 00:32:34
                      Local via fe-0/0/3.0
172.30.30.6/32     *[Local/0] 00:32:34
                      Reject

VR2.inet.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

0.0.0.0/0          *[Static/5] 00:32:29
                    > to 172.16.7.1 via fe-0/0/7.0
10.1.7.0/24        *[Direct/0] 00:32:30
                    > via fe-0/0/6.0
10.1.7.254/32      *[Local/0] 00:32:33
                      Local via fe-0/0/6.0
172.16.7.0/24      *[Direct/0] 00:32:29
                    > via fe-0/0/7.0
172.16.7.254/32    *[Local/0] 00:32:33
                      Local via fe-0/0/7.0
172.16.30.5/32     *[Local/0] 00:32:33
                      Reject

admin@SRX100H2>

⇒ あれ。。st0.0をネクストホップとする経路がない。。

(3) ルーティングインスタンス:VR2(バーチャルルータ)の確認

admin@SRX100H2> show configuration routing-instances VR2
instance-type virtual-router;
interface lt-0/0/0.1; ## 'lt-0/0/0.1' is not defined
interface fe-0/0/2.0;
interface fe-0/0/4.0;
interface fe-0/0/5.0;
interface fe-0/0/6.0;
interface fe-0/0/7.0;
routing-options {
    static {
        route 0.0.0.0/0 next-hop 172.16.7.1;
        route 130.230.0.0/24 next-hop st0.0;
    }
}

admin@SRX100H2>


⇒ あれ。。st0.0をVR2に登録してなかった。。(^^;)

(4) ルーティングインスタンス:VR2(バーチャルルータ)にst0.0を登録

[edit]
admin@SRX100H2# set routing-instances VR2 interface st0.0

[edit]
admin@SRX100H2# commit
commit complete


(5) 再びルーティングインスタンス:VR2(バーチャルルータ)の確認

[edit]
admin@SRX100H2# run show configuration routing-instances VR2
instance-type virtual-router;
interface lt-0/0/0.1; ## 'lt-0/0/0.1' is not defined
interface fe-0/0/2.0;
interface fe-0/0/4.0;
interface fe-0/0/5.0;
interface fe-0/0/6.0;
interface fe-0/0/7.0;
interface st0.0;
routing-options {
    static {
        route 0.0.0.0/0 next-hop 172.16.7.1;
        route 130.230.0.0/24 next-hop st0.0;
    }
}

⇒ 今度は間違いなくいますね!! (^^;)


(6) 再びルーティングテーブルの確認

[edit]
admin@SRX100H2# run show route

VR1.inet.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

172.16.8.0/24      *[Direct/0] 00:34:43
                    > via fe-0/0/3.0
172.16.8.254/32    *[Local/0] 00:34:48
                      Local via fe-0/0/3.0
172.30.30.6/32     *[Local/0] 00:34:48
                      Reject

VR2.inet.0: 9 destinations, 9 routes (9 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

0.0.0.0/0          *[Static/5] 00:34:43
                    > to 172.16.7.1 via fe-0/0/7.0
10.1.7.0/24        *[Direct/0] 00:34:44
                    > via fe-0/0/6.0
10.1.7.254/32      *[Local/0] 00:34:47
                      Local via fe-0/0/6.0
130.230.0.0/24     *[Static/5] 00:00:34
                    > via st0.0
172.16.7.0/24      *[Direct/0] 00:34:43
                    > via fe-0/0/7.0
172.16.7.254/32    *[Local/0] 00:34:47
                      Local via fe-0/0/7.0
172.16.30.5/32     *[Local/0] 00:34:47
                      Reject
192.168.1.0/24     *[Direct/0] 00:00:34
                    > via st0.0
192.168.1.1/32     *[Local/0] 00:00:34
                      Local via st0.0


⇒ st0.0をネクストホップする経路がありました!!

(7) SRX100BのIPSEC統計情報をクリア⇒再度Ubuntoからpingを実施

admin@SRX100B> clear security ipsec statistics

admin@SRX100B>

admin@SRX100B> show security ipsec statistics
ESP Statistics:
  Encrypted bytes:                0
  Decrypted bytes:                0
  Encrypted packets:              0
  Decrypted packets:              0
AH Statistics:
  Input bytes:                    0
  Output bytes:                   0
  Input packets:                  0
  Output packets:                 0
Errors:
  AH authentication failures: 0, Replay errors: 0
  ESP authentication failures: 0, ESP decryption failures: 0
  Bad headers: 0, Bad trailers: 0

admin@SRX100B> show security ipsec statistics
ESP Statistics:
  Encrypted bytes:              608
  Decrypted bytes:              336
  Encrypted packets:              4
  Decrypted packets:              4
AH Statistics:
  Input bytes:                    0
  Output bytes:                   0
  Input packets:                  0
  Output packets:                 0
Errors:
  AH authentication failures: 0, Replay errors: 0
  ESP authentication failures: 0, ESP decryption failures: 0
  Bad headers: 0, Bad trailers: 0

admin@SRX100B>

⇒ EncryptedとDecryptedも両方カウンタが上がりました!!

 

【教訓】

ルーティングテーブルを確認しよう!
バーチャルルータでの使用条件を今一度理解しよう!

 

しばらくJuniper SRXの内容を載せますが、                     今後は懐かしい?? Netscreen関連の記事や
Zabbix関連の内容も記載したいと思います!!