centos6.4 防火墙管理
来源:互联网 发布:js 鼠标的位置 编辑:程序博客网 时间:2024/06/04 01:30
配置Cento6.4 iptables防火墙。
1. 查看防火墙状态
或:说明:下面也可以用此方法操作。
2.关闭 /开启/重启防火墙
4.永久关闭防火墙
然后重启系统使其生效:
5.设置开启80端口访问
>先查看防火墙状态:
[root@localhost nginx]# service iptables status
Table: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
1 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
2 ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0
3 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
4 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
5 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
Chain FORWARD (policy ACCEPT)
num target prot opt source destination
1 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
Chain OUTPUT (policy ACCEPT)
num target prot opt source destination
>设置80端口(或者手动修改/etc/sysconfig/iptables)
[root@localhost ~]# /sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT
You have new mail in /var/spool/mail/root
>保存设置
[root@localhost ~]# /etc/rc.d/init.d/iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables: [ OK ]
>再查看防火墙状态
[root@localhost ~]# service iptables status
Table: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
1 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
2 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
3 ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0
4 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
5 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
6 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
Chain FORWARD (policy ACCEPT)
num target prot opt source destination
1 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
Chain OUTPUT (policy ACCEPT)
num target prot opt source destination
>设置80端口--修改/etc/sysconfig/iptables配置文件
- centos6.4 防火墙管理
- CentOS6.4防火墙iptables
- centos6.4关闭防火墙步骤
- Centos6.4下iptables防火墙配置
- centos6.5 防火墙关闭
- CentOS6.6配置防火墙
- centos6.6开启防火墙
- Centos6 防火墙设置
- Centos6.8 防火墙设置
- centos6防火墙相关命令
- linux centOS6.5防火墙
- CentOS6/7防火墙设置
- CentOS6.8 操作防火墙
- centos6.5防火墙配置
- centos6关闭防火墙
- CentOS6.x 和 CentOS6.x 设置防火墙
- Centos6.5 关闭防火墙 iptables
- Centos6.5关闭防火墙命令
- Qt4.8.5移植到嵌入式linux(arm平台)
- BootStrap模态框垂直居中方法
- canvas
- 「Git」合并多个 Commit
- HDU 5790 Prefix(字典树、主席树)
- centos6.4 防火墙管理
- 权限管理命令umask
- 服务端接口测试小结
- c
- 测试面试
- mybatis
- 送机器学习电子书——(TensorFlow)RNN入门
- impdp/expdp导入导出库
- 通过网络安装centos7 及 mount 命令参数