Creating vpc peering with on prem network in GCP

Welcome to Cloud Shell! Type "help" to get started.
Your Cloud Platform project in this session is set to qwiklabs-gcp-01
Use “gcloud config set project [PROJECT_ID]” to change to a different project.




parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ bash
parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ uname 
 Linux
parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 
parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ uname -a
Linux cs-418137059439-default 5.15.107+ #1 SMP Sat May 20 09:38:40 UTC 2023 x86_64 GNU/Linux

parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud auth list 
 Credentialed Accounts
 ACTIVE: *
 ACCOUNT: student-04-e3038f7d7be0@qwiklabs.net
 To set the active account, run:
     $ gcloud config set account ACCOUNT


parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud config list project
 [core]
 project = qwiklabs-gcp-02-18918b9b83e4
 Your active configuration is: [cloudshell-21025]
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute networks create vpc-demo --subnet-mode custom
 Created [https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/global/networks/vpc-demo].
 NAME: vpc-demo
 SUBNET_MODE: CUSTOM
 BGP_ROUTING_MODE: REGIONAL
 IPV4_RANGE: 
 GATEWAY_IPV4: 
 Instances on this network will not be reachable until firewall rules
 are created. As an example, you can allow all internal traffic between
 instances as well as SSH, RDP, and ICMP by running:
 $ gcloud compute firewall-rules create  --network vpc-demo --allow tcp,udp,icmp --source-ranges 
 $ gcloud compute firewall-rules create  --network vpc-demo --allow tcp:22,tcp:3389,icmp


 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute networks subnets create vpc-demo-subnet1 \
 --network vpc-demo --range 10.1.1.0/24 --region us-central1
 Created [https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/subnetworks/vpc-demo-subnet1].
 NAME: vpc-demo-subnet1
 REGION: us-central1
 NETWORK: vpc-demo
 RANGE: 10.1.1.0/24
 STACK_TYPE: IPV4_ONLY
 IPV6_ACCESS_TYPE: 
 INTERNAL_IPV6_PREFIX: 
 EXTERNAL_IPV6_PREFIX: 


 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute networks subnets create vpc-demo-subnet2 \
 --network vpc-demo --range 10.2.1.0/24 --region us-east1 
 Created [https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-east1/subnetworks/vpc-demo-subnet2].
 NAME: vpc-demo-subnet2
 REGION: us-east1
 NETWORK: vpc-demo
 RANGE: 10.2.1.0/24
 STACK_TYPE: IPV4_ONLY
 IPV6_ACCESS_TYPE: 
 INTERNAL_IPV6_PREFIX: 
 EXTERNAL_IPV6_PREFIX: 


 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute firewall-rules create vpc-demo-allow-custom \
   --network vpc-demo \
   --allow tcp:0-65535,udp:0-65535,icmp \
   --source-ranges 10.0.0.0/8
 Creating firewall…working..Created [https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/global/firewalls/vpc-demo-allow-custom].     
 Creating firewall…done.                                                                                                                                      
 NAME: vpc-demo-allow-custom
 NETWORK: vpc-demo
 DIRECTION: INGRESS
 PRIORITY: 1000
 ALLOW: tcp:0-65535,udp:0-65535,icmp
 DENY: 
 DISABLED: False


 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute firewall-rules create vpc-demo-allow-ssh-icmp \
     --network vpc-demo \
     --allow tcp:22,icmp 
 Creating firewall…working..Created [https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/global/firewalls/vpc-demo-allow-ssh-icmp].   
 Creating firewall…done.                                                                                                                                      
 NAME: vpc-demo-allow-ssh-icmp
 NETWORK: vpc-demo
 DIRECTION: INGRESS
 PRIORITY: 1000
 ALLOW: tcp:22,icmp
 DENY: 
 DISABLED: False


 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute instances create vpc-demo-instance1 --zone us-central1-b --subnet vpc-demo-subnet1
 Created [https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/zones/us-central1-b/instances/vpc-demo-instance1].
 NAME: vpc-demo-instance1
 ZONE: us-central1-b
 MACHINE_TYPE: n1-standard-1
 PREEMPTIBLE: 
 INTERNAL_IP: 10.1.1.2
 EXTERNAL_IP: 34.31.56.152
 STATUS: RUNNING

parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute instances create vpc-demo-instance2 --zone us-east1-b --subnet vpc-demo-subnet2
 Created [https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/zones/us-east1-b/instances/vpc-demo-instance2].
 NAME: vpc-demo-instance2
 ZONE: us-east1-b
 MACHINE_TYPE: n1-standard-1
 PREEMPTIBLE: 
 INTERNAL_IP: 10.2.1.2
 EXTERNAL_IP: 34.23.186.129
 STATUS: RUNNING


 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 


parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute networks create on-prem --subnet-mode custom
 Created [https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/global/networks/on-prem].
 NAME: on-prem
 SUBNET_MODE: CUSTOM
 BGP_ROUTING_MODE: REGIONAL
 IPV4_RANGE: 
 GATEWAY_IPV4: 
 Instances on this network will not be reachable until firewall rules
 are created. As an example, you can allow all internal traffic between
 instances as well as SSH, RDP, and ICMP by running:
 $ gcloud compute firewall-rules create  --network on-prem --allow tcp,udp,icmp --source-ranges 
 $ gcloud compute firewall-rules create  --network on-prem --allow tcp:22,tcp:3389,icmp
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute networks subnets create on-prem-subnet1 \
 --network on-prem --range 192.168.1.0/24 --region us-central1
 Created [https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/subnetworks/on-prem-subnet1].
 NAME: on-prem-subnet1
 REGION: us-central1
 NETWORK: on-prem
 RANGE: 192.168.1.0/24
 STACK_TYPE: IPV4_ONLY
 IPV6_ACCESS_TYPE: 
 INTERNAL_IPV6_PREFIX: 
 EXTERNAL_IPV6_PREFIX: 


parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute firewall-rules create on-prem-allow-custom \
   --network on-prem \
   --allow tcp:0-65535,udp:0-65535,icmp \
   --source-ranges 192.168.0.0/16
 Creating firewall…working..Created [https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/global/firewalls/on-prem-allow-custom].      
 Creating firewall…done.                                                                                                                                      
 NAME: on-prem-allow-custom
 NETWORK: on-prem
 DIRECTION: INGRESS
 PRIORITY: 1000
 ALLOW: tcp:0-65535,udp:0-65535,icmp
 DENY: 
 DISABLED: False


 
parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 
parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute firewall-rules create on-prem-allow-ssh-icmp \
     --network on-prem \
     --allow tcp:22,icmp
 Creating firewall…working..Created [https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/global/firewalls/on-prem-allow-ssh-icmp].    
 Creating firewall…done.                                                                                                                                      
 NAME: on-prem-allow-ssh-icmp
 NETWORK: on-prem
 DIRECTION: INGRESS
 PRIORITY: 1000
 ALLOW: tcp:22,icmp
 DENY: 
 DISABLED: False


 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute instances create on-prem-instance1 --zone us-central1-a --subnet on-prem-subnet1
 Created [https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/zones/us-central1-a/instances/on-prem-instance1].
 NAME: on-prem-instance1
 ZONE: us-central1-a
 MACHINE_TYPE: n1-standard-1
 PREEMPTIBLE: 
 INTERNAL_IP: 192.168.1.2
 EXTERNAL_IP: 104.197.26.214
 STATUS: RUNNING
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ ^C
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ ^C
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 


parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute vpn-gateways create vpc-demo-vpn-gw1 --network vpc-demo --region us-central1

Creating VPN Gateway…done.                                                                                                                                   
 NAME: vpc-demo-vpn-gw1
 INTERFACE0: 35.242.103.120
 INTERFACE1: 34.157.235.229
 INTERFACE0_IPV6: 
 INTERFACE1_IPV6: 
 NETWORK: vpc-demo
 REGION: us-central1



parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute vpn-gateways create on-prem-vpn-gw1 --network on-prem --region us-central1

 Creating VPN Gateway…done.                                                                                                                                   
 NAME: on-prem-vpn-gw1
 INTERFACE0: 35.242.120.135
 INTERFACE1: 34.157.225.8
 INTERFACE0_IPV6: 
 INTERFACE1_IPV6: 
 NETWORK: on-prem
 REGION: us-central1


parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute vpn-gateways describe vpc-demo-vpn-gw1 --region us-central1


 creationTimestamp: '2023-06-04T03:53:08.310-07:00'
 id: '7860576168189219835'
 kind: compute#vpnGateway
 labelFingerprint: 42WmSpB8rSM=
 name: vpc-demo-vpn-gw1
 network: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/global/networks/vpc-demo
 region: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1
 selfLink: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/vpnGateways/vpc-demo-vpn-gw1
 stackType: IPV4_ONLY
 vpnInterfaces:
 id: 0
 ipAddress: 35.242.103.120
 id: 1
 ipAddress: 34.157.235.229


parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute vpn-gateways describe on-prem-vpn-gw1 --region us-central1

 creationTimestamp: '2023-06-04T03:53:53.224-07:00'
 id: '8774015265648268206'
 kind: compute#vpnGateway
 labelFingerprint: 42WmSpB8rSM=
 name: on-prem-vpn-gw1
 network: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/global/networks/on-prem
 region: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1
 selfLink: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/vpnGateways/on-prem-vpn-gw1
 stackType: IPV4_ONLY
 vpnInterfaces:
 id: 0
 ipAddress: 35.242.120.135
 id: 1
 ipAddress: 34.157.225.8


parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute routers create vpc-demo-router1 \
 --region us-central1 \
 --network vpc-demo \
 --asn 65001

 Creating router [vpc-demo-router1]…done.                                                                                                                     
 NAME: vpc-demo-router1
 REGION: us-central1
 NETWORK: vpc-demo


parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute routers create on-prem-router1 \
 --region us-central1 \
 --network on-prem \
 --asn 65002

 Creating router [on-prem-router1]…done.                                                                                                                      
 NAME: on-prem-router1
 REGION: us-central1
 NETWORK: on-prem

parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute vpn-tunnels create vpc-demo-tunnel0 \
 --peer-gcp-gateway on-prem-vpn-gw1 \
 --region us-central1 \
 --ike-version 2 \
 --shared-secret [SHARED_SECRET] \
 --router vpc-demo-router1 \
 --vpn-gateway vpc-demo-vpn-gw1 \
 --interface 0


 Creating VPN tunnel…done.                                                                                                                                    
 NAME: vpc-demo-tunnel0
 REGION: us-central1
 GATEWAY: vpc-demo-vpn-gw1
 VPN_INTERFACE: 0
 PEER_ADDRESS: 35.242.120.135


parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute vpn-tunnels create vpc-demo-tunnel1 \
 --peer-gcp-gateway on-prem-vpn-gw1 \
 --region us-central1 \
 --ike-version 2 \
 --shared-secret [SHARED_SECRET] \
 --router vpc-demo-router1 \
 --vpn-gateway vpc-demo-vpn-gw1 \
 --interface 1


 Creating VPN tunnel…done.                                                                                                                                    
 NAME: vpc-demo-tunnel1
 REGION: us-central1
 GATEWAY: vpc-demo-vpn-gw1
 VPN_INTERFACE: 1
 PEER_ADDRESS: 34.157.225.8


parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute vpn-tunnels create on-prem-tunnel0 \
 --peer-gcp-gateway vpc-demo-vpn-gw1 \
 --region us-central1 \
 --ike-version 2 \
 --shared-secret [SHARED_SECRET] \
 --router on-prem-router1 \
 --vpn-gateway on-prem-vpn-gw1 \
 --interface 0

 Creating VPN tunnel…done.                                                                                                                                    
 NAME: on-prem-tunnel0
 REGION: us-central1
 GATEWAY: on-prem-vpn-gw1
 VPN_INTERFACE: 0
 PEER_ADDRESS: 35.242.103.120


parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute vpn-tunnels create on-prem-tunnel1 \
 --peer-gcp-gateway vpc-demo-vpn-gw1 \
 --region us-central1 \
 --ike-version 2 \
 --shared-secret [SHARED_SECRET] \
 --router on-prem-router1 \
 --vpn-gateway on-prem-vpn-gw1 \
 --interface 1


 Creating VPN tunnel…done.                                                                                                                                    
 NAME: on-prem-tunnel1
 REGION: us-central1
 GATEWAY: on-prem-vpn-gw1
 VPN_INTERFACE: 1
 PEER_ADDRESS: 34.157.235.229

parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute routers add-interface vpc-demo-router1 \
 --interface-name if-tunnel0-to-on-prem \
 --ip-address 169.254.0.1 \
 --mask-length 30 \
 --vpn-tunnel vpc-demo-tunnel0 \
 --region us-central1
 Updated [https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/routers/vpc-demo-router1].
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute routers add-bgp-peer vpc-demo-router1 \
 --peer-name bgp-on-prem-tunnel0 \
 --interface if-tunnel0-to-on-prem \
 --peer-ip-address 169.254.0.2 \
 --peer-asn 65002 \
 --region us-central1
 Creating peer [bgp-on-prem-tunnel0] in router [vpc-demo-router1]…done. 

                                                                                      
parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute routers add-interface vpc-demo-router1 \
 --interface-name if-tunnel1-to-on-prem \
 --ip-address 169.254.1.1 \
 --mask-length 30 \
 --vpn-tunnel vpc-demo-tunnel1 \
 --region us-central1
 Updated [https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/routers/vpc-demo-router1].

parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute routers add-bgp-peer vpc-demo-router1 \
 --peer-name bgp-on-prem-tunnel1 \
 --interface if-tunnel1-to-on-prem \
 --peer-ip-address 169.254.1.2 \
 --peer-asn 65002 \
 --region us-central1
 Creating peer [bgp-on-prem-tunnel1] in router [vpc-demo-router1]…done.   
                                                                                    
parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute routers add-interface on-prem-router1 \
 --interface-name if-tunnel0-to-vpc-demo \
 --ip-address 169.254.0.2 \
 --mask-length 30 \
 --vpn-tunnel on-prem-tunnel0 \
 --region us-central1
 Updated [https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/routers/on-prem-router1].

parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute routers add-bgp-peer on-prem-router1 \
 --peer-name bgp-vpc-demo-tunnel0 \
 --interface if-tunnel0-to-vpc-demo \
 --peer-ip-address 169.254.0.1 \
 --peer-asn 65001 \
 --region us-central1
 Creating peer [bgp-vpc-demo-tunnel0] in router [on-prem-router1]…done.                                                                                       
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 


parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute routers add-interface  on-prem-router1 \
 --interface-name if-tunnel1-to-vpc-demo \
 --ip-address 169.254.1.2 \
 --mask-length 30 \
 --vpn-tunnel on-prem-tunnel1 \
 --region us-central1
 Updated [https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/routers/on-prem-router1].
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 

parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute routers add-bgp-peer  on-prem-router1 \
 --peer-name bgp-vpc-demo-tunnel1 \
 --interface if-tunnel1-to-vpc-demo \
 --peer-ip-address 169.254.1.1 \
 --peer-asn 65001 \
 --region us-central1
 Creating peer [bgp-vpc-demo-tunnel1] in router [on-prem-router1]…done.                                                                                       
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 


parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute routers describe vpc-demo-router1 \
 --region us-central1
 bgp:
 advertiseMode: DEFAULT
 asn: 65001
 keepaliveInterval: 20
 bgpPeers:
 bfd:
 minReceiveInterval: 1000
 minTransmitInterval: 1000
 multiplier: 5
 sessionInitializationMode: DISABLED
 enable: 'TRUE'
 enableIpv6: false
 interfaceName: if-tunnel0-to-on-prem
 ipAddress: 169.254.0.1
 name: bgp-on-prem-tunnel0
 peerAsn: 65002
 peerIpAddress: 169.254.0.2
 bfd:
 minReceiveInterval: 1000
 minTransmitInterval: 1000
 multiplier: 5
 sessionInitializationMode: DISABLED
 enable: 'TRUE'
 enableIpv6: false
 interfaceName: if-tunnel1-to-on-prem
 ipAddress: 169.254.1.1
 name: bgp-on-prem-tunnel1
 peerAsn: 65002
 peerIpAddress: 169.254.1.2
 creationTimestamp: '2023-06-04T03:55:49.112-07:00'
 encryptedInterconnectRouter: false
 id: '3353074202253054810'
 interfaces:
 ipRange: 169.254.0.1/30
 linkedVpnTunnel: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/vpnTunnels/vpc-demo-tunnel0
 name: if-tunnel0-to-on-prem
 ipRange: 169.254.1.1/30
 linkedVpnTunnel: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/vpnTunnels/vpc-demo-tunnel1
 name: if-tunnel1-to-on-prem
 kind: compute#router
 name: vpc-demo-router1
 network: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/global/networks/vpc-demo
 region: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1
 selfLink: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/routers/vpc-demo-router1
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 

parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute routers describe on-prem-router1 \
 --region us-central1
 bgp:
 advertiseMode: DEFAULT
 asn: 65002
 keepaliveInterval: 20
 bgpPeers:
 bfd:
 minReceiveInterval: 1000
 minTransmitInterval: 1000
 multiplier: 5
 sessionInitializationMode: DISABLED
 enable: 'TRUE'
 enableIpv6: false
 interfaceName: if-tunnel0-to-vpc-demo
 ipAddress: 169.254.0.2
 name: bgp-vpc-demo-tunnel0
 peerAsn: 65001
 peerIpAddress: 169.254.0.1
 bfd:
 minReceiveInterval: 1000
 minTransmitInterval: 1000
 multiplier: 5
 sessionInitializationMode: DISABLED
 enable: 'TRUE'
 enableIpv6: false
 interfaceName: if-tunnel1-to-vpc-demo
 ipAddress: 169.254.1.2
 name: bgp-vpc-demo-tunnel1
 peerAsn: 65001
 peerIpAddress: 169.254.1.1
 creationTimestamp: '2023-06-04T03:56:27.590-07:00'
 encryptedInterconnectRouter: false
 id: '8565633360935899956'
 interfaces:
 ipRange: 169.254.0.2/30
 linkedVpnTunnel: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/vpnTunnels/on-prem-tunnel0
 name: if-tunnel0-to-vpc-demo
 ipRange: 169.254.1.2/30
 linkedVpnTunnel: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/vpnTunnels/on-prem-tunnel1
 name: if-tunnel1-to-vpc-demo
 kind: compute#router
 name: on-prem-router1
 network: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/global/networks/on-prem
 region: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1
 selfLink: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/routers/on-prem-router1
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute firewall-rules create vpc-demo-allow-subnets-from-on-prem \
 --network vpc-demo \
 --allow tcp,udp,icmp \
 --source-ranges 192.168.1.0/24
 Creating firewall…working..Created [https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/global/firewalls/vpc-demo-allow-subnets-from-on-prem].
 Creating firewall…done.                                                                                                                                      
 NAME: vpc-demo-allow-subnets-from-on-prem
 NETWORK: vpc-demo
 DIRECTION: INGRESS
 PRIORITY: 1000
 ALLOW: tcp,udp,icmp
 DENY: 
 DISABLED: False


parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute firewall-rules create on-prem-allow-subnets-from-vpc-demo \
 --network on-prem \
 --allow tcp,udp,icmp \
 --source-ranges 10.1.1.0/24,10.2.1.0/24
 Creating firewall…working..Created [https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/global/firewalls/on-prem-allow-subnets-from-vpc-demo].
 Creating firewall…done.                                                                                                                                      
 NAME: on-prem-allow-subnets-from-vpc-demo
 NETWORK: on-prem
 DIRECTION: INGRESS
 PRIORITY: 1000
 ALLOW: tcp,udp,icmp
 DENY: 
 DISABLED: False


parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute vpn-tunnels list
 NAME: on-prem-tunnel0
 REGION: us-central1
 GATEWAY: on-prem-vpn-gw1
 PEER_ADDRESS: 35.242.103.120 
 NAME: on-prem-tunnel1
 REGION: us-central1
 GATEWAY: on-prem-vpn-gw1
 PEER_ADDRESS: 34.157.235.229
 NAME: vpc-demo-tunnel0
 REGION: us-central1
 GATEWAY: vpc-demo-vpn-gw1
 PEER_ADDRESS: 35.242.120.135
 NAME: vpc-demo-tunnel1
 REGION: us-central1
 GATEWAY: vpc-demo-vpn-gw1
 PEER_ADDRESS: 34.157.225.8
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute vpn-tunnels describe vpc-demo-tunnel0 \
       --region us-central1
 creationTimestamp: '2023-06-04T04:00:19.702-07:00'
 description: ''
 detailedStatus: Tunnel is up and running.
 id: '2795067897923358764'
 ikeVersion: 2
 kind: compute#vpnTunnel
 labelFingerprint: 42WmSpB8rSM=
 localTrafficSelector:
 0.0.0.0/0
 name: vpc-demo-tunnel0
 peerGcpGateway: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/vpnGateways/on-prem-vpn-gw1
 peerIp: 35.242.120.135
 region: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1
 remoteTrafficSelector:
 0.0.0.0/0
 router: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/routers/vpc-demo-router1
 selfLink: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/vpnTunnels/vpc-demo-tunnel0
 sharedSecret: '*'
 sharedSecretHash: 8od780doVaTxAqLtoeHMF8gJn0Hf
 status: ESTABLISHED
 vpnGateway: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/vpnGateways/vpc-demo-vpn-gw1
 vpnGatewayInterface: 0
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 


parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute vpn-tunnels describe vpc-demo-tunnel1 \
   --region us-central1
 creationTimestamp: '2023-06-04T04:01:03.471-07:00'
 description: ''
 detailedStatus: Tunnel is up and running.
 id: '5714240586422276096'
 ikeVersion: 2
 kind: compute#vpnTunnel
 labelFingerprint: 42WmSpB8rSM=
 localTrafficSelector:
 0.0.0.0/0
 name: vpc-demo-tunnel1
 peerGcpGateway: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/vpnGateways/on-prem-vpn-gw1
 peerIp: 34.157.225.8
 region: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1
 remoteTrafficSelector:
 0.0.0.0/0
 router: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/routers/vpc-demo-router1
 selfLink: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/vpnTunnels/vpc-demo-tunnel1
 sharedSecret: '*'
 sharedSecretHash: 5JAseLXPAdaozDs3ZuWrxxPBJAjs
 status: ESTABLISHED
 vpnGateway: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/vpnGateways/vpc-demo-vpn-gw1
 vpnGatewayInterface: 1
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute vpn-tunnels describe on-prem-tunnel0 \
   --region us-central1
 creationTimestamp: '2023-06-04T04:02:03.105-07:00'
 description: ''
 detailedStatus: Tunnel is up and running.
 id: '2881308388800713156'
 ikeVersion: 2
 kind: compute#vpnTunnel
 labelFingerprint: 42WmSpB8rSM=
 localTrafficSelector:
 0.0.0.0/0
 name: on-prem-tunnel0
 peerGcpGateway: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/vpnGateways/vpc-demo-vpn-gw1
 peerIp: 35.242.103.120
 region: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1
 remoteTrafficSelector:
 0.0.0.0/0
 router: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/routers/on-prem-router1
 selfLink: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/vpnTunnels/on-prem-tunnel0
 sharedSecret: '*'
 sharedSecretHash: 6VIWvLMnVl_a6szUkrG3l8M7BD4n
 status: ESTABLISHED
 vpnGateway: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/vpnGateways/on-prem-vpn-gw1
 vpnGatewayInterface: 0
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 


parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute vpn-tunnels describe on-prem-tunnel1 \
   --region us-central1
 creationTimestamp: '2023-06-04T04:02:21.586-07:00'
 description: ''
 detailedStatus: Tunnel is up and running.
 id: '3776339213479432658'
 ikeVersion: 2
 kind: compute#vpnTunnel
 labelFingerprint: 42WmSpB8rSM=
 localTrafficSelector:
 0.0.0.0/0
 name: on-prem-tunnel1
 peerGcpGateway: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/vpnGateways/vpc-demo-vpn-gw1
 peerIp: 34.157.235.229
 region: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1
 remoteTrafficSelector:
 0.0.0.0/0
 router: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/routers/on-prem-router1
 selfLink: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/vpnTunnels/on-prem-tunnel1
 sharedSecret: '*'
 sharedSecretHash: JrvemMy7bn7oGmcAHRiIN1ZbYR_k
 status: ESTABLISHED
 vpnGateway: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/vpnGateways/on-prem-vpn-gw1
 vpnGatewayInterface: 1
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ ^C
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$  
 ----------------------------------------------------------------##session2 ----------------------------------------------------------
 Welcome to Cloud Shell! Type "help" to get started.
 Your Cloud Platform project in this session is set to qwiklabs-gcp-02-18918b9b83e4.
 Use “gcloud config set project [PROJECT_ID]” to change to a different project.
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute ssh on-prem-instance1 --zone us-central1-a
 WARNING: The private SSH key file for gcloud does not exist.
 WARNING: The public SSH key file for gcloud does not exist.
 WARNING: You do not have an SSH key for gcloud.
 WARNING: SSH keygen will be executed to generate a key.
 This tool needs to create the directory [/home/parwezgcp01/.ssh] before being able to generate SSH keys.
 Do you want to continue (Y/n)?  Y
 Generating public/private rsa key pair.
 Enter passphrase (empty for no passphrase): 
 Enter same passphrase again: 
 Your identification has been saved in /home/parwezgcp01/.ssh/google_compute_engine
 Your public key has been saved in /home/parwezgcp01/.ssh/google_compute_engine.pub
 The key fingerprint is:
 SHA256:6xTvAOuUNMtB+JtZP8CBSPUW5UOEUmybWubV79oVVRw parwezgcp01@cs-418137059439-default
 The key's randomart image is:
 +---[RSA 3072]----+
 |    …oo++    Eo|
 |   . o.o++      o|
 |    o oo+oo.    .|
 |     o o=….   .|
 |      =S.   . . | |     o.%.    . .|
 |      X + +  .  .|
 |     o o o . … |
 |      . . . …  |
 +----[SHA256]-----+
 Warning: Permanently added 'compute.9055334240556798602' (ECDSA) to the list of known hosts.
 Linux on-prem-instance1 5.10.0-22-cloud-amd64 #1 SMP Debian 5.10.178-3 (2023-04-22) x86_64
 The programs included with the Debian GNU/Linux system are free software;
 the exact distribution terms for each program are described in the
 individual files in /usr/share/doc/*/copyright.
 Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
 permitted by applicable law.
 Creating directory '/home/student-04-e3038f7d7be0'.

 student-04-e3038f7d7be0@on-prem-instance1:~$ hostname -f 
 on-prem-instance1.us-central1-a.c.qwiklabs-gcp-02-18918b9b83e4.internal

 student-04-e3038f7d7be0@on-prem-instance1:~$ hostname -i
 192.168.1.2

 student-04-e3038f7d7be0@on-prem-instance1:~$ exit 
 logout
 Connection to 104.197.26.214 closed.

parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute ssh on-prem-instance1 --zone us-central1-a^C

 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ hostname -f 
 cs-418137059439-default
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ hostname -i
 172.17.0.4

parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute ssh on-prem-instance1 --zone us-central1-a
 Linux on-prem-instance1 5.10.0-22-cloud-amd64 #1 SMP Debian 5.10.178-3 (2023-04-22) x86_64
 The programs included with the Debian GNU/Linux system are free software;
 the exact distribution terms for each program are described in the
 individual files in /usr/share/doc/*/copyright.
 Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
 permitted by applicable law.
 Last login: Sun Jun  4 11:13:13 2023 from 34.142.137.39
 student-04-e3038f7d7be0@on-prem-instance1:~$ 
 student-04-e3038f7d7be0@on-prem-instance1:~$ ping -c 4 10.1.1.2
 PING 10.1.1.2 (10.1.1.2) 56(84) bytes of data.
 64 bytes from 10.1.1.2: icmp_seq=1 ttl=62 time=7.31 ms
 64 bytes from 10.1.1.2: icmp_seq=2 ttl=62 time=1.79 ms
 64 bytes from 10.1.1.2: icmp_seq=3 ttl=62 time=1.30 ms
 64 bytes from 10.1.1.2: icmp_seq=4 ttl=62 time=1.26 ms
 --- 10.1.1.2 ping statistics ---
 4 packets transmitted, 4 received, 0% packet loss, time 3005ms
 rtt min/avg/max/mdev = 1.260/2.913/7.311/2.547 ms
 student-04-e3038f7d7be0@on-prem-instance1:~$ ^C
 student-04-e3038f7d7be0@on-prem-instance1:~$ 
 student-04-e3038f7d7be0@on-prem-instance1:~$ 
 student-04-e3038f7d7be0@on-prem-instance1:~$ ping -c 4 10.1.1.2
 PING 10.1.1.2 (10.1.1.2) 56(84) bytes of data.
 64 bytes from 10.1.1.2: icmp_seq=1 ttl=62 time=1.34 ms
 64 bytes from 10.1.1.2: icmp_seq=2 ttl=62 time=1.22 ms
 ^C
 --- 10.1.1.2 ping statistics ---
 2 packets transmitted, 2 received, 0% packet loss, time 1002ms
 rtt min/avg/max/mdev = 1.216/1.277/1.338/0.061 ms
 student-04-e3038f7d7be0@on-prem-instance1:~$ nslookup  10.1.1.2
 -bash: nslookup: command not found
 student-04-e3038f7d7be0@on-prem-instance1:~$ 
 student-04-e3038f7d7be0@on-prem-instance1:~$ 
 student-04-e3038f7d7be0@on-prem-instance1:~$ ping -c 2 10.2.1.2
 PING 10.2.1.2 (10.2.1.2) 56(84) bytes of data.
 64 bytes from 10.2.1.2: icmp_seq=1 ttl=62 time=36.6 ms
 64 bytes from 10.2.1.2: icmp_seq=2 ttl=62 time=31.4 ms
 --- 10.2.1.2 ping statistics ---
 2 packets transmitted, 2 received, 0% packet loss, time 1002ms
 rtt min/avg/max/mdev = 31.368/33.988/36.608/2.620 ms
 student-04-e3038f7d7be0@on-prem-instance1:~$ 
 student-04-e3038f7d7be0@on-prem-instance1:~$ 
 student-04-e3038f7d7be0@on-prem-instance1:~$ ping -c 2 10.2.1.2
 PING 10.2.1.2 (10.2.1.2) 56(84) bytes of data.
 64 bytes from 10.2.1.2: icmp_seq=1 ttl=62 time=35.2 ms
 64 bytes from 10.2.1.2: icmp_seq=2 ttl=62 time=31.3 ms
 --- 10.2.1.2 ping statistics ---
 2 packets transmitted, 2 received, 0% packet loss, time 1001ms
 rtt min/avg/max/mdev = 31.319/33.256/35.193/1.937 ms
 student-04-e3038f7d7be0@on-prem-instance1:~$ 
 student-04-e3038f7d7be0@on-prem-instance1:~$ nslookup  10.1.1.2
 -bash: nslookup: command not found
 student-04-e3038f7d7be0@on-prem-instance1:~$ ping -c 4 10.1.1.2
 PING 10.1.1.2 (10.1.1.2) 56(84) bytes of data.
 64 bytes from 10.1.1.2: icmp_seq=1 ttl=62 time=3.65 ms
 64 bytes from 10.1.1.2: icmp_seq=2 ttl=62 time=0.980 ms
 64 bytes from 10.1.1.2: icmp_seq=3 ttl=62 time=0.965 ms
 64 bytes from 10.1.1.2: icmp_seq=4 ttl=62 time=1.04 ms
 --- 10.1.1.2 ping statistics ---
 4 packets transmitted, 4 received, 0% packet loss, time 3004ms
 rtt min/avg/max/mdev = 0.965/1.658/3.646/1.148 ms
 student-04-e3038f7d7be0@on-prem-instance1:~$ 
 ----------------------------------------------------------------##session ----------------------------------------------------------
 Welcome to Cloud Shell! Type "help" to get started.
 Your Cloud Platform project in this session is set to qwiklabs-gcp-02-18918b9b83e4.
 Use “gcloud config set project [PROJECT_ID]” to change to a different project.
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute networks update vpc-demo --bgp-routing-mode GLOBAL
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute networks describe vpc-demo
 autoCreateSubnetworks: false
 creationTimestamp: '2023-06-04T03:43:09.729-07:00'
 id: '6857456010401010770'
 kind: compute#network
 name: vpc-demo
 networkFirewallPolicyEnforcementOrder: AFTER_CLASSIC_FIREWALL
 routingConfig:
   routingMode: GLOBAL
 selfLink: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/global/networks/vpc-demo
 selfLinkWithId: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/global/networks/6857456010401010770
 subnetworks:
 https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-east1/subnetworks/vpc-demo-subnet2
 https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/subnetworks/vpc-demo-subnet1
 x_gcloud_bgp_routing_mode: GLOBAL
 x_gcloud_subnet_mode: CUSTOM
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$  
 -------------------------------------------session 4------------------------------------------------------
 Welcome to Cloud Shell! Type "help" to get started.
 Your Cloud Platform project in this session is set to qwiklabs-gcp-02-18918b9b83e4.
 Use “gcloud config set project [PROJECT_ID]” to change to a different project.
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 


parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute vpn-tunnels delete vpc-demo-tunnel0  --region us-central1
 The following vpn tunnels will be deleted:
 [vpc-demo-tunnel0] in [us-central1] 
 Do you want to continue (Y/n)?  Y
 Deleting VPN tunnel…done.                                                                                                                                    
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ 
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute vpn-tunnels describe on-prem-tunnel0  --region us-central1
 creationTimestamp: '2023-06-04T04:02:03.105-07:00'
 description: ''
 detailedStatus: Tunnel is up and running.
 id: '2881308388800713156'
 ikeVersion: 2
 kind: compute#vpnTunnel
 labelFingerprint: 42WmSpB8rSM=
 localTrafficSelector:
 0.0.0.0/0
 name: on-prem-tunnel0
 peerGcpGateway: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/vpnGateways/vpc-demo-vpn-gw1
 peerIp: 35.242.103.120
 region: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1
 remoteTrafficSelector:
 0.0.0.0/0
 router: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/routers/on-prem-router1
 selfLink: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/vpnTunnels/on-prem-tunnel0
 sharedSecret: '*'
 sharedSecretHash: 6VIWvLMnVl_a6szUkrG3l8M7BD4n
 status: ESTABLISHED
 vpnGateway: https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/vpnGateways/on-prem-vpn-gw1
 vpnGatewayInterface: 0
 parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$ gcloud compute vpn-tunnels describe vpc-demo-tunnel0  --region us-central1
 ERROR: (gcloud.compute.vpn-tunnels.describe) HTTPError 404: The resource 'projects/qwiklabs-gcp-02-18918b9b83e4/regions/us-central1/vpnTunnels/vpc-demo-tunnel0' was not found
parwezgcp01@cloudshell:~ (qwiklabs-gcp-02-18918b9b83e4)$  

 91 total views,  2 views today

Leave a Reply

Your email address will not be published. Required fields are marked *