Questions tagged [pf]

pf (Packet Filter) is the TCP/IP packet filtering firewall subsystem on BSD systems.

Filter by
Sorted by
Tagged with
1 vote
1 answer
30 views

PF Firewall: Restrict Access to Other Ports Only for Clients with Active SSH Connections

I previously worked with a large organization that employed BSD for secure control over public access to their internal network. The approach involved users establishing authenticated SSH connections ...
ivzhh's user avatar
  • 161
1 vote
0 answers
60 views

Can I prevent access to a port to a specific process? (MacOS)

I have a handful of kafka brokers running locally on my laptop and I'd like to "cut the network" between 2 brokers to test a few things. Is it possible? I'm on a Mac. I see that iptables was ...
Thomas's user avatar
  • 893
0 votes
1 answer
797 views

FreeBSD: PF / pf.conf forwarding rule between interfaces

I would like to set up a simple forward rule (not port forward!) on FreeBSD 12.3 that filters based on received-on interface and going-out-on interface. IP networks should not be part of the rule as ...
gertvdijk's user avatar
  • 14k
4 votes
1 answer
502 views

Should changing firewall settings to block all interrupt ongoing ssh session

Suppose I am logged into a server via ssh. While in the session, I change the firewall config to block all traffic. When I tried this previously with FreeBSD and pf, the current connection was broken. ...
ahron's user avatar
  • 402
2 votes
1 answer
370 views

Isssues forwarding port / Nat on openbsd

I am unable to make port 80 available on the WAN and I am not sure why. My setup is just my home network acting as the wan and my ‘lab’ as the lan. Wan 192.168.0.0/24 and lan is 192.168.5.0/24. Router ...
asdfagain's user avatar
3 votes
0 answers
448 views

EdgeRouter Lite OpenBSD traffic routing limits [closed]

When routing traffic between (virtual) interfaces on Ubiquiti EdgeRouter Lite it is hitting some sort of limit. I'd like to get some help to determine what sort of limit is that and how it can be ...
Vlad's user avatar
  • 153
-1 votes
1 answer
1k views

Bridging Ethernet Interface on OpenBSD and Other Problems

I am currently setting up an OpenBSD firewall, router, and dns server. I've been following various guides online with the bulk of my configuration coming from the OpenBSD site and the pf configuration ...
user avatar
0 votes
1 answer
117 views

Filtering the ICMP packets on Solaris using IP-addresses from the table

I'm currently working with Packet Filter on Solaris machine, trying to create a rule that would filter out all ICMP packets of particular type and code. Here is my rule line: block out quick proto ...
zlatonick's user avatar
  • 149
0 votes
1 answer
626 views

macos monterey: PF load anchor syntax error

I am trying to make a NAT interface to connect tap0 to the internet for QEMU. So far I've made a bridge and connected tap0 to it: sudo ifconfig bridge1 create sudo ifconfig bridge1 addm tap0 sudo ...
user524818's user avatar
1 vote
2 answers
840 views

Openbsd wireguard to wireguard

I build a server (vps) which play the role of my gateway. My whole personal network is connected behind through wireguard. Every think works well, I follow more or less https://openbsdrouterguide.net ...
Airwan's user avatar
  • 81
0 votes
0 answers
518 views

Can't ping to OpenBSD router's globally routable IPv6 addresses

My router's IP address layout is as follows, anonymized to protect my network's privacy: 11.22.33.44 IPv4 WAN address 192.168.42.1 IPv4 LAN ...
robbie's user avatar
  • 113
1 vote
1 answer
51 views

PF states table give preoccupant results

I freshly install openBSD on a VPS. It is my first time. I did nothing but check the firewall setup, say pf. I ran pfctl -sa and it show all tcp IP0:22 <- IP1:rnd ESTABLISHED:ESTABLISHED all tcp ...
Airwan's user avatar
  • 81
0 votes
1 answer
68 views

pf - time of day filter

