To effectively bypass censorship using Mullvad VPN through pfSense, the initial step involves configuring pfSense as a VPN client. This requires an active Mullvad subscription and downloading the appropriate OpenVPN configuration file from Mullvad's website. Select a server geographically located in a region where censorship is less restrictive.
Within the pfSense web interface, navigate to VPN > OpenVPN > Clients and add a new client instance. Import the downloaded Mullvad OpenVPN configuration file. Adjust the following parameters:
Description: MullvadVPN (or a descriptive name)
Server host or address: Populated from the imported config. Verify it matches the selected Mullvad server.
Server port: Usually 1194 or 443, depending on the config.
Username: mullvad
Password: mullvad
Encryption Algorithm: Negotiable, but AES-256-CBC is a solid choice. Ensure it matches the server's capabilities.
Digest Algorithm: SHA512 is recommended.
Tunnel Settings: Enable "Don't pull routes" to prevent Mullvad from overriding your existing routing table. This is crucial for selective routing.
Advanced Configuration: Add block-outside-dns to prevent DNS leaks. Also, fast-io can improve performance on some systems.
Save the configuration. pfSense should now establish a VPN connection to Mullvad. Verify the connection status under Status > OpenVPN.
Once the Mullvad VPN connection is established, configure routing rules to direct specific traffic through the VPN tunnel. This allows bypassing censorship for selected devices or applications while maintaining normal internet access for others.
Create an alias under Firewall > Aliases to group the IP addresses of devices that should use the Mullvad VPN. For example, create an alias named CensorshipBypass and add the IPs of the devices needing the VPN.
Next, create a firewall rule under Firewall > Rules, on your LAN interface. The rule should be placed above your default allow rule. Configure it as follows:
Action: Pass
Interface: LAN
Protocol: Any
Source: CensorshipBypass (the alias created earlier)
Destination: Any
Gateway: The Mullvad VPN gateway (identified by its interface name, e.g., OPENVPN_MULLVADVPN).
This rule routes all traffic originating from the devices in the CensorshipBypass alias through the Mullvad VPN.
For DNS, prevent DNS leaks by forcing clients using the VPN to use Mullvad's DNS servers or a public, censorship-resistant DNS provider. Go to Services > DNS Resolver. Under "General Settings," in the "Outgoing Network Interfaces" section, select only the Mullvad VPN interface. This ensures that DNS queries are only sent through the VPN tunnel. Alternatively, configure static DNS servers in DHCP server settings (Services > DHCP Server) for the CensorshipBypass network, pointing to Mullvad's DNS servers (e.g., 193.138.218.74, 81.19.142.102).
Implement a firewall rule to act as a kill switch. This prevents traffic from leaking through the regular internet connection if the Mullvad VPN connection drops.
Create a firewall rule on the LAN interface, placed below the Mullvad VPN routing rule, that blocks all traffic from the CensorshipBypass alias to any destination. Configure it as follows:
Action: Block
Interface: LAN
Protocol: Any
Source: CensorshipBypass
Destination: Any
This rule ensures that if the Mullvad VPN tunnel is down, traffic from devices in the CensorshipBypass alias will be blocked, preventing unencrypted traffic from being sent.
After configuring the Mullvad VPN and routing rules, thoroughly test the setup. From a device within the CensorshipBypass alias, visit a website that displays your IP address (e.g., icanhazip.com). The displayed IP address should match the IP address of the Mullvad VPN server, confirming that traffic is being routed through the VPN.
Also, test for DNS leaks using a service like dnsleaktest.com. The test should only show Mullvad's DNS servers or the public DNS servers you configured, not your ISP's DNS servers.
To test the kill switch, manually disconnect the Mullvad VPN connection in pfSense. Verify that internet access is blocked on the devices within the CensorshipBypass alias.
MTU Issues: If experiencing slow speeds or connectivity problems, adjust the MTU (Maximum Transmission Unit) on the Mullvad VPN interface. Try lowering the MTU to 1400 or 1300.
Firewall Rule Order: Ensure that the firewall rules are in the correct order. The Mullvad VPN routing rule must be above the block rule, and both must be above the default allow rule.
Mullvad Server Selection: Some Mullvad servers may be faster or more reliable than others. Experiment with different servers to find the best performance.
Configuration File Updates: Mullvad occasionally updates its OpenVPN configuration files. Download the latest configuration file from Mullvad's website to ensure compatibility.