当前位置:网站首页>iptables 配置
iptables 配置
2022-07-28 17:02:00 【水月清辉】
1)保存防火墙配置文件信息
cp /etc/sysconfig/iptables{,.bak}
2)清除配置规则
iptables -F <- 清空iptables所有规则信息(清除filter)
iptables -X <- 清空iptables自定义链配置(清除filter)
iptables -Z <- 清空iptables计数器信息(清除filter)
3)别把自己踢出到门外
iptables -A INPUT -s 10.0.0.1 -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -s 10.0.0.0/24 -p tcp --dport 22 -j ACCEPT
4)配置防火墙filter上各个链的默认规则
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
-P ---指定相应链的默认规则策略,是允许还是阻止
5)允许iptables服务端ping自己的网卡地址
iptables -A INPUT -i lo -j ACCEPT --- 让自己可以ping自己
6)指定外网可以访问的端口信息
iptables -A INPUT -p tcp -m multiport --dport 80,443 -j ACCEPT
7)企业中内网之间不要配置防火墙策略
iptables -A INPUT -s 172.16.1.0/24 -j ACCEPT --- 允许架构内部服务进行访问
8)企业之间有合作关系的,不要将友商的网络禁止(主要经常改动)
iptables -A INPUT -s 10.0.1.0/24 -j ACCEPT --- 允许一些合作企业的外网服务器进行访问
iptables -A INPUT -s 10.0.2.0/24 -j ACCEPT
9)如果防火墙上配置了FTP服务,需要配置网络状态机制
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT --- 允许web服务与ftp服务器建立连接
10)实现iptables策略配置永久保存
①. 利用防火墙启动脚本命令参数,实现永久保存
/etc/init.d/iptables save
②. 利用防火墙配置信息保存命令,实现永久保存
iptables-save >/etc/sysconfig/iptables
边栏推荐
- Fluent: exception handling
- Through private channels such as official account, direct the live broadcast of video number
- busybox最新版(busybox apk)
- Seven steps, in-depth interpretation of data meaning
- solidity的require报错
- Connect other computers to local MySQL
- 2023年网络安全预算规划的五个关键考虑因素
- 苹果供应商JDI拟以6.75亿美元出售白山LCD工厂和设备
- Andorid: Zxing.Demo二维码扫描框架遇到的坑
- Sales of video related products increased by 88%
猜你喜欢

Openmv (VI) -- STM32 realizes object recognition and handwritten digit recognition

ADS仿真 之 交流仿真和S参数仿真示例

“云战略”将成为企业数字化转型的重要支柱

How to sharpen a knife simply by yourself

低码在数字化转型中扮演什么角色?

Five key considerations for network security budget planning in 2023

The difference between probability function p (x), probability distribution function f (x) and probability density function f (x)

Digital filter (III) -- Design of analog filter

天线的原理、分类及要求

ADS仿真 之 直流仿真示例
随机推荐
cout.write的学习
Mysql5.7 compressed package installation tutorial
[reading notes] for paper: summary of three papers in r-cnn series
Import the database backup of MySQL 8 into MySQL 5
The diversion between video number and official account is convenient and considerable
syntax error: non-declaration statement outside function bodygo 和 syntax error: unexpected {, expect
Digital filter (VI) -- design FIR filter
物联网在智慧城市的应用
Busybox latest version (busybox APK)
Introduction to USB type-C PD fast charging
天线的原理、分类及要求
视频号从每周2-3场到每天3场
业绩增长强劲!闻泰科技上半年净利17亿元,同比暴增767.19%!
C WPF normal project suddenly prompts that the name "initializecomponent" does not exist in the current context
Digital filter (IV) -- converting analog filter into digital filter
沪硅产业上半年营收8.5亿元,同比增长30.53%!各类产品认证正在加速
Compilation principle learning notes 2 (Introduction to syntax analysis)
Video number from 2-3 games per week to 3 games per day
$(document).Width() in WebView is a value
ADS仿真 之 直流仿真示例