NCS - Documents
Go to Portal
  • NIPA Cloud Space Overview
    • Welcome to NIPA Cloud Space documentation
    • NCS User Account
      • Create NIPA Cloud Space Account
      • Loging in to Nipa Cloud Space
      • Reset NCS Password
      • Activating Two-Factor Authentication
      • Deactivating Two-Factor Authentication
    • Co-working Projects
      • Create Co-working Project
      • Manage Project Member
      • Exporting Resource List
    • Billing & Wallet
      • Topup a Project Wallet
      • Redeem Voucher
      • Insufficient Wallet Balance
  • COMPUTE
    • Compute Instance
      • What is OS Status?
      • Launching Compute Instance
      • Managing Instance
        • Stop
        • Start
        • Restart
        • Resize (Change Machine Type)
        • Take Snapshot
        • Auto Backup
        • Reset Linux "root" Password
        • Reset Windows "Administrator" Password
      • SSH to Linux Compute Instance
        • Converting Key Pair for PuTTy
        • Windows Client using Key Pair
        • Windows Client using Password
        • MacOS/Linux using Key Pairs
        • MacOS/Linux using Password
      • Remote Desktop to Windows Instance
      • Setting Docker Image Caching
      • Renaming Instance
      • Exporting Instance List
      • How to change Compute Instance hostname
      • How to install QEMU Guest Agent
      • How to fix update kernel for RHEL
      • How to Update Rocky Linux 9
      • How to Upgrade Rocky Linux to 9.4
      • How to change RDP port on Windows
    • Compute Image
      • Create Image From a Bootable Volume
      • Importing Your Own Image
      • Export Image
      • Share Image to Between Projects
      • Exporting Image List
    • Key Pair
      • Managing Key Pair(s)
      • Creating a New Key Pair
      • Importing an Existing Key Pair
    • Deployment Script
      • Managing Deployment Script
      • Create a Deployment Script
      • Clone a Deployment Script
      • Edit a Deployment Script
      • Delete a Deployment Script
  • STORAGE
    • Block Storage
      • Managing Volume(s)
        • Create From Blank
        • Create From an Image
        • Create From a Volume
        • Create From a Snapshot
        • Transferring a Volume
        • Accepting a Tranferred Volume
        • Renaming a Volume
        • How to Change Volume Type
      • Managing Snapshot(s)
        • Create a Snapshot
        • Renaming a Volume Snapshot
      • Exporting Volume and Volume Snapshot List
    • Object Storage (S3)
      • Migrate file S3 AWS to S3 NIPA
      • Create an Object Storage Bucket
      • Delete an Object Storage Bucket
      • Create an Object Storage Sub-User
      • Regenerate Sub-User's Access Key
      • Revoke Sub-User's Access Key
      • Create Bucket Policy
      • Bucket Versioning
      • Access S3 Bucket with Cyberduck
        • Upload Files to a Bucket
        • Share File via Public Link
      • Access S3 Bucket with s3cmd
        • Basic command
        • การ set ACL สำหรับการเปิดใช้งาน Objects แบบ public
        • การสร้าง Presigned URL สำหรับการใช้งานชั่วคราว
      • Mount S3 Bucket on instances with s3fs-fuse
      • Access S3 buckets With AWS S3 Client SDK
        • S3Client Configuration
        • Basic Command
        • Multipart Upload
      • Access S3 buckets with internal network for NCS instance
      • Delete Lifecycle Policies
      • Move Objects Lifecycle Script
      • Configure a static website using S3 Bucket
    • NIPA Drive
      • Purchasing a Drive
  • NETWORKING
    • Networking
      • Managing VPC Network(s)
        • Create a Network
        • DHCP Setting
        • Create Port
        • Create Router
      • Managing Security Group(s)
        • Create a New Security Group
        • Create Security Group Presets
      • Managing External IP(s)
        • Create an External IP
        • Exporting External IP List
      • NAT Gateway with Ubuntu (VM)
      • NAT and VPN Gateway on NCS with Pfsense-2.6.0
  • LOAD BALANCING
    • Load Balancer as a Service
      • Create Load Balancer
      • Using Network Load Balancing
      • Using Application Load Balancing
      • Renaming a Load Balancer
      • Exporting Load Balancer List
      • Monitoring Load Balancer Using Prometheus
    • SSL Certificate
      • Import SSL Certificate
  • DATABASE AS A SERVICE
    • SQL Database
      • Create SQL Database Instance
        • Create MySQL Database Instance
      • Manage SQL Database Instance
        • Reboot Database Service
        • Delete Database Instance
        • Online Extend Storage Size
        • Edit Allowed CIDR
      • Auto-Scaling SQL Database Storage
        • Enable Auto-Scaling
        • Disable Auto-Scaling
        • Edit Auto-Scaling
      • Manage SQL Database Root User
        • Enable Root User
        • Reset Root User Password
      • Manage SQL Database Schema
        • Create Database Schema
        • Delete Database Schema
      • Manage SQL Database User
        • Create Database User
        • Delete Database User
        • Reset Password
        • Edit Access
      • Manage SQL Database Backup
        • Create Backup
        • Create A New SQL Database Instance From Backup
        • Delete Backup
      • Manage SQL Database Logs
        • Enable Logs
        • Disable Logs
        • Refresh Logs
        • Load More Logs
      • Manage Monitoring User
        • Create Monitoring User
        • Delete Monitoring User
      • Monitor SQL Database with Percona Monitoring and Management (PMM)
  • SCHEDULING
    • Schedules
      • Create Schedule
    • Jobs
  • Public API
    • What is NCS Public API ?
      • Download NCS Project RC File
      • Getting Start with NCS Public API
        • Using OpenStack Client Tool
        • Using REST API
        • Terraform with Openstack
        • Auto-scaling OpenStack Instances with Senlin and Prometheus
          • Installation Prometheus
          • Installation Alertmanager
  • MIGRATION
    • Migrating Linux VM from vSphere to NCS
    • Migrating Windows VM from vSphere to NCS
  • Customer Support
    • Having Problem Before Access a Project
    • Having Problem In a Project
  • Tutorial
    • My First Website
    • Access MySQL Database With MySQL Workbench
    • Pritunl for VPN server
    • Install Rancher Server with Docker Quick Start
      • Create RKE2 Cluster via Rancher Dashboard
    • Install odoo18 with external database
    • How to use LBaaS for mysql Load Balancing
  • Release Notes
    • v5.0.X (v5.0.0-now)
      • v5.0.0
      • v5.1.0
      • v5.2.0
      • v5.2.1
      • v5.2.2
      • v5.2.3
      • v5.2.4
      • v.5.3.0
      • v5.4.0
    • v4.19.X (v4.19.0-v4.19.3)
      • v4.19.0
      • v4.19.1
      • v4.19.2
      • v4.19.3
    • v4.18.X (v4.18.0-v4.18.2)
      • v4.18.0
      • v4.18.1
      • v4.18.2
    • v4.17.X (v4.17.0-v4.17.3)
      • v4.17.0
      • v4.17.0.1
      • v4.17.1
      • v4.17.2
      • v4.17.3
    • v4.16.X (v4.16.0-v4.16.5)
      • v4.16.0
      • v4.16.1
      • v4.16.2
      • v4.16.3
      • v4.16.4
      • v4.16.5
    • v4.15.X (v4.15.0-v4.15.9)
      • v4.15.0
      • v4.15.1
      • v4.15.2
      • v4.15.3
      • v4.15.4
      • v4.15.5
      • v4.15.6
      • v4.15.7
      • v4.15.8
      • v4.15.9
    • v.4.14.X (v4.14.0-v4.14.2)
      • v.4.14.0
      • v4.14.1
      • 4.14.2
