HƯỚNG DẪN CẤU HÌNH HAIRPIN NAT TRÊN EDGEROUTER

Hướng dẫn cấu hình Hairpin NAT trên các dòng EdgeRouter. Bài viết hướng dẫn chi tiết cách tháo tác cấu hình của Wifi.fpt.net sẽ bạn dễ dàng cấu hình Hairpin NAT trên các dòng EdgeRouter.

huong-dan-cau-hinh-hairpin-nat-tren-edgerouter

Hairpin nat là phân giải được tên miền trong lớp mạng local. Sau đây mình xin hướng dẫn các bạn cách nat port 8291

Bước 1: Xác định địa chỉ IP WAN và lớp mạng local (Router đã cấu hình ra được internet)

  • IP WAN: 118.69.222.246
  • Lớp mạng local: 192.168.1.1/24

1. Firewall / NAT > NAT > +Add Destination NAT Rule

  • Description: hairpin8291
  • Inbound Interface: eth0
  • Translation Address: 192.168.1.200
  • Translation Port: 8291
  • Protocol: TCP
  • Destination Address: 118.69.222.246
  • Destination Port: 8291

huong-dan-cau-hinh-hairpin-nat-tren-edgerouter

2. Firewall/NAT > Firewall Policies > WAN_IN > Actions > Edit Ruleset > Add New Rule

  • Description: hairpin
  • Action: Accept
  • Protocol: TCP
  • Destination > Port: 8291
  • Destination > Address: 192.168.1.200

huong-dan-cau-hinh-hairpin-nat-tren-edgerouter

                                                              huong-dan-cau-hinh-hairpin-nat-tren-edgerouter

3. Firewall / NAT > NAT > +Add Source NAT Rule

  • Description: hairpin
  • Outbound Interface: eth1
  • Translation: Use Masquerade
  • Protocol: TCP
  • Source Address: 192.168.1.1/24
  • Destination Address: 192.168.1.200
  • Destination Port: 8291

huong-dan-cau-hinh-hairpin-nat-tren-edgerouter

4. Firewall / NAT > NAT > +Add Destination NAT Rule

  • Description: hairpin8291
  • Inbound Interface: eth1
  • Translation Address: 192.168.1.200
  • Translation Port: 8291
  • Protocol: TCP
  • Destination Address: 118.69.222.246
  • Destination Port: 8291

huong-dan-cau-hinh-hairpin-nat-tren-edgerouter

Bước 2: Ở đây bạn có thể dùng CLI trong Gui hoặc dùng chương trình Putty (dùng lệnh tạo các rule)

  • Mình hướng dẫn các bạn dùng Putty
  • Cấu hình trong mode configure
  • Copy Lệnh và thay đổi thông số IP theo thông số port 8291 và IP destination

                                                       huong-dan-cau-hinh-hairpin-nat-tren-edgerouter

                                                       huong-dan-cau-hinh-hairpin-nat-tren-edgerouter

  • set firewall name WAN_IN rule 30 action accept
  • set firewall name WAN_IN rule 30 description hairpin
  • set firewall name WAN_IN rule 30 destination port 8291
  • set firewall name WAN_IN rule 30 destination address 192.168.1.200
  • set firewall name WAN_IN rule 30 log disable
  • set firewall name WAN_IN rule 30 protocol tcp

 

  • set service nat rule 1 description hairpin8291
  • set service nat rule 1 destination address 118.69.222.246
  • set service nat rule 1 destination port 8291
  • set service nat rule 1 inbound-interface eth2
  • set service nat rule 1 inside-address address 192.168.1.200
  • set service nat rule 1 inside-address port 8291
  • set service nat rule 1 log disable
  • set service nat rule 1 protocol tcp
  • set service nat rule 1 type destination

 

  • set service nat rule 2 description hairpin8291
  • set service nat rule 2 destination address 118.69.222.246
  • set service nat rule 2 destination port 8291
  • set service nat rule 2 inbound-interface eth2
  • set service nat rule 2 inside-address address 192.168.1.200
  • set service nat rule 2 inside-address port 8291
  • set service nat rule 2 log disable
  • set service nat rule 2 protocol tcp
  • set service nat rule 2 type destination

 

  • set service nat rule 5000 description hairpin
  • set service nat rule 5000 destination address 118.69.222.246
  • set service nat rule 5000 destination port 8291
  • set service nat rule 5000 log disable
  • set service nat rule 5000 outbound-interface eth2
  • set service nat rule 5000 protocol tcp
  • set service nat rule 5000 source address 192.168.1.1/24
  • set service nat rule 5000 type masquerade

–> Cuối Lệnh: commit ; save

Bước 3: Dùng PC cắm port 2 để test dùng PING.UI để test port 8291 OPEN

huong-dan-cau-hinh-hairpin-nat-tren-edgerouter

 

VIDEO HƯỚNG DẪN CẤU HÌNH HAIRPIN NAT TRÊN EDGEROUTER

 

Mời mọi người tham gia Group Cộng đồng UniFi để được hỗ trợ, chia sẻ những kinh nghiệm thực tế về các vấn đề kỹ thuật của UniFi, cũng như các vấn đề khác của thiết bị WiFi, Networks! 

Tham khảo thêm bài viết hướng cấu hình load balance 2 WAN hoặc nhiều WAN treen EdgeRouter

Video Hướng Dẫn Cấu Hình UniFi xem tại đây.

—————————–

????????ô???????? ???????????? ????????ê???? ????ệ

Liên Hệ Mua Hàng: 0933.769.199

Fanpage UniFi-Ubiquiti Viet Nam xem tại đây.

Hỗ Trợ Kỹ Thuật: 028-7300-2222 Số máy lẻ: 89777 – 8654

Lưu ý : Thời gian hỗ trợ trong giờ hành chính (Thứ Hai – Thứ Sáu ; 08:30 – 17:30)