环境:内网、centos7+、firewall
步骤:
cd /etc/firewalld/zones
vi public.xml
<?xml version="1.0" encoding="utf-8"> <zone> <short>Public</short> <description>For use in public areas. You do not trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted.</description> <service name="ssh" /> <service name-"dhcpv6-client" /> <!-- 新增行 --> <port protocol="tcp" port="2222" /> </zone>
systemctl start firewalld