การตั้งค่า mikrotik เบื้องต้น

การตั้งค่า MikroTik เบื้องต้น

เหมาะสำหรับผู้เริ่มต้นใช้งาน RouterOS เพื่อตั้งค่าเร้าเตอร์ MikroTik ให้ทำงานพื้นฐาน เช่น เชื่อมต่ออินเทอร์เน็ต, ตั้งค่า LAN, DHCP, Firewall และ NAT


ขั้นตอนการตั้งค่าเบื้องต้น

1. เข้าสู่ระบบ (Login)

  • เชื่อมต่อสาย Ethernet จากคอมพิวเตอร์ไปยัง Port ether1 (หรือใช้ WiFi หากรองรับ)
  • เปิดเบราว์เซอร์แล้วเข้า http://192.168.88.1 (หรือใช้ Winbox ดาวน์โหลดได้จาก MikroTik)
  • เข้าสู่ระบบด้วย:
  Username: admin
  Password: (เว้นว่างไว้หรือลอง admin)

2. ตั้งค่าภาษาภายใน (LAN)

2.1 กำหนด IP ให้ LAN

/ip address add address=192.168.1.1/24 interface=bridge-lan
  • 192.168.1.1 = IP เร้าเตอร์
  • /24 = Subnet Mask (255.255.255.0)
  • bridge-lan = Interface ของ LAN (สร้าง Bridge ก่อนถ้าจำเป็น)

2.2 สร้าง Bridge (ถ้ามีหลายพอร์ต LAN)

/interface bridge add name=bridge-lan
/interface bridge port add bridge=bridge-lan interface=ether2
/interface bridge port add bridge=bridge-lan interface=ether3

3. ตั้งค่า DHCP Server

3.1 สร้าง IP Pool (ช่วง IP ที่จะแจก)

/ip pool add name=dhcp-pool ranges=192.168.1.100-192.168.1.200

3.2 ตั้งค่า DHCP Server

/ip dhcp-server add interface=bridge-lan address-pool=dhcp-pool disabled=no
/ip dhcp-server network add address=192.168.1.0/24 gateway=192.168.1.1 dns-server=8.8.8.8,1.1.1.1
  • gateway=192.168.1.1 = กำหนดให้ใช้เร้าเตอร์เป็น Gateway
  • dns-server=8.8.8.8,1.1.1.1 = DNS ของ Google และ Cloudflare

4. ตั้งค่าอินเทอร์เน็ต (WAN)

4.1 สำหรับ PPPoE (เช่น TOT, AIS Fiber)

/interface pppoe-client add name=pppoe-out interface=ether1 user=username password=password
  • ether1 = พอร์ต WAN (ต่อสายจาก ONT/โมเด็ม)
  • user และ password = ข้อมูลที่ ISP ให้มา

4.2 สำหรับ Dynamic IP (เช่น True, 3BB)

/ip dhcp-client add interface=ether1

5. ตั้งค่า NAT (ให้เครือข่าย LAN ออกอินเทอร์เน็ตได้)

/ip firewall nat add chain=srcnat out-interface=pppoe-out action=masquerade
  • pppoe-out = ชื่ออินเทอร์เฟส WAN (เปลี่ยนเป็น ether1 ถ้าใช้ Dynamic IP)

6. ตั้งค่า Firewall พื้นฐาน

6.1 ป้องกันการเข้าถึงจากภายนอก

/ip firewall filter add chain=input action=drop connection-state=invalid
/ip firewall filter add chain=input action=accept connection-state=established,related
/ip firewall filter add chain=input action=drop in-interface=pppoe-out protocol=tcp dst-port=23,8291
  • ปิด Telnet (port 23) และ Winbox (port 8291) จากอินเทอร์เน็ต

6.2 อนุญาต Traffic จาก LAN ไปอินเทอร์เน็ต

/ip firewall filter add chain=forward action=accept src-address=192.168.1.0/24

7. บันทึกการตั้งค่า

/system backup save name=initial-config

เพื่อป้องกันการสูญเสียการตั้งค่าเมื่อรีเซ็ต


สรุปการตั้งค่าเบื้องต้น

การตั้งค่าคำสั่ง/ค่าที่ใช้
IP LAN192.168.1.1/24
DHCP Pool192.168.1.100-192.168.1.200
PPPoE/interface pppoe-client add...
NATchain=srcnat action=masquerade
Firewalldrop invalid, allow LAN traffic

⚠️ หมายเหตุ:

  • เปลี่ยน ether1, pppoe-out, และช่วง IP ตามการใช้งานจริง
  • ใช้ Winbox หรือ WebFig สำหรับการตั้งค่าที่ง่ายกว่า

หากต้องการตั้งค่าเพิ่มเติม เช่น Load Balancing, VPN, QoS สามารถสอบถามได้! 🚀ที่ 099-3988-999

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *