[EP.34] How to install Let’s Encrypt Certificate on MikroTik RouterOS 7

Krittin Srithong
techblogclub
Published in
2 min readMay 18, 2022

--

ใน MikroTik RouterOS Version 7 ได้ออก Feature ใหม่ ซึ่งท่านสามารถขอ SSL Certificate ฟรีจาก Let’s Encrypt ได้แล้ว เพื่อนำ Certificate มาใส่กับ Services “www-ssl (https)” บน RouterOS เพื่อให้ระบบมีความน่าเชื่อถือ และปลอดภัยมากยิ่งขึ้น

ข้อกำหนด

  • ต้องเป็น RouterOS 7 ขึ้นไป (ใน LAB นี้ผมจะใช้ RouterOS 7.2.3 Stable)
  • ท่านต้องได้รับ Public IP จาก ผู้ให้บริการ เท่านั้น เพราะ มันต้องมีการติดต่อสื่อสารกับเซิร์ฟเวอร์ของ Let’s Encrypt และเซิร์ฟเวอร์ Let’s Encrypt จะต้องมอบใบรับรองให้กับเราเตอร์ของเรา

1. เปิดใช้งาน Dynamic DNS ของ RouterOS

  • ไปที่ IP > Cloud
  • ติ๊ก DDNS Enabled

2. เปิด Terminal บน RouterOS

  • พิมคำสั่งตามด้านล่างเพื่อคุยกับทาง Let’s Encrypt โดยตรงเพื่อขอ Cert มาติดตั้งบน RouterOS

“certificate/enable-ssl-certificate dns-name=xxx.sn.mynetname.net”

  • ตรง dns-name=ให้แก้เป็น Dynamic DNS ของ Router
  • เมื่อพิมพ์คำสั่งแล้วให้รอจนกว่าจะขึ้นสถานะ “progess: [success] ssl certificate updated” เป็นอันเสร็จสิ้นในการร้องขอ Certificate

3. ตรวจสอบ Certificate ที่ได้ร้องขอกับทาง Let’s Encrypt

  • System > Certificates
  • โดย อายุของ Certificate คือ 90 วัน นับจากหลังวันที่ออก โดยสามารถตรวจสอบวันที่เหลือได้ที่ช่อง Days Valid หาก Certificate หมดอายุแล้ว ท่านสามารถ Renew ใหม่ได้

4. เปิดใช้งาน Service “www-ssl (https)” และ ปิดใช้งาน Service “www (http)”

  • ปิดใช้งาน Service “www (http)” ให้เรียบร้อย
  • กดเปิดใช้งาน Service “www-ssl (https)” และ ตรวจสอบให้แน่ใจ ว่าใน Service “www-ssl” ตรง Certificate ว่าได้เลือกเป็น Certificate ของ Let’s Encrypt แล้วหรือยัง
  • กด Apply และ OK

5. ทดสอบการใช้งาน

  • เปิด Web browser
  • พิมในช่อง URL “https://xxx.sn.mynetname.net”
  • ตรวจสอบ Certificate ด้วยเครื่องมือ SSL Checker https://www.sslshopper.com/ssl-checker.html
  • ช่อง Server Hostname กรอก Dynamic DNS ของ Router แล้วกด Check SSL
  • หากทุกอย่างถูกต้องจะขึ้นเครื่องหมายถูก ดังภาพ

--

--

Krittin Srithong
techblogclub

Hi, I’m Krittin. I am studying in bachelor of Computer Enginnering. I have MikroTik Certificates as following MTCNA, MTCSE, MTCUME. (medium.com/techblogclub)