详解Linux操作系统下防火墙设置方法

运维 系统运维
修改防火墙配置需要修改 /etc/sysconfig/iptables 这个文件,如果要开放哪个端口,在里面添加一条。

修改防火墙配置需要修改 /etc/sysconfig/iptables 这个文件,如果要开放哪个端口,在里面添加一条。

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1521 -j ACCEPT

就可以了,其中 1521 是要开放的端口号,然后重新启动linux的防火墙服务。

停止/启动防火墙服务的命令:

用root登录后,执行

service iptables stop --停止

service iptables start --启动

(service命令位于/sbin)

防火墙规则只有在 iptables 服务运行的时候才能被激活。要手工启动服务,使用以下命令:

/sbin rvice iptables restart

要确保它在系统引导时启动,使用以下命令:

/sbin/chkconfig --level 345 iptables on

ipchains 服务不能和 iptables 服务同时运行。要确定 ipchains 服务被禁用,执行以下命令:

/sbin/chkconfig --level 345 ipchains off

【编辑推荐】

  1. Linux防火墙规则示例
  2. linux中让NMAP命令跟防火墙躲猫猫
  3. 认识三大方便的开源Linux防火墙生成器
责任编辑:赵宁宁 来源: chinaitlab
相关推荐

2009-12-02 18:54:28

2009-12-08 17:37:49

Windows 7防火

2009-07-06 17:00:17

Ubuntu Linushorewall防火墙

2022-01-06 07:59:05

Linux 防火墙进程

2009-02-22 09:30:24

2011-03-17 16:00:57

2010-03-31 16:47:16

CentOS操作系统

2011-03-15 15:47:26

LinuxIptables防火墙

2012-07-10 10:39:48

Linux防火墙

2010-09-06 09:47:32

2011-03-15 15:47:15

Iptables防火墙

2018-02-06 10:53:53

2011-03-15 17:25:38

2010-09-13 17:45:37

2010-03-05 09:36:04

linux系统防火墙

2011-03-15 17:12:11

2011-03-15 16:35:27

2020-04-07 13:20:52

Linux防火墙ufw

2009-09-28 10:06:09

Linux防火墙Linux规则

2010-03-31 17:43:44

CentOS防火墙
点赞
收藏

51CTO技术栈公众号