Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 12-06-2001, 10:01 AM   #1
LQ Guru
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
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

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.
Old 12-06-2001, 02:00 PM   #2
Registered: Oct 2001
Location: Grand Cayman
Distribution: RH 9.0
Posts: 96

Rep: Reputation: 16
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..
Old 12-06-2001, 07:41 PM   #3
LQ Guru
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Original Poster
Rep: Reputation: 58
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

Last edited by DavidPhillips; 12-06-2001 at 07:49 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
dynamic iptables rules slzckboy Linux - Networking 4 10-18-2005 02:28 PM
iptables and dynamic rules.... ProtoformX Linux - Security 10 10-20-2004 08:50 AM
Firewall Rules studpenguin Linux - Security 0 07-01-2004 04:14 AM
help with firewall rules please deuce868 Linux - Security 1 06-14-2004 04:18 PM
Viruses, ipchains, dynamic rules, rules with regular expressions marktaff Linux - Security 2 09-25-2001 05:01 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:00 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration