我已经在VPS上安装了一个新的CentOS 7 minnimal安装的firewalld(奇怪的是,从我一直在寻找firewalld应该已经安装系统)。
我试图打开一些端口,但是当运行一个像这样的命令
firewall-cmd --zone=public --add-port=80/tcp --permanent
我得到以下错误消息: Error: INVALID_ZONE: public 。
当用firewall-cmd --get-zones查看可用区域firewall-cmd --get-zones我什么也得不到。
应该如何configuration?
这听起来像一个非常奇怪的VPS设置和问题,但是如果你不介意写一点XML,你可以很容易地build立自己的区域。
我的公共区域是:
<?xml version="1.0" encoding="utf-8"?> <zone target="DROP"> <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"/> <port protocol="tcp" port="443"/> </zone>
它是默认的public.xml的轻微修改版本,它丢弃而不是拒绝数据包,并且允许HTTPS和SSH。
你会把这个(我认为)/etc/firewalld/zones/public.xml。