LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 12-06-2001, 09:01 AM   #1
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
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.
 
Old 12-06-2001, 01:00 PM   #2
phil1076
Member
 
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, 06:41 PM   #3
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Original Poster
Rep: Reputation: 56
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 06:49 PM.
 
  


Reply


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 01:28 PM
iptables and dynamic rules.... ProtoformX Linux - Security 10 10-20-2004 07:50 AM
Firewall Rules studpenguin Linux - Security 0 07-01-2004 03:14 AM
help with firewall rules please deuce868 Linux - Security 1 06-14-2004 03:18 PM
Viruses, ipchains, dynamic rules, rules with regular expressions marktaff Linux - Security 2 09-25-2001 04:01 AM


All times are GMT -5. The time now is 03:57 AM.

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