?
Solved

How do we make PF load a List or Table content from a File...?

Posted on 2008-10-08
4
Medium Priority
?
446 Views
Last Modified: 2013-11-22
Hi Team
I have a FreeBSD 6.1 acting as a Gateway and Firewall using PF. My requirement is that I have a long list of end user IPs that should be allowed access to Internet and specific ports. I have currently done it using Table which I have defined it like below

Table <allowlist> { IP1 IP2 IP3 IP4 IP5 }

I then call the Table in the rules. However, I have close to about 60 IPs to define in the list and feel it would be great if I could define a file like /etc/allowlist and add all the IPs one each on a line and call the File.
Do you think that's possible...?
0
Comment
Question by:Ruf
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 29

Accepted Solution

by:
TeRReF earned 500 total points
ID: 22667118
Yes, that is possible, something like:

           table <allowed> persist file "/etc/ips"
           allow on fxp0 from <allowed> to any

Where you have to change /etc/ips to your file and the rule to your specific situation
0
 
LVL 29

Expert Comment

by:TeRReF
ID: 22667121
Oh, of course these lines go into your pf.conf file...
0
 
LVL 1

Author Comment

by:Ruf
ID: 22697506
Perfect... That's exactly what I wanted TeRReF.... Thanks a lot...
0
 
LVL 29

Expert Comment

by:TeRReF
ID: 22697811
You're welcome :)
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses
Course of the Month15 days, left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question