You are not logged in.

#1 2025-08-28 07:59:53

Vlazm
Member
Registered: 2025-01-27
Posts: 25

Having problems with setting up manual proxy for NetworkManager

So I've been trying to find a way to setup a local proxy to routre my traffic through my other device.
But I haven't had much luck so far. I've even started to think about changing my network manager because it is so hard and convoluted to do basic stuff with NM

Some of the guides that I found suggest using the "manual" option for nmcli's proxy.method setting, however such option does not exist, furthermore Arch wiki says that there isn't a simple way to setup a proxy (my reading at least)
What I've tried doing is setting proxy.method to "automatic" and feeding in a custom PAC script that always returns the same proxy server.
But after saving the changes, restarting NetworkManager.service for good measure and trying to ping some websites, none of the traffic was routed through the proxy, In contrast to how exporting environment variables "http_proxy", and "HTTP_PROXY", allowed command-line utilities like curl run their traffic through said proxy.

My PAC file:

function FindProxyForURL(url, host) {
	return "PROXY xxx.xxx.xxx.xxx:pppp";
}

Also here's a part of the output for "print" command after running "nmcli con edit <my-connection>"
I left out the ip of proxy here but it matches the real ip so no issues there

-------------------------------------------------------------------------------
proxy.method:                           auto
proxy.browser-only:                     no
proxy.pac-url:                          --
proxy.pac-script:                       function FindProxyForURL(url, host) {
	return "PROXY xxxx.xxxx.xxxx.xxxx:pppp";
}

-------------------------------------------------------------------------------

I've come to a standstill, and have no idea what to do next. Sadly none of my search attempts brought anything useful (to my shame and against my principles I've even resorted to asking a chat bot, which aslo brought back nothing of value)

In summary, I'd apprecciate any advice on how to setup a proxy connection. I also will gladly take any recommendations for network managers that are more user-friendly

My system is up to date

The output for "nmcli --version" is

nmcli tool, version 1.54.0-1

Please let me know if I forgot to provide any neccessary info
Thanks in advance smile

Offline

#2 2025-08-28 08:49:48

-thc
Member
Registered: 2017-03-15
Posts: 992

Re: Having problems with setting up manual proxy for NetworkManager

NetworkManager doesn't support a "manual proxy" setting.

Is setting the proxy inside your app(s) (browser) not an option?
Is setting it system-wide via environment variables not an option?
Is setting this via NetworkManager dispatcher script not a option?

Offline

#3 2025-08-28 08:59:26

Vlazm
Member
Registered: 2025-01-27
Posts: 25

Re: Having problems with setting up manual proxy for NetworkManager

Environment variables only affect certain command-line utilities, as far as I'm conserned. I'd like all of my traffic to go through the proxy (which is why setting it only in browser/app is not an option either).

NetworkManager dispatcher script sounds promising though, I'll look into it,  although I admit I'm not exactly sure on how to do this

On a side note...
Why is network manager so cancer?? Is it really the best I can get? (Sorry if I'm getting off topic)

Offline

#4 2025-08-28 09:19:42

-thc
Member
Registered: 2017-03-15
Posts: 992

Re: Having problems with setting up manual proxy for NetworkManager

AFAIK every piece of software has it's drawbacks in specific use-cases. Are you really disappointed because of your proxy setting struggle alone?
Did you realize that the Wiki articles for systemd-networkd and netctl doesn't even mention proxy settings?

For me NetworkManager has it's benefits at handling VPNs quite well - i use it on my graphical desktops. On Arch servers and VMs I use systemd-networkd for simplicity reasons.

Last edited by -thc (2025-08-28 09:21:26)

Offline

#5 2025-08-28 09:41:57

Vlazm
Member
Registered: 2025-01-27
Posts: 25

Re: Having problems with setting up manual proxy for NetworkManager

Idk, just seems like a lot of hustle for setting something as basic as a proxy connection. Also idk why would you have a PAC file support that seemingly doesn't work (at least it doesn't for me)

I'll be trying to setup some scripts for NM in the meantime, and will post results in here

Offline

#6 2025-08-28 09:43:00

-thc
Member
Registered: 2017-03-15
Posts: 992

Re: Having problems with setting up manual proxy for NetworkManager

Vlazm wrote:

Environment variables only affect certain command-line utilities, as far as I'm conserned.

I'm not sure about that  - have you tried it?

Offline

#7 2025-08-28 09:53:21

Vlazm
Member
Registered: 2025-01-27
Posts: 25

Re: Having problems with setting up manual proxy for NetworkManager

Yes, ping command, git clone and qutebrowser app at least didn't seem to acknowledge the proxy settings... Again something like curl works just fine with environment variables

As I've stated in original message, I only modified "http_proxy", and "HTTP_PROXY" environment vars. Maybe they use https ones and ignore http?

Offline

#8 2025-08-28 12:29:19

-thc
Member
Registered: 2017-03-15
Posts: 992

Re: Having problems with setting up manual proxy for NetworkManager

Offline

#9 2025-08-28 15:40:43

Vlazm
Member
Registered: 2025-01-27
Posts: 25

Re: Having problems with setting up manual proxy for NetworkManager

Took a look at the article attached
Not gonna lie, was lowkey expecting this to work because it sounds like a convincing explanation for why setting the http_proxy environment variable didn't work.

But after setting similar https, ftp, rsync proxy vars and their caps variations to "xxx.xxx.xxx.xxx:pppp" and "http://xxx.xxx.xxx.xxx:pppp" I have to conclude that this still does not work for everything.

Again, it works just fine for curl and wget but about everything else ignores these variables it seems

Offline

#10 2025-08-28 16:41:15

-thc
Member
Registered: 2017-03-15
Posts: 992

Re: Having problems with setting up manual proxy for NetworkManager

O.K. - so the variables are not universally considered a "system setting" for the proxy.

Offline

#11 2025-08-28 16:47:35

Vlazm
Member
Registered: 2025-01-27
Posts: 25

Re: Having problems with setting up manual proxy for NetworkManager

Looks like it, too tired to do anything today, so an update will be tomorrow probably

Offline

#12 2025-09-13 09:38:46

Vlazm
Member
Registered: 2025-01-27
Posts: 25

Re: Having problems with setting up manual proxy for NetworkManager

Sorry for a late update. I just can't believe how hard can such a simple thing be. Setting a proxy server can not be that difficult, I just refuse to belive so. Long story short: my local proxy is out of the question since it went down and refuses to get up whatsoever (shouldn't be much of the problem though considering the amount of publicly available free ones). I've looked into the proxyman-git aur package, well I tried... Due to regional limitations most of the AUR is off limits for me meaning that most of the official vpn apps also can't be downloaded (git is accessible but is very inconsistent and troublesome to work with). OpenVPN and WireGuard configurations are also unfortunately were of no help (for reasons still unknown for me, I tried 2 different paid and trusted VPN providers that work just fine on other devices).

So what I'm trying to say is that I'm in sort of an infinite loop were I can not set up a system-wide proxy and the only methods I haven't tried yet require me to setup a proxy to bypass regional blocks to even dare to attempt them.

One of the solutions I could use is getting someone with Windows or Macos to share their vpn connection via a hotspot, so I can try out proxyman-git and possibly some official vpn apps from aur. 

The other one is trying to run ssh tunnel from my pc to my phone with working vpn (again to bypass blocks and try to install proxyman), but I'm uncertain if this will work and this is another whole can of worms.

Please if you have any idea on how to make things work or have any other kind of suggestions or advice, let me know. I've been on this problem for longer then I'am willing to admit

Offline

Board footer

Powered by FluxBB