Powered by GitBook
On this page
  • Prerequisite
  • Instruction
  • 1. Install
  • 2. Configuration
  • 3. Users and Organizations
  • 4. Servers
  • 5. Users
  • ตัวอย่างการเข้าใช้งานเครื่อง server-1 ซึ่งได้ถูกติดตั้ง Nginx ไว้ โดยทำการเชื่อมต่อ VPN แล้วเข้าใช้งานผ่าน ip 10.10.10.6

Was this helpful?

  1. Tutorial

Pritunl for VPN server

PreviousAccess MySQL Database With MySQL WorkbenchNextInstall Rancher Server with Docker Quick Start

Last updated 6 months ago

Was this helpful?

ผู้ใช้งานสามารถสร้าง VPN Server เองได้เพื่อการจำกัดการเข้าถึงให้เข้าถึงได้เฉพาะผู้ใช้งานที่ได้รับอนุญาต โดยสามารถใช้งานร่วมกับ ( )

Prerequisite

  • VPC Network ที่ต้องการให้สามารถเข้าถึงผ่าน VPN ได้ ( )

  • Instance ที่ใช้สำหรับติดตั้ง Pritunl-Server โดยในส่วนของ Instance Network ให้เลือก VPC ที่ต้องการใช้งาน VPN ( )

Instruction

1. Install

ทำการ ssh เข้าไปยัง Instance ที่ต้องการทำการติดตั้ง Pritunl Server แล้วทำการ Run command ดังนี้

  • Ubuntu22.04

sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list << EOF
deb https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse
EOF

sudo tee /etc/apt/sources.list.d/pritunl.list << EOF
deb https://repo.pritunl.com/stable/apt jammy main
EOF

sudo apt --assume-yes install gnupg
wget -qO- https://www.mongodb.org/static/pgp/server-6.0.asc | sudo tee /etc/apt/trusted.gpg.d/mongodb-org-6.0.asc
gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 7568D9BB55FF9E5287D586017AE645C0CF8E292A
gpg --armor --export 7568D9BB55FF9E5287D586017AE645C0CF8E292A | sudo tee /etc/apt/trusted.gpg.d/pritunl.asc
sudo apt update
sudo apt --assume-yes install pritunl mongodb-org
sudo systemctl start pritunl mongod
sudo systemctl enable pritunl mongod

