N
N
nihi1ist2020-05-26 09:18:35
Computer networks
nihi1ist, 2020-05-26 09:18:35

How to specify multiple interfaces for an iptables rule?

Tell me, is it possible to specify several interfaces for a rule? For example:
iptables -A FORWARD -i eth0,eth1 -o eth2 -j ACCEPT
And if possible, how to separate? Through space, comma, slash?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir, 2020-05-26
@nihi1ist

You can do this and not list anything
iptables -A FORWARD -i eth0 -o eth2 -j ACCEPT
iptables -A FORWARD -i eth1 -o eth2 -j ACCEPT

D
Dmitry, 2020-05-26
@TrueBers

iptables -A FORWARD -i eth+ -o eth2 -j ACCEPT
"Plus" will mean that the interface name starts with eth , and then anything goes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question