Solved

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

Posted on 2008-10-08
4
436 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
  • 3
4 Comments
 
LVL 29

Accepted Solution

by:
TeRReF earned 125 total points
Comment Utility
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
Comment Utility
Oh, of course these lines go into your pf.conf file...
0
 
LVL 1

Author Comment

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

Expert Comment

by:TeRReF
Comment Utility
You're welcome :)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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.

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now