LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Dynamic Firewall Rules (https://www.linuxquestions.org/questions/linux-general-1/dynamic-firewall-rules-9715/)

DavidPhillips 12-06-2001 09:01 AM

Dynamic Firewall Rules
 
I am trying to build some dynamic firewall rules.


What I have so far is a script I can run from in the firewall script ( ./getip ) that looks like this...

cat /etc/rc.d/getip
ifconfig ppp0 | grep inet | cut -d "P" -f1 | cut -d ":" -f2-


I can run it like this in the firewall script..

./pppgetip > ip

and come up with this...

[root@beta rc.d]# cat ip
34.156.45.178

Now all I need to figure out is how to assign the contents of the file ..../ip to a variable in my script to use for making rules.

or just do the whole ifconfig thing and apply it to a variable that I can use to make rules.


Or is there maybe something I don't know about here that would make this whole thing unnecessary.

phil1076 12-06-2001 01:00 PM

Someone correct me if I'm wrong, but you don't need to do this. I'm fairly new to linux (3 months or so) but I think when assigning rules using iptables, you don't assign rules to the ip, but rather the interface...I use Monmotha's firewall and it works great..

DavidPhillips 12-06-2001 06:41 PM

I want to do some special rules that use ip addresses.

I have so many rules that it takes 5 minutes to show them using -L



All times are GMT -5. The time now is 12:20 PM.