As google document that we can use VPC Network Peering? VPC Network Peering is a decentralized or distributed approach to multi-project networking. Additional, it works with Compute Engine, Kubernetes Engine,and App Engine flexible environments.
I did a lab about Virtual Private Cloud (VPC) Network Peering. There shows to do VPC Network Peering between VPC networks in the same project. So, I would like to see how it works on across organizations.
Example: On My Organization (my project), I would like to connect server (Private IP Address) on another Organization (another project).
As a subnet CIDR prefix in one peered VPC network cannot overlap with a subnet CIDR prefix in another peered network. So, both VPC networks must have the different CIDR prefix.
My Organization [myproject] {ubuntu-test, default/10.146.0.2} <======> No organization [qwiklabs-gcp***]{privatenet-us-vm/172.16.0.2}
On No organization [qwiklabs-gcp***]: VPC network name is "privatenet".
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTyVFoAnEj9FPN2Nbuig9GqBK8AsQB65VyuYZoqgChsLa4DjY76KvA5MbzeRbDO4EU_V4oZmpHwmYfzyo8WBg7zZHPW-0GO_k-AqhPCZFy12xkSm0rz4NpUk0DmeHsk6gIiZUSZg/s1600/lab-vm.jpg)
VPC:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKBxnPFyph_2JrWrWMThtzihSN4QBp9qrZL3iNC3JU7apSoXZykoGVgeTJxoFluS08Rp88Oj7pp2RCq2vPx8-7HXmn_Zs2ezfcA85AJle2D0JWCACiewxMJuhK8xwz4IYehQqFjA/s1600/lab-vpc.jpg)
Firewall:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXubYP4OXzKdHuEbfMqnRqRmzzkouLegOWEb94EORW5zecHdGl5xd8VtijBo-zaSzqGSaeOPS0GWfGhbZOFfxzen_WbVxvSWly5T174TVoyeKNSlYsK5Ffbmi0WyOtd2S_sZV8UQ/s1600/lab-firewall.jpg)
My Organization [myproject]: I used "default" VPC and default firewall.
Then, starting to create "VPC Network Peering".
- To create "VPC Network Peering" on myproject: Networking => "VPC network" => "VPC network peering".
Click "Create Peering Connection". name = "peering-to-lab".
Note: you must know Project ID and VPC network name for network destination.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDDV-U9fou5vlja9UBPUiOUXlvotmoLqiUEBP09NR_WMcvBFJlPZ7ND8Ft59zcH-zxIloW80H0dSeP4bTqaBiykxVBEE-cOW6XxgsgSEE3z8f49jGUbJ28WJVg85Gdzpf2xdHnUA/s1600/02.jpg)
It should show "Waiting for peer network to connect".
- To create "VPC Network Peering" on another Project: On No organization [qwiklabs-gcp***], "Create Peering Connection". name = "peering-to-mygcp".
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXr1zZZn9WcXtBcNQpIxGU1MFTb_YcDTAPBDadcD8mPWzdnkRbBUeXiHV43xr-E2GVVsJfH5KyQR237aompLlwdgK8vZnJQkKdrWap96BrtrGWca8V3txMxjgq3kl7Puwx6h-7UA/s1600/03.jpg)
After clicking "Create". It should show "Connected" on both projects (if configuration corrects) like.
On myproject:
- Finally, test connection: ssh to my vm and test (ssh) connection to {privatenet-us-vm/172.16.0.2}.
Note: (as firewall allow icmp/ssh). No need to do on firewall.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisQTrPPd91vezzZqnJW4LHs1hJT7ssGyxpHQvt8QQupgdO4qtsxNmyuHJFoid2iS283xx84LtDIqsI5aDBm2lx_qHbcIYz2HYqBpMVBSgF8DwMYaOz1QxO8imt1IEZyBNL-V8AUw/s1600/06.jpg)
opun@ubuntu-test:~$ ssh 172.16.0.2Reference: https://cloud.google.com/vpc/docs/vpc-peering
opun@172.16.0.2's password:
Linux privatenet-us-vm 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u4 (2018-08-21) 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: Wed Sep 19 06:22:05 2018 from 10.146.0.2
Could not chdir to home directory /home/opun: No such file or directory
$ w
06:22:55 up 43 min, 2 users, load average: 0.00, 0.00, 0.00
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
opun pts/1 10.146.0.2 06:22 1.00s 0.00s 0.00s w ************
No comments:
Post a Comment