- 浏览: 257919 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (263)
- mysql (5)
- boost (6)
- 工具 (10)
- IT生活 (7)
- 多线程 (3)
- Ruby (15)
- php (2)
- MongoDB (39)
- 移动互联网 (2)
- 测试 (8)
- c++ (28)
- 书 (1)
- 网站 (3)
- 网络编程 (14)
- 开源软件 (1)
- 分布式计算 (1)
- 得得得 (1)
- php,wordpress (1)
- error (5)
- 编译 (2)
- 学习 (1)
- 杀毒软件 (1)
- dd (0)
- linux (21)
- 数据库 (1)
- STL (1)
- c++/c (5)
- 软件设计 (1)
- 操作系统 (4)
- 库 (2)
- win32 (1)
- s (0)
- openssl (1)
- perl (2)
- debug (1)
- windows (4)
- python (12)
- windows 防火墙 (1)
- vs (1)
- vim (2)
- vc (1)
- 浏览器插件的危害 (1)
- curl (0)
- 判断手机号码合法性的库 (0)
- 地址备注 (0)
- 安装 File::Slurp (1)
- cenos (2)
- shell (1)
- linunx (1)
- internet (1)
- software (1)
- widows (1)
- linux io (1)
- nginx (2)
- 算法 (2)
- google (1)
- protobuf (2)
- tengine (1)
- tools (1)
- lua (2)
- liunx (1)
- vcard (1)
- lua-iconv (1)
- 网络 (2)
- teat (0)
- ldconfig linux (0)
- awk (0)
- grep (0)
- windws (2)
- linux 命令 (1)
- tcp dump (1)
- vmware (1)
- question2answer (2)
- mongdb (1)
- 正则 (1)
- OCR (2)
- Windows Server (1)
最新评论
CentOS 7.0,启用iptables防火墙
- 博客分类:
- linux
http://www.open-open.com/lib/view/open1411818940031.html
CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙。
1、关闭firewall:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
2、安装iptables防火墙
yum install iptables-services #安装
vi /etc/sysconfig/iptables #编辑防火墙配置文件
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
:wq! #保存退出
systemctl restart iptables.service #最后重启防火墙使配置生效
systemctl enable iptables.service #设置防火墙开机启动
花下眠工作室: http://huaxiamian.cc
CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙。
1、关闭firewall:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
2、安装iptables防火墙
yum install iptables-services #安装
vi /etc/sysconfig/iptables #编辑防火墙配置文件
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
:wq! #保存退出
systemctl restart iptables.service #最后重启防火墙使配置生效
systemctl enable iptables.service #设置防火墙开机启动
花下眠工作室: http://huaxiamian.cc
发表评论
-
Linux的IO性能监控工具iostat详解
2016-09-20 14:37 284$iostat -d -k 1 10 #查看TPS和吞吐量信息 ... -
Linux下查看系统版本号信息的方法
2016-06-14 15:24 345一、查看Linux内核版本命令(两种方法): 1、cat / ... -
linux 发布系统
2016-04-13 11:03 0/etc/webshell.cfg /etc/rsyncd.c ... -
bash
2016-01-14 11:29 0#/bin/bash for d in {20151001. ... -
当安装了libiconv环境下安装lua-iconv 会出现报错 /usr/local/lib/lua/5.1/iconv.so: undefined symb
2016-01-13 11:47 1942转自: http://bbs.iresty.com/topic ... -
ldconfig
2016-01-13 11:15 0sudo ldconfig ldconfig -p | gre ... -
libconv--unicode -> utf-8
2016-01-02 17:30 449http://savannah.gnu.org/project ... -
配置iptables
2016-06-02 15:18 329cd /etc/sysconfig 备份iptables文件: ... -
linux下的unicode utf
2015-12-22 19:22 0example: http://www.gnu.org/sof ... -
用gcc编译生成动态链接库*.so文件的方法
2015-12-18 14:28 810原文地址:/etc/ld.so.confh ... -
Putty远程登录VMware虚拟机Linux(Ubuntu)
2015-12-10 10:23 890http://www.linuxidc.com/Linux/2 ... -
解决vmware安装centos,网络不通的问题
2015-11-23 11:03 551在终端输入: nmcli dev status查看网卡状态 我 ... -
linux 抓包
2015-11-10 18:52 310tcpdump port 80 -x -s 0 -nn -i ... -
linux socket
2015-08-06 17:58 450epoll_create, epoll_ctl和epoll_w ... -
取消私钥密码
2015-07-20 19:11 585http://www.au92.com/archives/re ... -
liinux操作记录
2015-07-20 15:49 01. 远程连接ssh 私钥保存地址.ssh 2. 查看文件ls ... -
secureCRT 下载上传文件
2015-07-16 18:06 423sz用法: 下载一个文件 sz filename ... -
iptables
2015-07-13 16:17 476转自: http://www.cnblogs.com/jemb ... -
awk
2015-02-11 09:53 584http://coolshell.cn/articles/90 ... -
linux 命令
2015-01-14 10:49 418① 查看物理CPU的个数 #cat /proc/cpuinfo ...
相关推荐
CentOS 7.0启用iptables防火墙.docx
CentOS 7.0关闭默认防火墙启用iptables防火墙.docx
主要介绍了CentOS 7.0关闭默认防火墙启用iptables防火墙的设置方法,需要的朋友可以参考下
最新CentOS 7.0防火墙操作命令和以前稍微有些区别和变化
centos7.0安装mysql centos7.0安装mysql centos7.0安装mysql
CentOS 7.0防火墙Firewalld和服务相关配置。CentOS 7.0防火墙Firewalld和服务相关配置CentOS 7.0防火墙Firewalld和服务相关配置CentOS 7.0防火墙Firewalld和服务相关配置CentOS 7.0防火墙Firewalld和服务相关配置
CentOS下配置iptables防火墙.pdf
文档中是CentOS7.0的镜像包,下载后可以直接在虚拟机中点击打开新的虚拟机即可
CentOS操作系统下配置iptables防火墙.docx
CentOS Firewall 防火墙 CentOS Firewall 防火墙 CentOS Firewall 防火墙
阿里云Centos配置iptables防火墙.docx
centos7.0版本镜像,兼容性更高,6.0以下镜像不支持docker安装
最新的Centos7.0安装图文详解,个人感觉很不错 如有别的疑问可自行百度
CentOS7.0使用手册+中文PDF版.rar 永久免费
Centos离线安装iptables
CentOS配置iptables防火墙.docx
详细描述了如何在Centos中安装docker,包括防火墙的下载,开启防火墙,docker端口的开放,以及开机自启动的设置
Centos7.0系统下配置Hadoop集群(以3节点为例)超详细过程
安装centos7.0U盘启动工具,非常 简单方便的一款工具,适合所有centos7.0系统安装