当前位置:网站首页>iptables 使用脚本来管理规则
iptables 使用脚本来管理规则
2022-08-11 05:33:00 【macob】
使用变量来存储和改变ip地址等参数
例:ipt.sh
#!/bin/bash
IPT=/sbin/iptables
SERVER=10.1.1.1,10.1.1.2
ADMIN=192.168.1.1
iptables -t filter -F
iptables -X
iptables -Z
$IPT -A INPUT -p tcp -m state --state INVALID -j DROP
$IPT -A INPUT -p tcp -d $SERVER --dport 80 -j ACCEPT
$IPT -A INPUT -p tcp -s $ADMIN -d $SERVER --dport 22 -j ACCEPT
vi /etc/rc.d/rc.local
添加
/root/ipt.sh
chmod u+x /etc/rc.d/rc.local
边栏推荐
- 无胁科技-TVD每日漏洞情报-2022-8-7
- cloudreve使用体验
- Apache Fink 文件上传漏洞复现及利用
- uboot设置默认的bootdelay
- 解决win10安装portal v13/v15要求反复重启问题。
- CLUSTER DAY02 (Keepalived Hot Standby, Keepalived+LVS, HAProxy Server)
- AUTOMATION DAY07( Ansible Vault 、 普通用户使用ansible)
- FusionCompute8.0.0 实验(2)虚拟机创建
- (2) Software Testing Theory (*Key Use Case Method Writing)
- 逐步揭示makop.mkp勒索病毒中毒防范恢复解密
猜你喜欢
随机推荐
detectron2,手把手教你训练mask_rcnn
window10吐槽
View the library ldd that the executable depends on
SECURITY DAY03(一键部署zabbix)
MoreFileRename batch file renaming tool
SSH服务详解
无胁科技-TVD每日漏洞情报-2022-7-18
Threatless Technology-TVD Daily Vulnerability Intelligence-2022-7-27
mysql数据库安装教程(超级超级详细)
ETCD cluster fault emergency recovery - to recover from the snapshot
Solve the problem that port 8080 is occupied
SECURITY DAY06 ( iptables firewall, filter table control, extended matching, typical application of nat table)
无胁科技-TVD每日漏洞情报-2022-7-31
buildroot嵌入式文件系统中vi显示行号
Record a Makefile just written
无胁科技-TVD每日漏洞情报-2022-7-26
SECURITY DAY01(监控概述 、 Zabbix基础 、 Zabbix监控服 )
Threatless Technology-TVD Daily Vulnerability Intelligence-2022-7-28
vi display line number in buildroot embedded file system
ansible批量安装zabbix-agent