어떤 필요에 따른 SSH, HTTP, HTTPS 프로토콜의 WAN 접속을 허용한다.
기본 포트를 그대로 써서는 안 된다.
예로 든 2222, 4443, 8080 포트도 추정할 수 있으므로 안 된다.
기억하기 애매한 5자리 숫자를 꼭 쓴다.
49150 이하의 숫자이다.
vi change-ports-allow-wan
#!/bin/sh
uci delete uhttpd.main.listen_http
uci delete uhttpd.main.listen_https
uci add_list uhttpd.main.listen_http='0.0.0.0:8080'
uci add_list uhttpd.main.listen_http='[::]:8080'
uci add_list uhttpd.main.listen_https='0.0.0.0:4443'
uci add_list uhttpd.main.listen_https='[::]:4443'
uci commit uhttpd
/etc/init.d/uhttpd restart
uci set dropbear.global.Port='2222'
uci commit dropbear
/etc/init.d/dropbear restart
echo "
config rule
option name 'Allow WAN Access'
option src 'wan'
option dest_port '2222 4443 8080'
option proto 'tcp'
option target 'ACCEPT'
" >> /etc/config/firewall
/etc/init.d/firewall restart
exit
chmod a+x change-ports-allow-wan
./change-ports-allow-wan
'설치' 카테고리의 다른 글
| Exchange Server 2003 복구 (0) | 2026.08.27 |
|---|---|
| 부팅불 Windows Server 2003 윈도우 재설치 (0) | 2026.08.27 |
| pfSense에 FreeDNS의 DDNS 설정 (0) | 2026.08.26 |
| pfSense에 Mellanox ConnectX-4 랜카드 드라이버 설치 (0) | 2026.08.26 |
| OpenWRT/Gargoyle Router Web-GUI, SSH 접속 보안 (0) | 2026.08.25 |