[MikroTik] Mở Cổng (NAT Port) Kết Hợp HairpinNAT Phiên Bản Đơn Giản



Có thể chơi được với mọi hình thức IP động tĩnh các kiểu (còn CG-NAT thì chịu nhé :v)
Các bác có đổi tên đường pppoe-out1 thành đường nào khác thì tự sửa lại code phía dưới nhé ~~~
Script:

:delay 5
/ip firewall address-list remove [/ip firewall address-list find list=WAN]

### cần HairpinNAT nhiều wan thì copy 4 dòng dưới rồi thay chỗ pppoe-out là được ^^
:local wanip [/ip address get [/ip address find where interface=pppoe-out1] address];
:set wanip [:pick $wanip 0 ([:len $wanip]-3) ];
:put $wanip;
/ip firewall address-list add list=WAN address=$wanip

==============================
#mikrotik #routeros #natport #hairpinnat

[ad_2]

source

Exit mobile version