Iptables快速入门(掌握四表五链必备文章)

Iptables是用户空间的iptables+内核空间的neifilter,默认情况下,iptables实现的是二~四层防火墙规则,7层需要重编内核。

在这里插入图片描述

Firewalls是centos7中默认的,学习iptables前可以先关闭

安装iptables的系统基本配置

网络环境:关闭NetworkManager服务

systemctl stop Network Manager
systemctl disable firewalld
firewall-cmd --state   #检查

安全配置:防火墙、selinux

防火墙:
systemctl stop firewalld
systemctl disable firewalld
firewalld-cmd --state  #检查
selinux:
sed -i 's#=enforcing#=disabled#' /etc/selinux/config
grep --color=auto '^SELINUX' /etc/selinux/config  #检查

基础软件安装:安装依赖软件、安装软件源、安装系统基础软件

依赖软件
yum install -y wget yum-plugin-priorities
软件源
wget -O /etc/yum.repos.d/CentOS-Base-ali.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
或者
wget -O /etc/yum.repos.d/CentOS-163.repo https://mirrors.163.com/.help/CentOS7-Base-163.repo
系统基础软件
yum groupinstall "Compatibility Libraries" "Console Internet Tools" "Development Tools" "Security Tools" "System Administration Tools" -y
yum install -y vim lrzsz telnet curl net-tools tree bash-completion
时间同步
yum install ntpdate -y
echo '*/10 * * * * /usr/sbin/ntpdate time1.aliyun.com &>/dev/null' >> /var/spool/cron/root

源优先级配置

cat /etc/yum/pluginconf.d/priorities.conf
注意:保证 [main] 配置下的 enabled = 1
然后编辑相应的repo文件,在想用的配置文件下增加priority=1

禁止内核升级

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值