You are not logged in.

#1 2024-04-19 08:01:02

archuser38013
Member
Registered: 2024-01-27
Posts: 18

Network manager, wvdial, mobile internet questions

I think the main gaps in my general understanding of networking are around routing and how IP addresses are issued in the system regardless of network interface - wired, wifi, mobile.

I had been banging my head against a wall all day trying to get wvdial to work with my 3g dongle following the archwiki: https://wiki.archlinux.org/title/Wvdial which is rather sparse.

I had edited the wvdial config file and was getting the error of No carrier. Somehow I managed to figure out I was using the wrong tty interface (0 instead of 2) which I think I garnered by looking at mmcli info and it showed main interface to be the latter.

Ok so then I change that in the wvdial conf file and then was able to get a connection and a bunch of output on the terminal which was gibberish to me. Looking again in mmcli confirmed connection with a field stating "connected" whereas is went away again when I quit wvdial.

I took that as a good sign however there was a problem in that there was no internet still and it seemed the problem was that an IP address had not been issued. Not sure what led me to this conclusion at the time but I do know dhcpcd was running as standard on my system so don't know what was missing to prevent it from being issued.

Due to the anorectic documentation generally for mobile internet connections I was at a loss how to complete that step to tie it together.

So I did some more searches on how to bring a mobile dongle online and found another article which used network manager/nmcli instead; namely this article: https://ubuntu.com/core/docs/networkman … onnections

I stopped any services related to the previous attempts and started again following that which uses network manager and lo and behold I was able to get it to work.

The missing pieces to bring it up seemed to be these two lines:

$ nmcli c add type gsm ifname <interface> con-name <name> apn <operator_apn>
$ nmcli r wwan on

I had not used network manager with any regularity before due to preferring the simplest solutions (some small profile for wired and wpa_supplicant more recently for wifi) and just making a small shell script to bring up relevant interfaces. I am wondering is network manager/nmcli worth having around despite being quite large compared to simple, individual, scripting options. If so why? Also I would like to know how to achieve the same with wvdial bearing in mind the problem I believe is that I was able to get a connection with wvdial but was not able to get ip routing to work with it.

The above nmcli commands somehow was able to set that all up for me so I am trying to better understand how it did it for general edification but also to be able to attempt with other programs should I choose to.

Unless people give good reasons to stick with network manager I think all other things being equal I would prefer individual solutions as I have done up to now. I am only using it right now as that is the only thing I got to work so far with the mobile connection. It also wiped my /etc/resolv.conf (historically I would make it immutable when programs would try to do that but not sure if that would mess up network manager's usual operation and still don't understand why certain programs do this so more understanding required here too) which I am not fond of, since the programs that change them would break the functionality of other ones that want to use it, often leaving a blank file behind (again would like to know what is up with this too if anyone can comment as an aside), and took me a little to figure out that was the issue as to why my wifi connection stopped working after having installed network manager.

Last edited by archuser38013 (2024-04-19 08:03:30)

Offline

#2 2024-04-19 08:29:29

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

Re: Network manager, wvdial, mobile internet questions

What you seem to miss here is the strength of a network management tool like NetworkManager: If configured correctly it will handle the wired, the wireless and your WWAN connection and make all the necessary changes (e.g. resolv.conf - because your default DNS server changes when switching connections).

You can tell NetworkManager to leave resolv.conf alone - but then you have to maintain it yourself.

If you prefer using no management tool and use pure scripting - you can do that.
https://wiki.archlinux.org/title/Networ … ion#Manual

Offline

#3 2024-04-19 10:59:01

archuser38013
Member
Registered: 2024-01-27
Posts: 18

Re: Network manager, wvdial, mobile internet questions

-thc wrote:

What you seem to miss here is the strength of a network management tool like NetworkManager: If configured correctly it will handle the wired, the wireless and your WWAN connection and make all the necessary changes (e.g. resolv.conf - because your default DNS server changes when switching connections).

You can tell NetworkManager to leave resolv.conf alone - but then you have to maintain it yourself.

If you prefer using no management tool and use pure scripting - you can do that.
https://wiki.archlinux.org/title/Networ … ion#Manual

Indeed that would seem to defeat the purpose of having manager smile.

Ok so I suppose the resolv.conf changing issue would be moot if network manager were the one handling everything? Why do dns settings have to change? I thought it was just to resolve the dns and as such I had just used public namesevers or even localhost for this.

Offline

#4 2024-04-19 11:39:11

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

Re: Network manager, wvdial, mobile internet questions

There are many usage scenarios (VPN for privacy, workplace VPN) in which the DNS server has to change to reach the intended goal.

If you trust some public DNS provider (1.1.1.1, 8.8.8.8, 9.9.9.9) and never want to change the DNS server - fine. Tell your network management to leave DNS alone and set it up yourself (static).

Offline

#5 2024-04-19 13:38:46

archuser38013
Member
Registered: 2024-01-27
Posts: 18

Re: Network manager, wvdial, mobile internet questions