I'm using pf: https://www.openbsd.org/faq/pf/config.html, as a firewall on my router. I would like to implement a time of day filter in pf if that is possible so that I wouldn't need to script it ...
Walter's user avatar
  • 1,234
0 votes
1 answer
204 views

Modifying firewall rules with pfctl on NetBSD 4

I'm wanting to modify some firewall/NAT rules on a device (Apple Airport) running NetBSD 4.0. I'm not that familiar with BSD and pf, so want to check the right approach. I can change the pf.conf file (...
askvictor's user avatar
  • 101
0 votes
1 answer
1k views

pf: difference between 'modulate state' and 'keep state'

What's the difference between "modulate state" and "keep state" in the packet filter (pf) firewall? I'm using MacOS X Catalina 10.15.5. I have no idea how to check what version of ...
Michael Altfield's user avatar
1 vote
1 answer
370 views

Howto block all SSH connection attempts coming in from $extif

What is the PF notation to block on $ext_if all incoming SSH connection attempts? $ext_if is the interface pointing toward the internet. Somthing like: block quick in on $ext_if proto tcp to port 22 ...
Konrad Eisele's user avatar
1 vote
1 answer
734 views

Convert iptables rules to pf

I would like to ask you how to change following iptable rule: iptables -t nat PREROUTING --source x.x.x.x/24 -p tcp -m tcp --dport 443 -j DNAT --to x.x.x.x:8080 to pf. I am trying to capture
Arnold Young's user avatar
0 votes
1 answer
423 views

How to write a PF firewall rule that filters communications between processes on the same host?

How to write a PF firewall rule that filters communications between processes on the same host? From reading the man pages, I understand that packets must physically traverse the given interface for ...
Shuzheng's user avatar
  • 4,431
0 votes
1 answer
1k views

How does route-to work in the BSD pf firewall?

I've recently learned about the route-to functionality in the pf firewall, and I wonder how it works. Is it similar to the "policy-based routing" system in linux? How does route-to allow the ...
horseyguy's user avatar
  • 123
7 votes
1 answer
5k views

How to setup simple port forwarding on macOS with pf? "Rules must be in order: options, normalization, queueing, translation, filtering"

I am trying to pass traffic from Mac A port 5800 to Mac B on port 5900 using pf. This is the intended path of travel: Client to port 5800 → Router (Yes, port forwarding is setup here) → Mac with PF →...
user7886229's user avatar
2 votes
1 answer
705 views

blacklistd not blocking addresses

I've enabled the PF(4) firewall and blacklistd(8). Although IP addresses are being added to to blacklist, I can still see multiple failed attempts from a single IP address. Yet when I test it myself, ...
Tommiie's user avatar
  • 222
1 vote
1 answer
1k views

pf not stopping bruteforce attempts

I am setting up an SFTP server for me and my friends and I am trying to stop brute force attempts. I have read many articles on how to get pf to stop brute force attacks and am not having any luck. ...
babyPenguin's user avatar
0 votes
1 answer
197 views

macOS pf asymmetric routing through VLANs

I have a VLAN interface vlan0 that has a tag of 444 that has an IP of 172.16.16.16 The VLAN goes through the physical en0 interface. I have another interface mine0 that's local just to the computer....
Brad's user avatar
  • 153
1 vote
1 answer
259 views

How to set up a firewall for testing web applications in a virtual machine? [closed]

I'd like to locally test my web application's behavior under different firewall circumstances. We have an application that makes requests from the browser to different ports depending upon certain ...
Brian Dant's user avatar
  • 1,005
6 votes
1 answer
2k views

NAT outbound IPSEC packets using pf on FreeBSD 11 and StrongSwan x FortiGATE

I've been working for more than a week trying to get outbound packets nat'ed to fit a Security Association. This is my (example) scenario: LAN: 1.1.1.0/24 FreeBSD interface: xn0 (Amazon EC2 ...
Tiago Sampaio's user avatar
1 vote
1 answer
745 views

PF Rules to Block All But Accesses to VPN and LAN

The rule set to block all outgoing connections except for VPN access could be like this: block drop all pass on lo0 pass on utun0 pass out proto udp from any to xxx.yyy.zzz.ttt port pppp This works ...
Faxopita's user avatar
  • 179
0 votes
2 answers
626 views

bsd packet filter on Solaris, why ping not allowed?

I have two interfaces one is net0 with 192.168.0.30 ip the other is vnic0 with 10.2.0.1 ip This is my pf.conf,solaris is 11.4 ext_if="net0" int_if="vnic0" localnet="192.168.0.0/24" internalnet="10.2....
elbarna's user avatar
  • 12.7k
3 votes
2 answers
1k views

Is there a difference between re0 and wlan0?

I am new to FreeBSD and trying to set up a firewall with pf on my laptop. The machine is connected to the internet via wifi. On writing rule sets in /etc/pf.conf, some tutorials say to spell out the ...
henning's user avatar
  • 173
1 vote
1 answer
431 views

Graph gateway in/out traffic per client

tl;dr: Suppose I have a list of LAN clients (ip/macaddress/name); how would I best go about graphing the traffic going in/out of my OpenBSD 6.1 gateway? In my network everything going in/out of it ...
RobIII's user avatar
  • 217
1 vote
3 answers
687 views

Totally open FreeBSD router in VirtualBox

TL;DR - I'd like to set up a FreeBSD VM with one network card on my home LAN (192.168.1.0/24) and one on a private-internal-to-virtualbox network (10.9.9.0/24) and pass any and all traffic back and ...
ivanivan's user avatar
  • 4,965
3 votes
1 answer
1k views

Block all traffic out except one port with pfctl for macOS

As stated in the question, I need to block all traffic out to internet except for one port on MAC OS X 10.8.x. I just need the commands to run from a shell or edit any conf file?
richardwhitney's user avatar
1 vote
1 answer
526 views

Set $ext_if, $int_if, $localnet in PF

I am currently trying to get familiar with the basics of PF on FreeBSD. I am trying to setup the most basic example from the PF chapter in the FreeBSD handbook, the simple bruteforce rules: block ...
Jessica Nowak's user avatar
1 vote
0 answers
86 views

Can a block rule on PF add the src ip to a table

So on iptables I can make deny rules act as honey pots by adding ip's that hit the rules to a list that another rule is used to block all traffic from. I am trying to achieve the same thing on PF, ...
ChrisC's user avatar
  • 11
1 vote
0 answers
998 views

FreeBSD load balancer implementation

I have a program, which cannot be used in multiprocess\multithread mode, so it eat one CPU core, others cores are free, but RAM and network bandwidth usage near to 10% from max. The server for the ...
user1024's user avatar
0 votes
1 answer
925 views

pf: Forwarding all packets on port 80 from any interface to SOCKS proxy

I'm trying to forward any packets on port 80 from any interface to my SOCKS proxy (Server). I'm not sure if I have it set up correctly but I can't get it to forward the packets. I create a SOCKS ...
BugHunterUK's user avatar
2 votes
1 answer
2k views

Slow VPN speed strongswan on FreeBSD

I put up a VPN server with strongswan 5.4.0 on FreeBSD 11.0-RELEASE-p1 on a RaspberryPi 2. So far it works fine, but the speed is varying and also much slower than on Raspian which I used before. ...
user60589's user avatar
  • 121
3 votes
1 answer
2k views

Freebsd: pf firewall doesn't work on restart

I'm running FreeBSD 10.3 p4 and observed some strange behavior When restarting the machine pf starts due to /etc/rc.conf entry # JAILS cloned_interfaces="${cloned_interfaces} lo1" gateway_enable="...
Hensing's user avatar
  • 133
1 vote
0 answers
653 views

Is it possible? Three OpenBSD 6.0-current firewall bridges with only one OpenBSD Server?

Is it possible to configure several firewall bridges with one OpenBSD server which has 6 nic's. In this case 3 OpenBSD firewall bridges from each other completely independent? cat /etc/sysctl.conf ...
Vim's user avatar
  • 229
1 vote
2 answers
2k views

Applying NAT to traffic from GRE tunnel in OpenBSD PF

All I have a Cisco 877 router and a Linode VPS running OpenBSD 5.9 with a GRE tunnel running in between, which works great and I can ping from either side. I have set up a static route in the Cisco ...
Aaron Mason's user avatar
2 votes
1 answer
231 views

Cannot ping OUT of a Mac OS X server

I have just inherited a Mac OS X server that is using pf. The problem I am trying to solve is why I can't ping OUT of the server. I can ping to the machine no worries, but just get timeouts on pinging ...
user avatar
0 votes
2 answers
99 views

Messed up my mac firewall configuration (pf.conf) and ended up with 100% packet loss

I was trying to do wifi throttling for my new app development (new to this) and was trying to do it using iceFloor application. I'm not 100% sure if this is a problem, but i need to confirm if i ...
Prabhuram Natarajan's user avatar
2 votes
0 answers
255 views

pfctl - How to forward ip address in Mac OS Yosemite

How to forward all traffic to an external site 172.16.19.211:5001 to 127.0.0.1:5000 ? These docs have details about port forwarding but still ip forwarding is unclear. http://www.openbsd.org/faq/pf/...
Siva's user avatar
  • 173
5 votes
2 answers
2k views

Accessing ports on public IP from within a FreeBSD jail

In a FreeBSD 10 setup, I have a jail running the publicly accessible nginx web server and another jail for the Java backend server based on Jetty. Each jail has its own internal IP address 127.0.1.x ...
Martin Dirichs's user avatar
1 vote
2 answers
3k views

Block IP if it connects to port 22

How can I effectively (so do it fast when talking about firewall level and can do it with many-many IP's) block an IP address for a given time, ex.: a month if it tried to contact port 22 TCP in any ...
nyipeter's user avatar
0 votes
1 answer
1k views

Permanently start the OpenBSD pf Firewall on OS X

I use Mac OS X El Capitan 10.11.3 at the desktop OS. As everyone knows, is Apple's Mac OS X built on FreeBSD! I use normal only Debian/GNU/Linux on desktop and OpenBSD on Server and Firewall: So my ...
Vim's user avatar
  • 229
0 votes
1 answer
371 views

set up pfctl to forbid local applications accessing a specific hostname

I am an OSX user, and I want to ban some hostnames, with which some local applications may do nasty things. pfctl is the default firewall on OSX 10.11 El captain. So, how to block the specific ...
user3824053's user avatar
1 vote
1 answer
445 views

Configuring OpenBSD's PF as a router

I am running OpenBSD 4.4, I copied the template from https://markshroyer.com/guides/router/ch07.html for /etc/pf.conf and edited it to match my network. When I start it I get syntax errors on only ...
user52470's user avatar
  • 260
2 votes
1 answer
260 views

on FreeBSD, how do I open a port on WAN but not on LAN?

I have one FreeBSD machine that I use as a playbox/server/torrentbox. It's part of my LAN. Here is the semantics (altered from an example on the OpenBSD website): [ desktop ] [ laptop ] | ...
swapjim's user avatar
  • 35
1 vote
0 answers
1k views

Can not divert packet to pf when configure transparent squid 3.4.13 on OpenBSD 5.7

I am trying to build transparent proxy with squid on OpenBSD 5.7 with pf firewall. I compile squid from sources with options: $ squid -v Squid Cache: Version **3.4.13** configure options: --prefix=...
4Hero's user avatar
  • 11
5 votes
1 answer
7k views

Block outgoing connections to certain IP using PF

Can someone give me a hint on how to setup a basic deny rule whenever any TCP request is sent to a specific IP address? I am using the PF packet filter. Any help?
Joseph's user avatar
  • 211