变更8006 端口成为 443
-
## 将443端口的数据转发到8006端口
-
iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-ports 8006
-
-
#禁止访问8006端口
-
iptables -A INPUT -i ! lo -p tcp --dport 8006 -j DROP
-
-
#保存配置
-
iptables-save > /etc/iptables.up.rules
-
echo -e '#!/bin/sh\n/sbin/iptables-restore < /etc/iptables.up.rules' > /etc/network/if-pre-up.d/iptables
-
chmod +x /etc/network/if-pre-up.d/iptables
文章评论