2. Configuration

เมื่อทำการติดตั้งเสร็จแล้วให้ทำการเข้าใช้งานผ่าน Browser ด้วย External IP

  1. เมื่อเข้าสู่ระบบครั้งแรกจะต้องทำการใส่ setup-key โดยจะสามารถหา setup-key ได้ด้วย command

pritunl setup-key
  1. ต่อไปจะต้องทำการ login โดยใช้ user pritunl และ password สามารถหาได้ด้วยคำสั่ง

pritunl default-password
  1. เมื่อทำการ login ครั้งแรกแล้วจะเข้าสู่หน้า Initial Setup ซึ่งจะสามารถแก้ไขข้อมูลของ root user ได้

3. Users and Organizations

  1. ทำการ Add Organization เพื่อใช้สำหรับการจัดการกลุ่มผู้ใช้งาน

  1. ทำการ Add User ไปยัง Organizations โดยจะสามารถกำหนด pin ได้เพื่อเป็นรหัสการเข้าใช้งาน VPN

  1. เมื่อทำการสร้าง user เรียบร้อยแล้ว จะต้องทำการ Download profile เพื่อเตรียมนำไปส่งต่อให้ user สำหรับการใช้งาน

4. Servers

ในส่วนของการตั้งค่าการเชื่อมต่อ และ routing ต่างๆ สามารถตั้งค่าได้ในส่วนของ Servers

  1. กดไปที่ Add Server และสามรถทำการตั้งค่าได้ดังตัวอย่าง โดยจะมีข้อมูลที่จำเป็นดังนี้

  • Virtual Network -> CIDR ที่จะถูกใช้โดย Clients ที่มาเชื่อมต่อ VPN โดย Subnet ควรจะมีเพียงพอต่อการใช้งานของจำนวนผู้ใช้งาน

  • Bind address -> address ที่จะถูกใช้งานสำหรับ VPN Server โดยเว้นว่างไว้จะเป็นการอนุญาตให้ใช้งานได้ทุก Interface

  • Enable DNS Routing -> เปิดใช้งานสำหรับ Routing ที่ผ่านเข้ามายัง Server จะมีการใช้งาน DNS ที่ถูกกำหนดไว้

  • Enable WireGuard -> เปิดใช้งานสำหรับการเชื่อมต่อผ่าน OpenVPN

  • Ping Interval -> ระยะห่างของช่วงเวลาที่ Server จะทำการตรวจสอบว่าผู้ใช้งานยังทำการเชื่อมต่ออยู่หรือไม่

  • Max Clients -> จำนวนผู้ใช้งานเชื่อมต่อพร้อมกันสูงสุด

  • Allow Multiple Devices -> อนุญาตให้ผู้ใช้งานสามารถเข้าใช้งาน VPN พร้อมกันได้หลายอุปกรณ์

  • Inter-Client Routing -> อนุญาตให้ผู้ใช้งานสามารถสื่อสารถึงกันได้ผ่าน Virtual Network ที่ผู้ใช้งานได้รับ

  1. เมื่อทำการ Add Server เรียบร้อยแล้ว จะมีการ Add route 0.0.0.0/0 มาให้เป็น Default ทำให้ Network traffic ทั้งหมดของผู้ใช้งานจะผ่านมาที่ VPN Server ซึ่งสามารถลบได้ด้วยปุ่ม Remove Route และทำการ Add Route เฉพาะที่ต้องการใช้งานได้

  1. ทำการ Add Route ที่ใช้สำหรับการเข้าใช้งาน Private VPC Network โดยจะทำการยกตัวอย่างหากใช้งาน CIDR 10.10.10.0/24

  1. ทำการ Attach Organization เพื่อทำการกำหนดกลุ่ม User ที่จะใช้งาน Server

  1. เมื่อเรียบร้อยแล้วทำการ Start server เพื่อใช้งาน

5. Users

ผู้ใช้งานสามารถเข้าถึง VPN ผ่านทาง OpenVPN หรือ Pritunl client โดยใช้งานไฟล์ user profile ที่ได้ทำการ download มา

ตัวอย่างการเข้าใช้งานเครื่อง server-1 ซึ่งได้ถูกติดตั้ง Nginx ไว้ โดยทำการเชื่อมต่อ VPN แล้วเข้าใช้งานผ่าน ip 10.10.10.6

ข้อมูลเพิ่มเติมสำหรับการติดตั้ง Pritunl Server

Port -> Port สำหรับการเชื่อมต่อ VPN โดย จะต้องทำการเปิด Port นี้ด้วย

ข้อมูลเพิ่มเติม

NAT Gateway
Managing VPC Network
Launching Instance
https://pritunl.com
Security group
https://docs.pritunl.com/docs/configuration-3