Have connected at least once to the WiFi network... obviously
Create a Proxy Auto-Config File
For a basic, send-all, but local, scenario, we'll take the following as an example :
function FindProxyForURL(url, host) {
// Exclude localhost
if (
isPlainHostName(host) ||
isInNet(dnsResolve(host), "127.0.0.0", "255.255.255.0")
)
return "DIRECT";
else return "PROXY 123.123.123.123:8080";
}Save that into a known location with a file extension of .pac for better reference
There are two ways to tell NetworkManager about the Proxy config :
CLI
Run :
nmcli connection edit <wifi-network-name>This will pop you into the NetworkManager editor shell
We'll need to modify both the proxy.method and proxy.pac-script parameters
First, proxy.method needs to be set to auto, to allow for a PAC script
set proxy.method autoFinally, proxy.pac-script need to be set
The format is file://<Absolute Path to the file>
For example : file:///home/example/example.pac (note the /// that represent an absolute path)
set proxy.pac-script file:///home/example/example.pacGUI
Install nm-connection-editor if not already installed
Debian-based distros :
sudo apt-get install network-manager-gnomeRPM distros :
sudo <yum/dnf/zypper> install nm-connection-editorOpen nm-connection-editor, either by the CLI, or the GUI (usually named Advanced Network Configuration)
In it, choose the wifi network
- Go to the
Proxymenu - Put
MethodtoAuto - And then select your file in
Import script from file...