iptables规则设置

1. 查询规则编号

iptables --line -nvL INPUT

2. 删除指定规则

# 下面的命令可以查看到编号
iptables --line -nvL INPUT

# 指定编号,删除规则
iptables -D INPUT 1

3. 设置精准IP/Port策略

# 禁止某个端口的对外
iptables -I INPUT -p tcp --dport 8075(目的端口) -j DROP

# 指定源IP访问指定端口
iptables -I INPUT -s 127.0.0.1(源IP) -p tcp --dport 8075(目的端口) -j ACCEPT

4. 参考链接

https://www.cnblogs.com/sky-cheng/p/11596678.html?ivk_sa=1024320u

posted @ 2023-02-21 11:55  爱吃蚊子爱子钰  阅读(175)  评论(0编辑  收藏  举报