The system have multiple interfaces: eth0, eth1, eth2, ... br0, br1, br2, ...etc
.
The following rule will allow packets from "br0
" to "br0
":
iptables -A FORWARD -i br0 -o br0 -j ACCEPT
I don't want to allow "br0
" to "non-br0
", "br1
" to "non-br1
", ...etc.. I want to match the "--out-interface
" to the "--in-interface
" without writing the actual interface name (br0, br1...
) in the iptables rules.
iptables -A FORWARD -i <???> -o <???> -j ACCEPT
Here is the expected result:
iptables -A FORWARD -i br0 -o br0 -j ACCEPT
...
iptables -A FORWARD -i br1 -o br1 -j ACCEPT
...
iptables -A FORWARD -i br2 -o br2 -j ACCEPT
...
iptables -A FORWARD -i brn -o brn -j ACCEPT
...
How to use one rule
to implement the same expected result
without specifying the actual interface name "br0
" in the <???>
?
iptables -A FORWARD -i <???> -o <???> -j ACCEPT