Gcloud 上の Strongswan IPsec サイト間

Gcloud 上の Strongswan IPsec サイト間

Google Cloud 上の Ubuntu VM とリモート サイト間の IPsec トンネルを初期化しようとしています。

接続は正しく確立されていますが、Google Cloud 上の Ubuntu マシンからリモート ネットワーク (172.17.20.25) 上のホストに到達できません。

クラウド:

パブリック IP: 50.50.50.50

プライベートIP: 10.132.0.63/32

リモートサイト:

パブリック IP: 100.100.100.100

リモートプライベートネットワーク: 172.17.20.0/16

ipsec.conf

config setup
        charondebug="all"
        uniqueids=yes
conn intacloud-to-tper
        type=tunnel
        auto=start
        keyexchange=ikev2
        authby=secret
        leftid=50.50.50.50
        leftsubnet=10.132.0.62/32
        right=100.100.100.100
        rightsubnet=172.17.20.0/16 
        ike=aes-sha1-modp2048
        esp=aes-sha1
        aggressive=no
        keyingtries=%forever
        ikelifetime=28800s
        lifetime=3600s
        dpddelay=30s
        dpdtimeout=120s
        dpdaction=restart

IPルート表示テーブル220

172.17.0.0/16 via 10.132.0.1 dev ens4 proto static src 10.132.0.62

ipsecステータス

    Status of IKE charon daemon (strongSwan 5.9.5, Linux 6.2.0-1019-gcp, x86_64):
  uptime: 2 hours, since Jan 24 17:36:07 2024
  malloc: sbrk 3100672, mmap 0, used 1403424, free 1697248
  worker threads: 11 of 16 idle, 5/0/0/0 working, job queue: 0/0/0/0, scheduled: 3
  loaded plugins: charon aesni aes rc2 sha2 sha1 md5 mgf1 random nonce x509 revocation constraints pubkey pkcs1 pkcs7 pkcs8 pkcs12 pgp dnskey sshkey pem openssl fips-prf gmp agent xcbc hmac gcm drbg attr kernel-netlink resolve socket-default connmark stroke updown eap-mschapv2 xauth-generic counters
Listening IP addresses:
  10.132.0.62
Connections:
site-to-site:  %any...100.100.100.100  IKEv2, dpddelay=30s
site-to-site:   local:  [50.50.50.50] uses pre-shared key authentication
site-to-site:   remote: [100.100.100.100] uses pre-shared key authentication
site-to-site:   child:  10.132.0.62/32 === 172.17.0.0/16 TUNNEL, dpdaction=restart
Security Associations (1 up, 0 connecting):
site-to-site[1]: ESTABLISHED 2 hours ago, 10.132.0.62[50.50.50.50]...100.100.100.100[100.100.100.100]
site-to-site[1]: IKEv2 SPIs: -, pre-shared key reauthentication in 5 hours
site-to-site[1]: IKE proposal: AES_CBC_128/HMAC_SHA1_96/PRF_HMAC_SHA1/MODP_2048
site-to-site{4}:  INSTALLED, TUNNEL, reqid 1, ESP SPIs: cb5b6fdd_i 932ca574_o
site-to-site{4}:  AES_CBC_128/HMAC_SHA1_96, 0 bytes_i, 0 bytes_o, rekeying in 27 minutes
site-to-site{4}:   10.132.0.62/32 === 172.17.0.0/16

ip xfrm ポリシー

src 10.132.0.63/32 dst 172.17.0.0/16 
    dir out priority 375423 ptype main 
    tmpl src 10.132.0.63 dst 100.100.100.100
        proto esp spi 0xbb44a532 reqid 1 mode tunnel
src 172.17.0.0/16 dst 10.132.0.63/32 
    dir fwd priority 375423 ptype main 
    tmpl src 100.100.100.100 dst 10.132.0.63
        proto esp reqid 1 mode tunnel

構成に問題があるのか​​、それともリモートサイトの構成に問題があるのか​​わかりません

答え1

問題を発見しました。Google Cloud FirewallでUDPポート500と4500を開くことに加えて、ESPプロトコルを追加する必要があります。

プロトコルとポート

udp:500

udp:4500

特に

関連情報