Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to force USB Stick Modem to connect automatically?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
orion777
Apprentice
Apprentice


Joined: 15 Mar 2017
Posts: 197
Location: Riga, Latvia

PostPosted: Thu Jul 04, 2019 9:01 am    Post subject: How to force USB Stick Modem to connect automatically? Reply with quote

Good day!
I attach the USB Stick modem to a Gentoo machine. In "stick" mode (sometimes called "debug mode") the modem operates like a typical mobile broadband modem, so it requires appropriate commands from the operating system to operate.

At first, it is necessary to create a connection profile (to specify apn server,.. etc). This can be done thru GUI via the NetworkManager applet (similar to this https://www.maketecheasier.com/setup-usb-modem-linux/ ) and you will get the interface called usb0. This way is impractical (since not always I have X and monitor attached to my machines, but since it should to be done once, so Ok)..

Next, each time after reboot you have to select it manually to activate, only after this the interface will get its IP address. The activation can be done thru the GUI of NetworkManager, or, in case of SSH session, I can activate it via the nmtui.
Does there any way how to force it to activates automatically after each boot?

P.S.: nmcli into autostart?

Thank you!
Back to top
View user's profile Send private message
axl
l33t
l33t


Joined: 11 Oct 2002
Posts: 908
Location: Romania

PostPosted: Fri Jul 05, 2019 3:53 pm    Post subject: Reply with quote

you can't bind that thing into networkmanager as far as i know.

network manager relies on mac addresses to know what to do with an interface, and that thing... cdc_ether, gets a new mac every time you boot. or you disconnect/connect it.

I had a thread... https://forums.gentoo.org/viewtopic-t-1096746-highlight-.html

the short answer is no. not in network manager. you gonna have to go outside that.
Back to top
View user's profile Send private message
orion777
Apprentice
Apprentice


Joined: 15 Mar 2017
Posts: 197
Location: Riga, Latvia

PostPosted: Tue Jul 09, 2019 12:20 pm    Post subject: Reply with quote

My Huawei ME909s-120 module has exact ether address. Also it is recognized as usb0 every time.
At the first time, I have to put all configurations manually (e.g. apn, etc). This is done via network manager's graphical interface. It should to be done only once! Further the NetworkManager remember these settings!
The problem is that I have to use nmtui in order to "activate" the connections (same can be done via the graphical interface by clicking on the cellular provider icon (like desired access point for the wifi network)). The module already has all necessary settings, because there were entered during the first step.
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1786
Location: United Kingdom

PostPosted: Tue Jul 09, 2019 8:11 pm    Post subject: Reply with quote

Presumably you could use a similar approach to the following approach in Ubuntu 12.04, which uses a Bash script that calls nmcli:

https://www.thefanclub.co.za/how-to/how-auto-connect-ubuntu-1204-gsm-mobile-broadband-connection-on-boot-startup-service

In the case of Gentoo, instead of creating an OpenRC initscript I think you could save the Bash script in the directory /etc/local.d/ and name it something like /etc/local.d/10-huawei-me909s-120.start
_________________
Clevo W230SS: amd64 nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC eudev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum