Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- gcloud config list project
- gcloud compute target-vpn-gateways \
- create vpn-1 \
- --network vpn-network-1 \
- --region us-east1
- gcloud compute target-vpn-gateways \
- create vpn-2 \
- --network vpn-network-2 \
- --region europe-west1
- # To reserve a Static IP for the vpn-1 gateway, run the following command:
- gcloud compute addresses create --region us-east1 vpn-1-static-ip
- gcloud compute addresses list
- export STATIC_IP_VPN_1=<Enter IP address for vpn-1 here>
- To create ESP forwarding for vpn-1, run the following command:
- gcloud compute \
- forwarding-rules create vpn-1-esp \
- --region us-east1 \
- --ip-protocol ESP \
- --address $STATIC_IP_VPN_1 \
- --target-vpn-gateway vpn-1
- The forwarding rules forward traffic arriving on the external IP to the VPN gateway. It connects them together. Create three forwarding rules for the protocols necessary for VPN.
- To create UDP500 forwarding for vpn-1, run the following command:
- gcloud compute \
- forwarding-rules create vpn-1-udp500 \
- --region us-east1 \
- --ip-protocol UDP \
- --ports 500 \
- --address $STATIC_IP_VPN_1 \
- --target-vpn-gateway vpn-1
- In the GCP Console, on the Products & Services menu (), click VPC network > External IP addresses.
Add Comment
Please, Sign In to add comment