
Ich versuche, einen IPsec-Tunnel zwischen einer Ubuntu-VM in Google Cloud und einer Remote-Site zu initialisieren.
Die Verbindung wird korrekt hergestellt, aber von der Ubuntu-Maschine in der Google Cloud kann ich keinen Host im Remote-Netzwerk (172.17.20.25) erreichen.
Gcloud:
Öffentliche IP: 50.50.50.50
Private IP: 10.132.0.63/32
Remote-Standort:
Öffentliche IP: 100.100.100.100
Entferntes privates Netzwerk: 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-Route anzeigen Tabelle 220
172.17.0.0/16 via 10.132.0.1 dev ens4 proto static src 10.132.0.62
IPSec-Statusalle
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-Richtlinie
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
Ich kann nicht verstehen, ob es sich um ein Konfigurationsproblem handelt oder ob das Problem in der Konfiguration der Remote-Site liegt
Antwort1
Ich habe das Problem gefunden. Zusätzlich zum Öffnen der UDP-Ports 500 und 4500 in der Google Cloud Firewall muss das ESP-Protokoll hinzugefügt werden.
Protokolle und Ports
udp:500
udp:4500
besonders