Solved

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

Posted on 2008-10-08
4
444 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
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
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…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

733 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