Centos7.2 启用iptables
一、防火墙iptables 简洁介绍
iptables 和 firewalld 都是工作在用户空间、用来定义规则的工具,本身不是防火墙,他们定义的规则,可以让内核空间当中的netfilter读取,并且实现防火墙工作。
netfilter是操作系统核心层内部的一个数据包处理模块,它具有如下功能:
1.网络地址转换 nat
2.数据包内容修改 mangle
3.数据包过滤的防火墙功能 filter
centos7.2 默认使用firewalld ;iptables默认无法被systemctl控制,需要按照iptables-services、iptables-devel这两个依赖包
二、将firewalld切换到 iptables
1. 停止并禁用 firewalld
sudo systemctl stop firewald.service && sudo systemctl disable firewald.service
2.安装iptables-services、iptables-devel
sudo yum install iptables-services iptables-devel
3.启用并启动iptables
sudo systemctl enable iptables.service && sudo systemctl start iptables.service
4.查看iptables配置文件
sudo vim /etc/sysconfig/iptables
5.开启转发功能
(1) 在 /etc/sysctl.conf 中添加 net.ipv4.ip_forward=1
(2) sudo sysctl -p 同步内核参数
(3) 继续查看内核参数 less /proc/sys/net/ipv4/ip_forward 如果为1 则配置生效
Centos7.2 启用iptables的更多相关文章
- Centos7防火墙关闭和启用iptables操作
https://yq.aliyun.com/ziliao/33590前序 还是docker惹得最近做的系统都是上的centos7的系统带来的一系列的新环境的适应 补记下:在使用oracle vmbox ...
- centos7 启用iptables
在centos 7下启用iptables systemctl stop firewalld.service systemctl disable firewalld.service yum instal ...
- vsftp被动模式启用iptables访问设置
vsftpd服务搭建好之后,如果是使用主动模式访问.那么启用iptables只需添加以下规则即可: -A RH-Firewall-1-INPUT -m state --state NEW -m tcp ...
- 玩转Linux之- CentOS 7.0,启用iptables防火墙
原文 玩转Linux之- CentOS 7.0,启用iptables防火墙 CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall:sy ...
- centos7上安装iptables
centos7上安装iptables的步骤 注意:CentOS7默认的防火墙不是iptables,而是firewalle. 安装iptable iptable-service #安装iptables ...
- Centos7 防火墙关闭和启用iptables防火墙
操作系统环境:CentOS Linux release 7.0.1406(Core) 64位CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙步骤. 1.关闭f ...
- CentOS7关闭默认防火墙启用iptables防火墙
CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙步骤. 1.关闭firewall: systemctl stop firewalld.service #停止f ...
- centos7关闭默认firewall,启用iptables
CentOS 7.0默认使用"firewall"防火墙 一:关闭firewall1.直接关闭防火墙systemctl stop firewalld.service 2.禁止fire ...
- centos7下部署iptables环境纪录(关闭默认的firewalle)(转)
下面介绍centos7关闭firewall安装iptables,并且开启80端口.3306端口的操作记录:[root@localhost ~]# cat /etc/redhat-release Cen ...
随机推荐
- STL—vector
前面介绍了STL对象的构造与析构以及内存的配置与释放,那具体的容器是怎么应用STL的空间配置器的呢?这篇先介绍STL的容器vector. vector的数据成员 vector只有4个数据成员:3个迭代 ...
- Nodejs cluster模块深入探究
由表及里 HTTP服务器用于响应来自客户端的请求,当客户端请求数逐渐增大时服务端的处理机制有多种,如tomcat的多线程.nginx的事件循环等.而对于node而言,由于其也采用事件循环和异步I/O机 ...
- poj 1200 crasy search
https://vjudge.net/problem/POJ-1200 题意: 给出一个字符串,给出子串的长度n和给出的字符串中不同字符的个数nc,统计这个字符串一共有多少不同的长度为n的子串. 思路 ...
- javascript数组(1) ——sort的工作原理及其他数组排序方法
一说到数组排序,最直观的想法就是用sort啊! 请问不用使用sort方法还可以使用什么方法进行数组排序? 比如 : 快速排序法.合并排序法.冒泡排序法.选择排序法.插入排序法.布尔排序法.交互排序. ...
- 【性能】web提升性能的小总结
1. 异步加载js文件,判断文件是否已加载,不重复加载 if (typeof echarts === 'undefined') { console.log('异步加载echarts'); $.getS ...
- if else 和switch case以及continue,break的区别
1,if 经常用于做区间判断 或者 固定值: break和continue的使用 break:用来结束循环结构或者switch case continue:结束此次循环进入 ...
- myeclipse项目部署到idea常见问题
由于myeclipse是付费产品,经过几次破解不成功后,遂弃之,转投IntelliJ IDEA门下.但这就出现一个问题了,以前用的eclipse.myeclipse以及spring tools sui ...
- ES6字符串扩展
前面的话 字符串是编程中重要的数据类型,只有熟练掌握字符串操作才能更高效地开发程序.JS字符串的特性总是落后于其它语言,例如,直到 ES5 中字符串才获得了 trim() 方法.而 ES6 则继续添加 ...
- 30. leetcode 121. Best Time to Buy and Sell Stock
121. Best Time to Buy and Sell Stock Say you have an array for which the ith element is the price of ...
- 24. leetcode 409. Longest Palindrome
409. Longest Palindrome Given a string which consists of lowercase or uppercase letters, find the le ...