Just going through the network configuration wiki again and I notice on the comparison of network managers that dhcpcd does not support mobile broadband while network manager does. That could go a ways to explaining my issues. How come the former doesn't but the latter does? Trying to figure out what is lacking under the hood to better understand.

I had just been using dhcpcd + iwd for wifi connection as well as wired previously. Tbh I didn't know dhcpcd was a 'network manager'. I thought it was just a program to issue IP addresses.

Offline

#6 2024-04-19 15:08:46

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

Re: Network manager, wvdial, mobile internet questions

archuser38013 wrote:

Just going through the network configuration wiki again and I notice on the comparison of network managers that dhcpcd does not support mobile broadband while network manager does. That could go a ways to explaining my issues. How come the former doesn't but the latter does? Trying to figure out what is lacking under the hood to better understand.

Because dhcpcd was written as DHCP client and not as a complete all-in-one network management like NetworkManager? It is mentioned in the wiki under "network managers" because it fits the wikis definition.

archuser38013 wrote:

I had just been using dhcpcd + iwd for wifi connection as well as wired previously.

Did you realize that you may not need dhcpcd? Because iwd does DHCP on it's own. Don't know if it manages wired connections too.

archuser38013 wrote:

Tbh I didn't know dhcpcd was a 'network manager'. I thought it was just a program to issue IP addresses.

A DHCP client doesn't "issue" IP addresses - a DHCP server does.

To make things short: You want a network management that includes mobile broadband? Choose between netctl, ConnMan and NetworkManager. Don't forget to uninstall iwd and dhcpcd. You read the note from the wiki?

wiki wrote:

Note: Each network interface should be managed by only one DHCP client or network manager, so it is advised to run only one DHCP client or network manager on the system.

Last edited by -thc (2024-04-19 15:11:03)

Offline

#7 2024-04-20 06:55:09

archuser38013
Member
Registered: 2024-01-27
Posts: 18

Re: Network manager, wvdial, mobile internet questions

-thc wrote:
archuser38013 wrote:

Just going through the network configuration wiki again and I notice on the comparison of network managers that dhcpcd does not support mobile broadband while network manager does. That could go a ways to explaining my issues. How come the former doesn't but the latter does? Trying to figure out what is lacking under the hood to better understand.

Because dhcpcd was written as DHCP client and not as a complete all-in-one network management like NetworkManager? It is mentioned in the wiki under "network managers" because it fits the wikis definition.

archuser38013 wrote:

I had just been using dhcpcd + iwd for wifi connection as well as wired previously.

Did you realize that you may not need dhcpcd? Because iwd does DHCP on it's own. Don't know if it manages wired connections too.

archuser38013 wrote:

Tbh I didn't know dhcpcd was a 'network manager'. I thought it was just a program to issue IP addresses.

A DHCP client doesn't "issue" IP addresses - a DHCP server does.

To make things short: You want a network management that includes mobile broadband? Choose between netctl, ConnMan and NetworkManager. Don't forget to uninstall iwd and dhcpcd. You read the note from the wiki?

wiki wrote:

Note: Each network interface should be managed by only one DHCP client or network manager, so it is advised to run only one DHCP client or network manager on the system.

Yes I was aware iwd possesses the ability to do dhcp too. I just didn't use it as I was not aware when I installed and used dhcpcd as my go to. Even so if using network manager I might as well use that as dhcp anyway eh?

The wiki also says iwd can be used with nm in place of wpa_supplicant, not seeing any issues there so far.

I did not read that part of the wik about dhcp client but I had surmised as much myself. I generally don't read through the whole wikis as take them bit by bit as I require the information. Maybe not the best way to do things but just what I have done.

I am not keen on the 'feature' of auto connection with network manager. I am wanting different connections at different things. I do not see a way to disable autoconnect in network manager. Any suggestions? I thought I could stop that by either stop using nm for wifi and go back to iwd for that unless there is a way to block nm from doing that within itself. I was just thinking I could delete the profiles and just run a script to start connections from via cli but from what I am reading the connection will be saved as a profile just by running the connect command.

EDIT:

I am having a further issue now with interfaces renaming themselves when I run libvirtd causing network manager to not load other connections. Loading libvirtd and the ensuing bridges which nm seems to also commandeer is apparently shunting other network interfaces to different names so wlan0 becomes wlan1 and thus will not load with the usual command without editing the connection file.

Here is the error; strangely showing virbr1 as the interface for the wlan connection even though wlan0/1 is the interface in the profile.

$ nmcli connection up <network-name>
Error: Connection activation failed: No suitable device found for this connection (device virbr1 not available because profile is not compatible with device (mismatching interface name)).

So how to either use non mutable interface names (I had a look in the man searching ifname and didn't see anything apparent) or stop libvirtd from messing them up in the first place?

I tried first load libvirtd before bringing the network up. This did not change the interface name immediately and I was able to connect to wifi normally, However when putting the computer into sleep mode and opening again the interface name had changed from wlan0 to wlan1.

Last edited by archuser38013 (2024-04-20 11:18:26)

Offline

Board footer

Powered by FluxBB