NAT port mirotik – Mạng local không truy cập được địa chỉ public
NAT PORT MIKROTIK
Bước 1: Cấu hình DST-NAT (chuyển tiếp cổng)
bash
Copy Edit
/ip firewall nat add chain=dstnat dst-address=203.0.113.5 protocol=tcp dst-port=8080 action=dst-nat to-addresses=192.168.88.10 to-ports=8080 comment=”Port Forward Web”
Dòng này đảm bảo khi từ Internet (hoặc LAN) truy cập 203.0.113.5:8080, gói tin sẽ được chuyển tiếp về 192.168.88.10:8080.
✅ Bước 2: Thêm Hairpin NAT (cho phép client nội bộ truy cập IP public)
bash
Copy Edit
/ip firewall nat add chain=srcnat src-address=192.168.88.0/24 dst-address=192.168.88.10 protocol=tcp dst-port=8080 out-interface=bridge-local action=masquerade comment=”Hairpin NAT”
- src-address: Mạng LAN nội bộ.
- dst-address: IP nội bộ của server.
- out-interface: Interface gắn với mạng LAN (có thể là bridge, ether2, v.v.).
- action=masquerade: Bắt buộc để NAT source thành router, giúp server phản hồi đúng.
Lưu ý: Thay bridge-local bằng đúng interface LAN trên thiết bị MikroTik của bạn (/interface print để kiểm tra).
Bình luận