当前位置:网站首页>ptables基本语法使用规则
ptables基本语法使用规则
2022-08-04 17:49:00 【小猴子_xiao】
防火墙工作原理(数据包流向)

Iptables基本语法
iptables [-t 表名] 命令选项 [链名] [规则号码] [条件匹配] [-j 目标动作]
小写 大写 大写 小写 大写
说明: 表名和链名:用于指定 iptables命令所操作的表和链; 命令选项:用于指定管理iptables规则的方式(比如:插入、增加、删除、查看等);
示例:
iptables -L
iptables -t filter -L
iptables -t nat -L
iptables -t raw -L
iptables -t mangle -L
iptables的启动和关闭以及保存
//临时停止|启动|查看状态|重新加载|重新启动 service iptables stop|start|status|reload|restart //开机是否自启动 chkconfig iptables off|on //永久保存规则 vim /etc/sysconfig/iptablesiptables常用的命令选项
常见的命令选项: -L 查看 -A 追加,放置最后一条 -I 插入,默认插入成第一条 -D 删除 -F 清空flush -P 设置默认策略policyiptables端口放行策略管理
在WEB服务端准备:你需要一台云服务器,这里我用的是3A网络,部署简单,适合小白。
在WEB服务端准备:# yum -y install httpd # echo "web page" > /var/www/html/index.html # systemctl enable httpd # systemctl start httpdWEB服务器防火墙规则配置
场景: 仅允许WEB客户端访问WEB服务端TCP 80端口,其它任何访问都拒绝# iptables -F # iptables -P INPUT DROP # iptables -A INPUT -p tcp --dport 80 -j ACCEPT根据协议匹配过滤
icmp协议中: icmp-type 8 类型为8代表请求回显,ping请求 icmp-type 0 类型为0代表回显应答,ping应答 需求1:只允许自己ping通别人,不允许别人ping通自己
边栏推荐
- R语言计算时间序列数据的逐次差分(successive differences):使用diff函数计算时间序列数据的逐次差分值
- init和destory方法
- R语言dplyr包group_by函数和summarise_at函数计算dataframe计算不同分组的计数个数和均值、使用%>%符号将多个函数串起来
- Understand Chisel language. 32. Chisel advanced hardware generator (1) - parameterization in Chisel
- Kotlin挂起函数原理是什么
- R语言ggplot2可视化:使用patchwork包的plot_layout函数将多个可视化图像组合起来,nrow参数指定行的个数、byrow参数指定按照列顺序排布图
- DSPE-PEG-DBCO,DBCO-PEG-DSPE,磷脂-聚乙二醇-二苯并环辛炔科研实验用
- 并发编程原理学习-reentrantlock源码分析
- OpenInfra Days China 2022 | SelectDB to share with you the Apache Doris in Internet advertising business practices
- CF86D Powerful array
猜你喜欢

codeforces每日5题(均1600)-第二十八天
C# Sqlite database construction and use skills

电源测试系统-ATE电源测试系统-ACDC电源模块测试系统NSAT-8000

SQL优化最全总结 - MySQL(2022最新版)

Investigation and Research Based on the Involution Behavior of College Students

Cholesterol-PEG-Maleimide,CLS-PEG-MAL,胆固醇-聚乙二醇-马来酰亚胺一种修饰性PEG

面试官:可以谈谈乐观锁和悲观锁吗

mysqlbinlog 超过500g自动删除,保留7个,求大深给个版本

启动项目(瑞吉外卖)

【技术积累】JS事件循环,Promise,async/await的运行顺序
随机推荐
树莓派通过API向企业微信推送图文
leetcode/有效的回文串,含有不需要判断回文的字符
关于大学生内卷的文献综述
44. 通配符匹配 ●●● & HJ71 字符串通配符 ●●
linux下Mysql的简单操作
Introduction of three temperature measurement methods for PT100 platinum thermal resistance
How to make JS code unbreakable
LeetCode Question of the Day - 1403. Minimum Subsequence in Non-Increasing Order
小程序笔记1
使用scikit-learn计算文本TF-IDF值
mmdetection/mmdetection3d多机多卡训练
localstorage本地存储的方法
怎么面试程序员的?傲慢与无礼,就数他牛逼
华为云计算HCIE之oceanstor仿真器的安装教程
Thrift IDL示例文件
第一章 对象和封装
About the two architectures of ETL (ETL architecture and ELT architecture)
pyhon爬虫之爬取图片(亲测可用)
OpenInfra Days China 2022 | SelectDB to share with you the Apache Doris in Internet advertising business practices
电源测试系统-ATE电源测试系统-ACDC电源模块测试系统NSAT-8000