To reduce the length of the firewall script, I'm trying to create one iptables rule that applies to multiple interfaces.
For example ...
Instead of writing this rule three times with each interface, what is the most efficient way to iterate through the different interfaces ?
If the above rule is used, doesn't that mean the rule is run for each value in the Ext_INTF variable ?
Is there an ipset equivalent method of efficiently referencing multiple variable values ?
For example ...
Code:
Ext_INTF="eth0 usb0 tun0 tun1"
iptables -A FORWARD -i $Ext_INTF -j DROP
Instead of writing this rule three times with each interface, what is the most efficient way to iterate through the different interfaces ?
If the above rule is used, doesn't that mean the rule is run for each value in the Ext_INTF variable ?
Is there an ipset equivalent method of efficiently referencing multiple variable values ?
Last edited: