Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 452
  • Last Modified:

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

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
Ruf
Asked:
Ruf
  • 3
1 Solution
 
TeRReFCommented:
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
 
TeRReFCommented:
Oh, of course these lines go into your pf.conf file...
0
 
RufAuthor Commented:
Perfect... That's exactly what I wanted TeRReF.... Thanks a lot...
0
 
TeRReFCommented:
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!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now