随笔分类 -  iptables

摘要:1、ipset和dnsmasq结合 Dnsmasq+ipset+iptables基于域名的流量管理 https://blog.csdn.net/lvshaorong/article/details/52981169 Dnsmasq / ipset / iptables 基于域名的智能路由 https 阅读全文
posted @ 2020-12-11 10:20 helloweifa 阅读(1861) 评论(0) 推荐(0)
摘要:NETMAP This target allows you to statically map a whole network of addresses onto another network of addresses. It can only be used from rules in the 阅读全文
posted @ 2020-12-11 10:01 helloweifa 阅读(1733) 评论(0) 推荐(0)
摘要:1、--map-set ?? 2、-j netmap iptables -t nat -A PREROUTING -i eth0 -d 10.0.0.0/24 -j NETMAP --to 192.168.1.0.24 iptables -t nat -A POSTROUTING -o eth1 - 阅读全文
posted @ 2020-12-11 09:07 helloweifa 阅读(435) 评论(0) 推荐(0)
摘要:https://www.cnblogs.com/silvermagic/p/7666093.html 阅读全文
posted @ 2020-12-10 18:10 helloweifa 阅读(227) 评论(0) 推荐(0)
摘要:参考: iptables raw表 https://blog.csdn.net/lic95/article/details/50670617 iptables 添加raw提高服务器性能之路 https://www.cnblogs.com/shiyiwen/p/7597892.html 阅读全文
posted @ 2020-12-10 18:08 helloweifa 阅读(292) 评论(0) 推荐(0)
摘要:1、下面是利用iptables以及ipset 手动制造敲门来访问ssh 22端口,实际上下面的iptables按顺序来敲tcp 1989、2016、1864端口三条规则可以改为1条icmp规则来简化访问。 ipset create knock hash:ip timeout 10 ipset cre 阅读全文
posted @ 2020-12-05 22:23 helloweifa 阅读(1749) 评论(0) 推荐(0)
摘要:1、不借助额外的软件 将443端口的数据转发到8006端口 iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-ports 8006 可选————禁止访问8006端口 iptables -A INPUT -i ! lo 阅读全文
posted @ 2020-12-02 15:19 helloweifa 阅读(475) 评论(0) 推荐(0)
摘要:1、 指定-m multiport就可以使用--dports、--sports 参考:http://www.zsythink.net/archives/1544 标准的--dport与--sport使用方式: 80、80:90、:80、90: 扩展的--dports与--sports使用方式:以上组 阅读全文
posted @ 2020-12-02 11:41 helloweifa 阅读(3383) 评论(0) 推荐(0)
摘要:1、 经常看到如下2个语句(当然也可以同时设定 ip和端口): iptables -t filter -I -m state --state ESTABLISHED,RELATED -j ACCEPT iptabels -t filter -A -m state --state INVALID -j 阅读全文
posted @ 2020-12-02 10:45 helloweifa 阅读(2565) 评论(0) 推荐(0)
摘要:1、下载地址 https://inai.de/projects/xtables-addons/ 说明 https://inai.de/files/xtables-addons/ 下载 github上 https://github.com/nawawi/xtables-addons/tree/mast 阅读全文
posted @ 2020-11-26 16:34 helloweifa 阅读(749) 评论(0) 推荐(0)
摘要:背景介绍: 服务器(pc1)单网卡 配置为100.72.139.1 默认路由配置为100.72.139.254(此为h3c防火墙(简称R1),100.72.139.254是其内网地址,166.111.110.217是其外网地址)。现在100.72.139.0/24网内存在 100.72.139.2的 阅读全文
posted @ 2020-11-26 11:42 helloweifa 阅读(550) 评论(0) 推荐(0)
摘要:参考: nftables 简明教程 https://www.hi-linux.com/posts/29206.html pve5默认没有安装nftables 阅读全文
posted @ 2020-11-26 00:03 helloweifa 阅读(205) 评论(0) 推荐(0)
摘要:-A INPUT -p tcp -m multiport --dports 40022 -j f2b-sshd -A INPUT -s 219.223.176.0/20 -p tcp -m tcp --dport 40022 -j DROP -A INPUT -s 219.223.168.0/21 阅读全文
posted @ 2020-11-25 10:14 helloweifa 阅读(682) 评论(0) 推荐(0)
摘要:recent模块参考: 1)Iptables 之recent模块小结 https://www.cnblogs.com/kevingrace/p/10008487.html 非常重要,重点参考 2)Iptables模块recent应用 https://www.haiyun.me/archives/ip 阅读全文
posted @ 2020-11-17 17:20 helloweifa 阅读(442) 评论(0) 推荐(0)
摘要:第1种情况: 将本机的端口转发到本机的另外不同的端口上 使用场景:比如将本机的18006端口转发 到 本机的8006端口上,8006端口(真正服务所在的监听端口)只允许本地localhost访问,而18006端口可以在外部访问时,这种方式很管用。 iptables -t nat -I PREROUT 阅读全文
posted @ 2020-10-20 11:53 helloweifa 阅读(2382) 评论(0) 推荐(1)
摘要:1、-i 输入接口 -i 代表输入接口,-i 指定了要处理来自哪个接口的数据包,这些包即将进入 INPUT,FORWARD,PREROUTE 链。 比如 -i eth0 指定了要处理通过 eth0 进入的数据包,如果不指定 -i 参数那么将处理所有接口的数据包。 ! -i eth0 处理所有经由 e 阅读全文
posted @ 2020-09-28 23:20 helloweifa 阅读(508) 评论(0) 推荐(0)