Может ли iptables различать интерфейсы моста?

Вы не можете сделать именно так, как описано.

Однако многие дистрибутивы используют образ intramfs для очень ранней загрузки. Если бы вы изменили сценарии инициализации в этом образе, вы могли бы запустить свою задачу до того, как файловые системы будут смонтированы. Вам нужно быть очень умным, чтобы закодировать способ, чтобы это произошло только один раз. Все это можно было бы сделать удаленно с достаточным доступом. Поскольку CentOS и Debian используют разные системы для своих initramfs, вам нужно будет сделать это дважды. Было бы очень хорошей идеей устранить ошибки в одной системе, к которой у вас есть локальный доступ, прежде чем развертывать ее в системах, которых у вас нет. Такие вещи должны работать идеально.

1
08.11.2020, 21:33
1 ответ

Да, сphysdev:

physdev

This module matches on the bridge port input and output devices enslaved to a bridge device. This module is a part of the infrastructure that enables a transparent bridging IP firewall and is only useful for kernel versions above version 2.5.44.

[!] --physdev-in name
Name of a bridge port via which a packet is received (only for packets entering the INPUT, FORWARD and PREROUTING chains). If the interface name ends in a "+", then any interface which begins with this name will match. If the packet didn't arrive through a bridge device, this packet won't match this option, unless '!' is used.
[!] --physdev-out name
Name of a bridge port via which a packet is going to be sent (for bridged packets entering the FORWARD and POSTROUTING chains). If the interface name ends in a "+", then any interface which begins with this name will match.
[!] --physdev-is-in
Matches if the packet has entered through a bridge interface.
[!] --physdev-is-out
Matches if the packet will leave through a bridge interface.
[!] --physdev-is-bridged
Matches if the packet is being bridged and therefore is not being routed. This is only useful in the FORWARD and POSTROUTING chains.
3
18.03.2021, 22:51

Теги

Похожие вопросы