Skip to main content

การกําหนดค่า Strongswan

StrongSwan เป็นโซลูชัน VPN แบบ IPsec ซึ่งมุ่งเน้นไปที่กลไกการพิสูจน์ตัวตนที่รัดกุมโดยใช้ใบรับรองคีย์สาธารณะ X.509 และที่เก็บข้อมูลเสริมที่ปลอดภัยสำหรับคีย์ส่วนตัวและใบรับรองบนสมาร์ทการ์ดผ่านอินเทอร์เฟซมาตรฐาน PKCS#11 และบน TPM 2.0

แนวคิดการกําหนดค่า

ไฟล์การกําหนดค่าพื้นฐานมีดังนี้:

  • /home/oper/strongswan/strongswan.conf: ไฟล์การกําหนดค่าส่วนกลาง

  • /home/oper/strongswan/ipsec.conf: นิยามอุโมงค์

  • /home/oper/strongswan/ipsec.secrets: รายการคีย์ที่แชร์ล่วงหน้า

  • /home/oper/strongswan/ipsec.d: โฟลเดอร์ของใบรับรอง

โปรดดูข้อมูลเพิ่มเติมที่ docs.strongswan.org

ตัวอย่าง:

ENM(Client) เชื่อมต่อกับ Proton VPN(Site)

> vim /home/oper/strongswan/ipsec.conf
conn test
left=%defaultroute
leftsourceip=%config
leftauth=eap-mschapv2
eap_identity=hKVSu61QiraPAXDY7nLWFrehB6PWTqWc
right=nl-free-03.protonvpn.net
rightsubnet=0.0.0.0/0
rightauth=pubkey
rightid=%nl-free-03.protonvpn.net
rightca=/home/oper/strongswan/ipsec.d/cacerts/protonvpn.der
keyexchange=ikev2
type=tunnel
auto=add

> vim /home/oper/strongswan/ipsec.secrets
hKVSu61QiraPAXDY7nLWFrehB6PWTqWc : EAP "5DmS79J3xrvPCi5OAV7xBM5QMytNrHip"

> cp protonvpn.der /home/oper/strongswan/ipsec.d/cacerts/

> sudo /etc/init.d/ipsec restart
> sudo ipsec up test