CentOS 配置防火墙操作实例
2015-09-02 00:06
791 查看
http://my.oschina.net/u/593517/blog/297941
CentOS 配置防火墙操作实例(启、停、开、闭端口): 注:防火墙的基本操作命令:查询防火墙状态:[root@localhost ~]# service iptables status<回车>停止防火墙:[root@localhost ~]# service iptables stop <回车>启动防火墙:[root@localhost ~]# service iptables start <回车>重启防火墙:[root@localhost ~]# service iptables restart <回车>永久关闭防火墙:[root@localhost ~]# chkconfig iptables off<回车>永久关闭后启用:[root@localhost ~]# chkconfig iptables on<回车>
用编辑器打开/etc/sysconfig/iptables ,添加端口
CentOS 配置防火墙操作实例(启、停、开、闭端口): 注:防火墙的基本操作命令:查询防火墙状态:[root@localhost ~]# service iptables status<回车>停止防火墙:[root@localhost ~]# service iptables stop <回车>启动防火墙:[root@localhost ~]# service iptables start <回车>重启防火墙:[root@localhost ~]# service iptables restart <回车>永久关闭防火墙:[root@localhost ~]# chkconfig iptables off<回车>永久关闭后启用:[root@localhost ~]# chkconfig iptables on<回车>
用编辑器打开/etc/sysconfig/iptables ,添加端口
# sample configuration for iptables service # you can edit this manually or use system-config-firewall # please do not ask us to add additional ports/services to this default configuration *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -p icmp -j ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT -A INPUT -j REJECT --reject-with icmp-host-prohibited -A FORWARD -j REJECT --reject-with icmp-host-prohibited COMMIT
相关文章推荐
- Centos6 安装zabbix-agent
- linux常用命令
- virtualbox centos6.7 主机和虚拟机之间通信设置
- Linux命令备忘实例(2)——变量
- Linux系统环境编程(系统当前时间)
- linux 多线程API
- CentOS修改默认运行级别
- virtualbox centos6.7 虚拟机访问外网设置
- Linux 命令初探
- 在 Linux 中使用日志来排错
- Linux 软件及作用
- linux安装配置SVN并设置钩子
- linux 关闭电脑触摸板命令
- Linux 常用系统命令
- 通过登入IP记录Linux所有用户登录所操作的日志
- Linux启动/停止/重启Mysql数据库的方法
- Linux下常用的配置IP及route的命令汇编
- linux运维实战练习-2015年9月01日课程作业(练习)安排
- Linux Opendir and readdir will not update along with directory changing
- Linux下常用的配置IP及route的命令汇编