> For the complete documentation index, see [llms.txt](https://docs.greennode.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.greennode.ai/vnetwork/vpn-virtual-private-network-site-to-site/demo-site-to-site-vpn.md).

# Demo Site-to-Site VPN

VPN Site-To-Site is a private connection to communicate between two or more private network through a secure connection and safety.

Below is a demonstration of how to connect two LAN networks via the internet secured by a VPN connection (two VPNs at 2 sites)

* Site A: VPC 10.1.0.0/16 with VPN server using PFsense of GreenNode Market Place.
* Site B: VPC 10.200.0.0/16 with VPN server using GreenNode VPN Site-To-Site Service

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-d4a2f0ff612f7c555745afdcc802ca785ab3b692%2Fimage.png?alt=media" alt=""><figcaption><p>Demostration</p></figcaption></figure>

## 1. Create a Remote Site VPN (using PFsense)

### a. Create PFsense server

* Access link <https://marketplace.console.greennode.ai/overview>
* Click Launch
* Choose Flavor (example 2x4)
* Network Settings: External Interface Priority = 1

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-9316579bdae7128ae02cd0f1111cdccf5da7693b%2Fimage.png?alt=media" alt=""><figcaption><p>vMarket Placer - pfSense</p></figcaption></figure>

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-0e22cf22b27b4b2f38aa2f6e15aab4d910aad119%2Fimage.png?alt=media" alt=""><figcaption><p>Request Pfsense - Config Network</p></figcaption></figure>

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-12183a03f0dd9c65015c8d5ad50f953c0291aa74%2Fimage.png?alt=media" alt=""><figcaption><p>Request Pfsense - Config Network</p></figcaption></figure>

### b. Access PFsense Dashboard

* Go to vServer page
* Show detail Created Server and open new Url with IP Public https\://\<FixedIp>.
* Login with default user admin/pfsense

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-c6c9aa22d8fd8555a902f9ec538446fa95af6a93%2Fimage.png?alt=media" alt=""><figcaption><p>Server List</p></figcaption></figure>

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-7344792264909a4e2f27ca2ae2b98bd4f74cb7a8%2Fimage.png?alt=media" alt=""><figcaption><p>Server Detail</p></figcaption></figure>

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-964ec632223664ca56a096776f7b927dc2e7d7f1%2Fimage.png?alt=media" alt=""><figcaption><p>pfSense Admin Dashboard</p></figcaption></figure>

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-f0e2bc90db48134414f9115cf510261b36bc025a%2Fimage.png?alt=media" alt=""><figcaption><p>pfSense Welcome Page</p></figcaption></figure>

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-1cde141d11129893b4224963fb6a6273c6f9dd4d%2Fimage.png?alt=media" alt=""><figcaption><p>pfSense Dashboard - DNS config</p></figcaption></figure>

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-4e2a5ac6b3e662ed7e8a56bbfc699034e93b48e9%2Fimage.png?alt=media" alt=""><figcaption><p>pfSense Dashboard - Timezone config</p></figcaption></figure>

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-2ddd8be45977b43c4a0a6c2e7068510fa5e45e4b%2Fimage.png?alt=media" alt=""><figcaption><p>pfSense Dashboard - WAN config - Keep default</p></figcaption></figure>

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-ef4d9599665da21bbbb95ffe43aa8923d0d8b6b0%2Fimage.png?alt=media" alt=""><figcaption><p>pfSense Dashboard - Update Password</p></figcaption></figure>

### c. Config pfsense Network

* Allow port 443 [**https://61.28.239.244/firewall\_rules.php?if=wan**](https://61.28.239.244/firewall_rules.php?if=wan)

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-6549e05129289331936b8f1112e12b17f5baf4f8%2Fimage.png?alt=media" alt=""><figcaption><p>pfSense Firewall Rule - Allow 443</p></figcaption></figure>

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-c1e27fbf94a352b41c781e5991273e1d691f616f%2Fimage.png?alt=media" alt=""><figcaption><p>pfSense Firewall Rule - Allow UDP any</p></figcaption></figure>

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-93fe61115ab938d1dac4c2ec028d133540bb2f63%2Fimage.png?alt=media" alt=""><figcaption><p>pfSense Firewall Rule - Allow UDP any</p></figcaption></figure>

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-599e602e8ac18c185855e8678fa2cf12b2abd273%2Fimage.png?alt=media" alt=""><figcaption><p>pfSense Firewall Rule - Result</p></figcaption></figure>

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-03d195850fcf55394d22e65c75b1da3ab31f8e34%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

**-** Access to Assign Interface LAN 10.1.0.0/24. [**https://61.28.239.244/interfaces\_assign.php**](https://61.28.239.244/interfaces_assign.php)

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-a0bf6cae862e6012c3ff8001aa146bf4e14a7d5d%2Fimage.png?alt=media" alt=""><figcaption><p>pfSense Interface Assignments - Add LAN Interface</p></figcaption></figure>

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-d5aa226ef49ed7391855807c92d4f33429e5dbd9%2Fimage.png?alt=media" alt=""><figcaption><p>pfSense Interface Assignments - Result</p></figcaption></figure>

\- Enable LAN Interface <https://61.28.239.244/interfaces.php?if=lan>

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-c22463df4593989f5f8eeccc5033b505453eaa0d%2Fimage.png?alt=media" alt=""><figcaption><p>pfSense Interface Lan - Enable Use of LAN</p></figcaption></figure>

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-84f4b6a8ca2c4e1859d6bcfb9a6b53c224339e98%2Fimage.png?alt=media" alt=""><figcaption><p>pfSense Interface Lan - Result</p></figcaption></figure>

**-** Access **https\://\<FixedIp>/firewall\_rules.php** to config firewall rule for LAN

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-cfa55d25abc03600b22afaa3817dbd9c420839c2%2Fimage.png?alt=media" alt=""><figcaption><p>pfSense Firewall Lan</p></figcaption></figure>

**-** Access **https\://\<FixedIp>/firewall\_rules.php** to config firewall rule

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-e3df9c7695af10892eadc10c89a76605533aee57%2Fimage.png?alt=media" alt=""><figcaption><p>pfSense Firewall IPSec</p></figcaption></figure>

## 2. Create a Local Site VPN (using GreenNode VPN)

### a. Create VPN

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-2cbcb9f13c59415703e025e5bc2091b87cd06a41%2Fimage.png?alt=media" alt=""><figcaption><p>GreenNode VPN creates</p></figcaption></figure>

### b. Detail VPN

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-5bc86511314bd0be778ec504fb056c1cb94ab2ce%2Fimage.png?alt=media" alt=""><figcaption><p>GreenNode VPN - Detail</p></figcaption></figure>

## 3. Config pfSense VPN IPSec

### a. Config IPSec Phase 1

* Access IPSec Dashboard *https\://\<FixedIp>/vpn\_ipsec.php*. ***Figure 3 IPSec Dashboard***
* Click “Add P1” to config Phase 1
* Fill your information
  * Key Exchange version: IKEv2
  * Protocol IPv4
  * Interface WAN
  * Remote gateway: Input \<FixedIp>
  * Pre-shared Key: Input your random preshare (anything you want) -> this key will use to input on VNG’s VPN (**Important!**)
  * Encryption Algorithm
* Method AES256 CGM, Key length 128, Hash 256, DH Group 3072 (**Important**!)
  * Life Time: 4 hours = 144000 (**Important!**)
* **Save**

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-7b80996370d1eb0fc2c9afbe50999ee1760978a9%2Fimage.png?alt=media" alt=""><figcaption><p>Figure 4 IPSec Dashboard</p></figcaption></figure>

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-b55b288786dd169d0485e933a0600fcc7416eff5%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-7f8ab61b39c52d117a54096c859ed504d4516d2e%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-75e6d07596cb9b1aa6de150f314ae0061272f6e4%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-01448cb3e765e4022310652f3253e45edf7f565b%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

### b. Config IPSec Phase 2

* Click Add “Phase2”
* Local Network: LAN Subnet
* Remote Network: VPC GreenNode (you selected in create VPN flow) 10.200.0.0/16
* Encryption Algorithms: AES256 (**Important!**)
* Hash SHA 256 (**Important!**)
* LifeTime 16h = 57600 (**Important!**)
* SAVE
* Apply Changes

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-c41cd094adbec55caf781218304fd61d81fce2a2%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-9f2ff060cbf68b111cf16b21d6ec426c61ba1938%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

<div data-full-width="true"><figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-330855840fbe1c3586ee7b88d9b9b4e08b5644b8%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure></div>

### f. Check Status IPSec

* Access IPSec Status link https\://\<FixedIP>/status\_ipsec.php
* Click **Connect P1 and P2s**

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-b8c9d23cf119a1c38c04b5183d4c2cbd5603d230%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-68f54d36cc2f87a1e11773de92d5b963c727a555%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

## 4. Add route on Local Site

* Access VPN Detail and copy Local Private Gateway
* Access vServer Router Tables to config routing for VPN
  * Destination: Remote Private CIDR (10.1.0.0)
  * Target: Local Private Gateway (10.200.3.3)

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-c28a52a77e37de6d9b777363dcb2d41011795179%2Fimage.png?alt=media" alt=""><figcaption><p>VPN Detail - Page</p></figcaption></figure>

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-737a373669822c5a6cc14d0d5d7483eb97a344a8%2Fimage.png?alt=media" alt=""><figcaption><p>Update Route Table</p></figcaption></figure>

## 5. Add route on Remote Site

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-962eafa1db3d9e1f176f39a4d6c80b6f2517c935%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

## 6. Testing Ping Between 2 Client VM

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-85fb31aef59cbe6bd3308dce052ea4d0bdc7ea8d%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
