075-845-490 | 097-165-2449
Line ID: @hostnakhonitech
🎉 โปรโมชั่นพิเศษ! ลด 10% สำหรับลูกค้าใหม่
NakhoniTech
075-845-490
support@NakhoniTech.com

ใช้ VPS เป็นตัวกลางผ่าน FRP หรือ WireGuard Print

  • 465

ใช้ VPS เป็นตัวกลางด้วย FRP หรือ WireGuard

ต้องเผชิญกับ

ไม่ต้องการมีเครื่องหลัง NAT หรือไม่มี Public IP ค้นหา VPS นั่นคือ Public IP เพื่อให้เข้าถึงจากภายนอกได้โดยใช้เครื่องมืออย่างFRPหรือWireGuard

✨ ขั้นตอนที่ 1: ใช้ FRP (Fast Reverse Proxy)

ติดตั้ง FRP

wget https://github.com/fatedier/frp/releases/download/v0.58.0/frp_0.58.0_linux_amd64.tar.gz
tar -xvzf frp_0.58.0_linux_amd64.tar.gz
cd frp_0.58.0_linux_amd64

1. ตั้งค่า VPS (frps)

# ไฟล์: frps.ini
[common]
bind_port = 7000
dashboard_port = 7500
dashboard_user = admin
dashboard_pwd = password
# เริ่มใช้งาน
./frps -c frps.ini

2. ตั้งค่าฝั่งเครื่องบ้าน/หลัง NAT (frpc)

# ไฟล์: frpc.ini
[common]
server_addr = YOUR.VPS.IP
server_port = 7000

[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000
# เริ่มใช้งาน
./frpc -c frpc.ini

ทดสอบด้านข้าง

ssh -p 6000 user@YOUR.VPS.IP

วิธีที่ 2: ใช้ WireGuard VPN

1.เบาะ WireGuard

apt install wireguard -y

2. สร้างคีย์แพร์

wg genkey | tee privatekey | wg pubkey > publickey

3. ตั้งค่า VPS (10.10.0.1)

# /etc/wireguard/wg0.conf
[Interface]
Address = 10.10.0.1/24
PrivateKey = PRIVATEKEY_VPS
ListenPort = 51820

[Peer]
PublicKey = PUBLICKEY_CLIENT
AllowedIPs = 10.10.0.2/32

4. ตั้งค่า Client

# /etc/wireguard/wg0.conf
[Interface]
Address = 10.10.0.2/24
PrivateKey = PRIVATEKEY_CLIENT

[Peer]
PublicKey = PUBLICKEY_VPS
Endpoint = YOUR.VPS.IP:51820
AllowedIPs = 0.0.0.0/0
PersistentKeepalive = 25

5.เริ่มดำเนินการ

wg-quick up wg0

ยังไงก็ตาม

ความต้องการ ไฟเบอร์กลาส ไวร์การ์ด
ท่าเรือส่งต่อ เฉพาะ ✅ เหมาะมาก ❌ ไม่เหมาะ
VPN ต่อ ✅ เหมาะมาก
ทีนี้
ใช้ทรัพยากรน้อย

Was this answer helpful?

« Back