Fedora18防火墙配置

查看手册

man firewalld

 

配置文件

默认配置文件位于/usr/lib/firewalld

系统配置文件位于/etc/firewalld

 

服务文件

参考xml服务文件新增服务或为已有服务增加端口

例如smtp服务开启tcp 25端口

[root@localhost ~]# cat /usr/lib/firewalld/services/smtp.xml 
<?xml version="1.0" encoding="utf-8"?>
<service>
  <short>Mail (SMTP)</short>
  <description>This option allows incoming SMTP mail delivery. If you need to allow remote hosts to connect directly to your machine to deliver mail, enable this option. You do not need to enable this if you collect your mail from your ISP's server by POP3 or IMAP, or if you use a tool such as fetchmail. Note that an improperly configured SMTP server can allow remote machines to use your server to send spam.</description>
  <port protocol="tcp" port="25"/>
</service>
[root@localhost ~]#


 

为区增加服务

临时增加

firewall-cmd --zone=public --add-service=smtp

永久增加

firewall-cmd --permanent --zone=public --add-service=smtp

 

查看

查看区上的服务

firewall-cmd --list-all-zones

 

查看防火墙开放的端口

iptables -L -n

 

可以看到在IN_ZONE_public_allow区中允许了tcp 25端口

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值