当您有多个自定义链并且起诉-goto和-jump之间的混合时,我正在试图找出iptable的行为是什么
示例:
INPUT
iptables -A INPUT -i eth1 -j CUSTOM-A
CUSTOM-A
few commands here...
iptables -A CUSTOM-A -i eth1 -p tcp -dport 80 -g CUSTOM-B
few optional commands here...
iptables -A CUSTOM-A -i eth1 -s 0/0 -g CUSTOM-B
CUSTOM-B
iptables -A CUSTOM-B few commands here... -j CUSTOM-C
iptables -A CUSTOM-B few commands here... -j CUSTOM-C
iptables -A CUSTOM-B few commands here... -j CUSTOM-C
iptables -A CUSTOM-B -i eth1 -s 0/0 -j RETURN
CUSTOM-C
iptables -A CUSTOM-C -s 0/0 -j LOG
iptables -A CUSTOM-C -s 0/0 -j DROP在上述情况下,在定制-A tcp/80上匹配的数据包将转到定制-B,如果它们到达表的底部,它们将返回。返回是否返回到输入的数据包,因为数据包是通过一个goto到达的吗?
发布于 2015-03-14 20:47:36
返回是否返回到输入的数据包,因为数据包是通过一个goto到达的吗?
这是手册上说的..。
-g,--goto这指定处理应该在用户指定的链中继续进行。与-跳转选项不同,返回不会继续在这个链中进行处理,而是在通过--跳转调用我们的链中。
因此,我希望返回到输入链。
发布于 2023-02-26 17:50:03
跳转:与任何跳转规则相匹配的包,将进入跳转所指示的链。如果数据包稍后被返回,它将由在跳转时发送它的链进行处理,在下面的规则中称为跳转。
Goto:匹配任何goto规则的数据包,将进入由goto指示的链。如果数据包稍后被返回,它将不会被发送到goto上的链处理,而是由在最后一次跳转时发送它的链处理,在下面的规则中称为跳转。
https://serverfault.com/questions/675559
复制相似问题