安装iptables apt-get install iptables 开放端口 sudo iptables -I INPUT -p tcp --dport 1883 -j ACCEPT 保存 sudo iptables-save