Quantcast
Channel: Question and Answer » pf
Viewing all articles
Browse latest Browse all 9

How do I add more IP addresses to my pf rules?

$
0
0

I wish to have all internet traffic to go through my VPN; when my VPN is disconnected, all internet traffic can not go out of my workstation/desktop (not server).

I wish to switch VPN servers of one location to another at random.

Here’s my pf rules. I would appreciate if you can help me add more IP addresses of remote VPN servers:

wan="em0"
vpn="tun0"
block all
block in log all
set block-policy drop
set skip on lo
antispoof for $wan inet
block in from urpf-failed to any
block inet proto icmp icmp-type echoreq
block out inet6 all
block in inet6 all
pass out on $wan proto tcp from any to a.b.c.d port 443 modulate state
pass out on $vpn proto tcp from any to any port 80 modulate state
pass out on $vpn proto tcp from any to any port 443 modulate state
pass out on $vpn proto udp from any to any port 53 modulate state

where a.b.c.d is the IP address of the remote VPN server.


Viewing all articles
Browse latest Browse all 9

Trending Articles