Welcome to Sysnet Board คู่มือ การใช้งานอุปกรณ์ Network. Please log in or sign up.
สมาชิกทั้งหมด
17,614
กระทู้ทั้งหมด
10,049
หัวข้อทั้งหมด
4,721

  • คู่มือการ Config WireGuard VPN บน TP-Link Router
    เริ่มโดย yod
    Read 2,260 times
0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้
yod

 

 
คู่มือการ Config WireGuard VPN บน TP-Link Router


อุปกรณ์ TP-Link Router Omada Series ได้รองรับ WireGuard VPN แล้วนะครับ


*** กรณีต้องการติดตั้ง VPN เพื่อเชื่อมต่อเข้ามาในสำนักงาน จะมีรายละเอียดพอสมควร รบกวนอ่านในหัวข้อนี้กันก่อนครับ ต้องการเชื่อมเครือข่าย Network ระหว่างสำนักงานด้วย VPN
ข้อดีของ WireGuard VPN
***



Protocol WireGuard VPN

ข้อดี
- เร็ว ค่า VPN Throughput จะสูงกว่าพวก VPN Protocol รุ่นเก่าๆเช่น L2TP, PPTP
- กรณีทีทำ VPN แบบ Client To Site หรือ Client Remote เข้ามาในสำนักงาน ฝั่ง Client ที่อยู่ Network ปลายทางแล้ววงเดียวกัน จะ Remote เข้ามาพร้อมๆกันได้หลายเครื่อง
- สามารถเปลี่ยน Port สำหรับเชื่อมต่อ VPN เข้ามาได้

ข้อเสีย
- Config จะยากซักหน่อย
- ต้องติดตั้ง Software WireGuard เพิ่ม


ตัวอย่างการ Config WireGuard VPN ในหัวข้อนี้จะทำผ่าน TP-Link Controller ครับ ส่วน TP-Link Router จะเป็นรุ่น TP-LINK ER707-M2 Omada Multi-Gigabit VPN Router, 6 WAN Internet


Config ให้ TPLink Router ออก Internet และทำการ Config Dynamic DNS โดยจะใช้ Service ของ No-IP





1. สร้าง WireGuard Interface

Login เข้า TP-Link Controller

Menu VPN --> WireGuard --> Click [Create New WireGuard]



Create New WireGuard

Name: กำหนดชื่อ
Status: Enable
MTU: 1420 (Default)
Listen Port: 51820 (Default)
Local IP Address: หมายเลข IP ของ Interface WireGuard (ควรเป็น IP วงเดียวกันกับ TP-Link Router)



Click [Apply]


*** ทำการ Copy Public Key ใส่ไว้ใน Notepad จะเป็น Public Key ในส่วน Peer ที่จะใส่ใน Software WireGuard




2. ติดตั้ง Software WireGuard

Download Software WireGuard https://www.wireguard.com/install/ แล้วทำการติดตั้งให้เรียบร้อย ในตัวอย่างนี้จะใช้บน Windows นะครับ

Software WireGuard --> Click [Add Tunnels] --> Add empty tunnel



*** ทำการ Copy Public Key ใส่ไว้ใน Notepad จะเป็น Public Key ในส่วน Interface ที่จะใส่ใน Software WireGuard


3. สร้าง Peers

TP-Link Router --> Menu VPN --> WireGuard --> Tab Peers --> Click [Create New Peer]




Name: ชื่อ Peer
Status: Enable
Interface: ชื่อ Interface ที่สร้างไว้ในข้อ 1
Allow Address: กำหนดหมายเลข IP
Public Key: นำ Public Key ที่ได้จากข้อ 2 มาใส่



Click [Apply]


4. แก้ไข Tunnel Config ของ Software WireGuard

Format ของ Config จะประมาณนี้ครับ


[Interface]
PrivateKey = qMGz9F4yQ2XLNG9h4Pqp88afjM6ir0+ejIjuCiop+2Y=
Address = 10.0.0.2/24
DNS = 8.8.8.8, 8.8.4.4

[Peer]
PublicKey = leT8mzBSbox/QBdgz96238TgANQu9wDJjIQNaGqfWSo=
AllowedIPs = 0.0.0.0/0
Endpoint = sysnet.ddns.net:51820




รายละเอียดตามนี้ครับ

PrivateKey: ค่า Drafault ที่ Software WireGuard สร้างขึ้นมา ไม่ต้องแก้ไข
Address: Allow Address จากข้อ 3
DNS = 8.8.8.8, 8.8.4.4
PublicKey: Public Key จากข้อ 1
AllowedIPs = 0.0.0.0/0
Endpoint = IP WAN ของ TP-Link Router หรือ Dynamic DNS:Listen Port จากข้อ 1






ทดสอบ

Click [Activate] ถ้า Config ถูกต้อง จะมี Data Trnasfer





ตรวจสอบ Status ได้ที่ Menu Insign




ทดลอง Ping ไปยังเครื่องที่อยู่ในสำนักงาน

ถ้า Ping ไม่ได้ อาจจะ Config ไม่ถูกต้อง หรือ ติด Firewall บน Windows




ลอง Transfer File จะได้ Throughput สูงกว่า VPN แบบ L2TP เกือบ 3 เท่า




เรียบร้อยครับ