Skip to main content
Topic: Networking without any network manager (Read 1037 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Networking without any network manager

Hi,

I've had many irritating problems with connman, and I absolutely want to avoid NetworkManager, so I'm considering starting to manage my networking with bare basic command line tools like ifconfig, dhclient, openresolv and so on.

Is there anything in particular that I would need to watch out?

Should I expect trouble using some programs that "expect" at least one network manager?

Re: Networking without any network manager

Reply #1
You have basic dhcp connection to the router/isp? Then just enable service dhcpcd in your init.
Granted the fact that it misses some advanced features, it just works.

Re: Networking without any network manager

Reply #2
No normal programs should expect a network manager.
Only those that control said network manager should depend on it.

I say 'should' as until recently the Artix / Arch KDE power management settings module did depend on NetworkManager ( and Bluez).
That is fixed but there's a possibility other packages have such dependencies ? The only 'trouble' you'd likely get is the dependency being dragged in in such a case.

It's a lot easier to do with a wired connection but well within the realms of possibility with wifi.
The init you use can also affect your options i.e. Openrc has netifrc as standard.

Re: Networking without any network manager

Reply #3
@gripped
Yes my main worry would be how to manage wifi (I'm already used to manage bluetooth with bluetootctl).
It's completely feasible with just the likes of iwlist, iwconfig and all, right?
On Arch wiki I'm seeing that they introduced a new tool iw, is that any good?
Ouch, I'm seeing that if I want WPA I should use wpa_ or iwd instead.

Re: Networking without any network manager

Reply #4
And wpa_supplicant.
Yes it's doable without a doubt. But whether a NM is preferable depends both on how often you connect to different networkS and how much you want to faff about when you just want to connect to airport wifi for 20 minutes.

My own notes on the matter (because I do it so rarely I tend to forget!)

Manually connect to wifi in a terminal
Spoiler (click to show/hide)

You can of course make scripts / services for your regular connections.



Re: Networking without any network manager

Reply #5
So, I've just come across one problem:
dhclient overrides the /etc/resolv.conf written by openresolv (that I applied with resolvconf -u).

I was using it to change my DNS to 1.1.1.1.

Is there a way to tell dhclient to take resolvconf into account?

Re: Networking without any network manager

Reply #6
I've no experience with openresolv or dhclient.
You'd have to read the dhclient docs.

But if nothing leaps out you could try
Code: [Select]
chattr +i /etc/resolv.conf
(makes the file immutable) dhclient may complain or fail though. Or use dhcpd where I know you can set an DNS server.
If you do set it immutable don't forget or you'll give yourself a headache if you want to edit it in the future. You'd need to use -i before you could edit or delete.


Re: Networking without any network manager

Reply #7
If you put:
prepend domain-name-servers 1.1.1.1;
in your dhclient.conf file, specified when you start dhclient, it would make that entry the first in the list so it's used as the default dns server, which might do what you wanted. dhclient reconnects after a lost connection better than dhcpcd when used simply in a relatively unconfigured form so is easier to use for this sort of thing.

Re: Networking without any network manager

Reply #8
If you put:
prepend domain-name-servers 1.1.1.1;
in your dhclient.conf file, specified when you start dhclient, it would make that entry the first in the list so it's used as the default dns server, which might do what you wanted. dhclient reconnects after a lost connection better than dhcpcd when used simply in a relatively unconfigured form so is easier to use for this sort of thing.

Unfortunately this would be a security risk.
Because then, if for some reason 1.1.1.1 becomes unavailable, the traffic would be redirected to another, non-safe, DNS, without requiring any confirmation from the user and without the user even noticing it.

I'm looking for a solution that would put only 1.1.1.1 in the DNS list.

Re: Networking without any network manager

Reply #9
OK, sorry, in some cases you might want to keep the default as a fallback option. If you swap "prepend" for "supersede" in that line it should do what you want. Note the spelling of supersede, not the alternative supercede.

 
Artix forum uses a single cookie to remember youOK