Estou tentando inicializar um túnel IPsec entre uma VM Ubuntu no Google Cloud e um site remoto.
A conexão foi estabelecida corretamente, mas na máquina Ubuntu no Google Cloud não consigo acessar um host na rede remota (172.17.20.25).
Gcloud:
IP público: 50.50.50.50
IP privado: 10.132.0.63/32
Local remoto:
IP público: 100.100.100.100
Rede privada remota: 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
tabela de exibição de rota ip 220
172.17.0.0/16 via 10.132.0.1 dev ens4 proto static src 10.132.0.62
status ipsec tudo
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
política 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
Não consigo entender se pode haver um problema de configuração ou se o problema pode estar na configuração do site remoto
Encontrei o problema, além de abrir as portas UDP 500 e 4500 no Google Cloud Firewall é necessário adicionar o protocolo ESP
Protocolos e portas
udp:500
udp:4500
especialmente