LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   How do I assign a variable to hold multiple interfaces in Slackware firewall script? (https://www.linuxquestions.org/questions/slackware-14/how-do-i-assign-a-variable-to-hold-multiple-interfaces-in-slackware-firewall-script-4175413703/)

Gerard Lally 06-27-2012 01:22 PM

How do I assign a variable to hold multiple interfaces in Slackware firewall script?
 
I am using the firewall script generator provided by Eric. I have multiple virtual interfaces assigned to virtual machines. The script generates the following variable for a single internal interface:

LOCAL_IFACE="10.40.50.1"

How do I add other interfaces to this variable so that I don't have to add multiple rules each time I add another interface?

I tried space-separated values but it didn't work:

LOCAL_IFACE="10.40.51.1 10.40.52.1 10.40.53.1"

silendo 06-27-2012 05:20 PM

Hello gezley, assign at LOCAL_IFACE var your interface (For example: eth0) don't assign ip address.
I think so work :)

Gerard Lally 06-28-2012 01:35 PM

Quote:

Originally Posted by silendo (Post 4713639)
Hello gezley, assign at LOCAL_IFACE var your interface (For example: eth0) don't assign ip address.

Thank you silendo.

The trouble is I have other variables which need to be filled in as well:

LOCAL_IFACE # the interface name, eg., eth0
LOCAL_IP # the IP address, eg., 10.40.40.1/32
LOCAL_NET # the network, eg., 10.40.40.0/24
LOCAL_BCAST # the broadcast address, eg., 10.40.40.255

All of these are used in the script generated by Alien Bob's firewall script generator.


All times are GMT -5. The time now is 05:30 AM.