LINUX.ORG.RU

NetworkManager не хочет автоматически включать 4G модем

 ,


0

2

Я создал в NetworkManager такое подключение:

connection.type:                        gsm
connection.autoconnect:                 yes
connection.autoconnect-priority:        100
connection.autoconnect-retries:         0 (forever)

Если запустить его руками

nmcli c up Megafon\ GPRS
то все работает, доступ в интернет через модем есть. Но подключаться автоматически при старте системы оно не хочет. Ничего не понимаю, почему так происходит?

Запуск руками:

Nov 25 04:58:07 ct-10 NetworkManager[887]: <info>  [1574657887.7442] device (ttyUSB0): Activation: starting connection 'Megafon GPRS' (7291b54f-a21a-4cf2-bcc5-b5fc7b5c6206)
Nov 25 04:58:07 ct-10 NetworkManager[887]: <info>  [1574657887.7514] audit: op="connection-activate" uuid="7291b54f-a21a-4cf2-bcc5-b5fc7b5c6206" name="Megafon GPRS" pid=1497 uid=1000 result="success"
Nov 25 04:58:07 ct-10 NetworkManager[887]: <info>  [1574657887.7538] device (ttyUSB0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Nov 25 04:58:07 ct-10 ModemManager[868]: <info>  Simple connect started...
Nov 25 04:58:07 ct-10 ModemManager[868]: <info>  Simple connect state (4/8): Wait to get fully enabled
Nov 25 04:58:07 ct-10 ModemManager[868]: <info>  Simple connect state (5/8): Register
Nov 25 04:58:07 ct-10 ModemManager[868]: <info>  Simple connect state (6/8): Bearer
Nov 25 04:58:07 ct-10 ModemManager[868]: <info>  Simple connect state (7/8): Connect
Nov 25 04:58:07 ct-10 ModemManager[868]: <info>  Modem /org/freedesktop/ModemManager1/Modem/0: state changed (registered -> connecting)
Nov 25 04:58:07 ct-10 ModemManager[868]: <warn>  Couldn't find associated cdc-wdm port for 'net/wwx001e101f0000'
Nov 25 04:58:07 ct-10 NetworkManager[887]: <info>  [1574657887.7926] modem["ttyUSB0"]: modem state changed, 'registered' --> 'connecting' (reason: user-requested)
Nov 25 04:58:07 ct-10 ModemManager[868]: <info>  Modem /org/freedesktop/ModemManager1/Modem/0: state changed (connecting -> registered)
Nov 25 04:58:07 ct-10 NetworkManager[887]: <info>  [1574657887.7958] modem["ttyUSB0"]: modem state changed, 'connecting' --> 'registered' (reason: user-requested)
Nov 25 04:58:07 ct-10 ModemManager[868]: <info>  Simple connect started...
Nov 25 04:58:07 ct-10 ModemManager[868]: <info>  Simple connect state (4/8): Wait to get fully enabled
Nov 25 04:58:07 ct-10 ModemManager[868]: <info>  Simple connect state (5/8): Register
Nov 25 04:58:07 ct-10 ModemManager[868]: <info>  Simple connect state (6/8): Bearer
Nov 25 04:58:07 ct-10 ModemManager[868]: <info>  Simple connect state (7/8): Connect
Nov 25 04:58:07 ct-10 ModemManager[868]: <info>  Modem /org/freedesktop/ModemManager1/Modem/0: state changed (registered -> connecting)
Nov 25 04:58:07 ct-10 ModemManager[868]: <warn>  Couldn't find associated cdc-wdm port for 'net/wwx001e101f0000'
Nov 25 04:58:07 ct-10 NetworkManager[887]: <info>  [1574657887.8260] modem["ttyUSB0"]: modem state changed, 'registered' --> 'connecting' (reason: user-requested)
Nov 25 04:58:08 ct-10 ModemManager[868]: <info>  Modem /org/freedesktop/ModemManager1/Modem/0: state changed (connecting -> connected)
Nov 25 04:58:08 ct-10 ModemManager[868]: <info>  Simple connect state (8/8): All done
Nov 25 04:58:08 ct-10 NetworkManager[887]: <info>  [1574657888.9409] modem["ttyUSB0"]: modem state changed, 'connecting' --> 'connected' (reason: user-requested)
Nov 25 04:58:08 ct-10 NetworkManager[887]: <info>  [1574657888.9616] device (ttyUSB0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Nov 25 04:58:08 ct-10 NetworkManager[887]: <info>  [1574657888.9699] device (ttyUSB0): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
Nov 25 04:58:08 ct-10 NetworkManager[887]: <info>  [1574657888.9764] modem["ttyUSB0"]: IPv6 configuration disabled
Nov 25 04:58:08 ct-10 NetworkManager[887]: <info>  [1574657888.9768] modem-broadband[ttyUSB0]: IPv4 static configuration:
Nov 25 04:58:08 ct-10 NetworkManager[887]: <info>  [1574657888.9772] modem-broadband[ttyUSB0]:   address XX.XX.XX.XX/29
Nov 25 04:58:08 ct-10 NetworkManager[887]: <info>  [1574657888.9774] modem-broadband[ttyUSB0]:   gateway XX.XX.XX.XX
Nov 25 04:58:08 ct-10 NetworkManager[887]: <info>  [1574657888.9776] modem-broadband[ttyUSB0]:   DNS XX.XX.XX.XX
Nov 25 04:58:08 ct-10 NetworkManager[887]: <info>  [1574657888.9777] modem-broadband[ttyUSB0]:   DNS XX.XX.XX.XX
Nov 25 04:58:08 ct-10 NetworkManager[887]: <info>  [1574657888.9946] device (ttyUSB0): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed')
Nov 25 04:58:09 ct-10 NetworkManager[887]: <info>  [1574657889.0075] device (ttyUSB0): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed')
Nov 25 04:58:09 ct-10 NetworkManager[887]: <info>  [1574657889.0133] device (ttyUSB0): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed')
Nov 25 04:58:09 ct-10 NetworkManager[887]: <info>  [1574657889.0971] device (ttyUSB0): Activation: successful, device activated.

При старте системы:

Nov 25 04:39:22 ct-10 ModemManager[516]: <info>  Couldn't check support for device '/sys/devices/platform/soc@1c00000/1c12000.mmc/mmc_host/mmc1/mmc1:0001/mmc1:0001:1': not supported by any plugin
Nov 25 04:39:22 ct-10 ModemManager[516]: <info>  Couldn't check support for device '/sys/devices/platform/soc@1c00000/1c50000.ethernet': not supported by any plugin
Nov 25 04:39:25 ct-10 NetworkManager[537]: <info>  [1574656765.2144] manager: startup complete
Nov 25 04:39:30 ct-10 ModemManager[516]: <info>  [device /sys/devices/platform/soc@1c00000/1c1c000.usb/usb2/2-1] creating modem with plugin 'Huawei' and '4' ports
Nov 25 04:39:30 ct-10 ModemManager[516]: <warn>  Could not grab port (usbmisc/cdc-wdm0): 'Cannot add port 'usbmisc/cdc-wdm0', unsupported'
Nov 25 04:39:30 ct-10 ModemManager[516]: <info>  Modem for device '/sys/devices/platform/soc@1c00000/1c1c000.usb/usb2/2-1' successfully created
Nov 25 04:39:35 ct-10 ModemManager[516]: <info>  Modem: state changed (unknown -> disabled)
Nov 25 04:39:35 ct-10 NetworkManager[537]: <info>  [1574656775.0427] modem["ttyUSB0"]: modem state changed, 'disabled' --> 'enabling' (reason: user preference)
Nov 25 04:39:35 ct-10 NetworkManager[537]: <info>  [1574656775.0490] manager: (ttyUSB0): new Broadband device (/org/freedesktop/NetworkManager/Devices/5)
Nov 25 04:39:35 ct-10 NetworkManager[537]: <info>  [1574656775.0548] device (ttyUSB0): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
Nov 25 04:39:35 ct-10 NetworkManager[537]: <info>  [1574656775.0609] device (ttyUSB0): modem state 'enabling'
Nov 25 04:39:35 ct-10 NetworkManager[537]: <info>  [1574656775.0687] device (ttyUSB0): state change: unavailable -> disconnected (reason 'none', sys-iface-state: 'managed')
Nov 25 04:39:35 ct-10 NetworkManager[537]: <info>  [1574656775.0776] policy: auto-activating connection 'Megafon GPRS' (7291b54f-a21a-4cf2-bcc5-b5fc7b5c6206)
Nov 25 04:39:35 ct-10 NetworkManager[537]: <info>  [1574656775.0910] device (ttyUSB0): Activation: starting connection 'Megafon GPRS' (7291b54f-a21a-4cf2-bcc5-b5fc7b5c6206)
Nov 25 04:39:35 ct-10 NetworkManager[537]: <info>  [1574656775.0953] device (ttyUSB0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Nov 25 04:39:35 ct-10 ModemManager[516]: <info>  Modem /org/freedesktop/ModemManager1/Modem/0: state changed (disabled -> enabling)
Nov 25 04:39:35 ct-10 ModemManager[516]: <info>  Simple connect started...
Nov 25 04:39:35 ct-10 ModemManager[516]: <info>  Simple connect state (4/8): Wait to get fully enabled
Nov 25 04:39:35 ct-10 ModemManager[516]: <info>  Modem /org/freedesktop/ModemManager1/Modem/0: state changed (enabling -> enabled)
Nov 25 04:39:35 ct-10 ModemManager[516]: <info>  Simple connect state (5/8): Register
Nov 25 04:39:35 ct-10 NetworkManager[537]: <info>  [1574656775.9313] modem["ttyUSB0"]: modem state changed, 'enabling' --> 'enabled' (reason: user-requested)
Nov 25 04:39:35 ct-10 ModemManager[516]: <info>  Modem /org/freedesktop/ModemManager1/Modem/0: 3GPP Registration state changed (unknown -> registering)
Nov 25 04:39:36 ct-10 ModemManager[516]: <info>  Simple connect state (6/8): Bearer
Nov 25 04:39:36 ct-10 ModemManager[516]: <info>  Simple connect state (7/8): Connect
Nov 25 04:39:36 ct-10 NetworkManager[537]: <info>  [1574656776.0204] modem["ttyUSB0"]: modem state changed, 'enabled' --> 'connecting' (reason: user-requested)
Nov 25 04:39:36 ct-10 ModemManager[516]: <info>  Modem /org/freedesktop/ModemManager1/Modem/0: state changed (enabled -> connecting)
Nov 25 04:39:36 ct-10 NetworkManager[537]: <info>  [1574656776.0232] modem["ttyUSB0"]: modem state changed, 'connecting' --> 'unknown' (reason: user-requested)
Nov 25 04:39:36 ct-10 ModemManager[516]: <warn>  Couldn't find associated cdc-wdm port for 'net/wwx001e101f0000'
Nov 25 04:39:36 ct-10 NetworkManager[537]: <info>  [1574656776.0234] device (ttyUSB0): state change: prepare -> disconnected (reason 'user-requested', sys-iface-state: 'managed')
Nov 25 04:39:36 ct-10 ModemManager[516]: <info>  Modem /org/freedesktop/ModemManager1/Modem/0: state changed (connecting -> unknown)
Nov 25 04:39:36 ct-10 ModemManager[516]: <info>  Modem /org/freedesktop/ModemManager1/Modem/0: 3GPP Registration state changed (registering -> home)
Nov 25 04:39:36 ct-10 ModemManager[516]: <info>  Modem /org/freedesktop/ModemManager1/Modem/0: state changed (unknown -> registered)
Nov 25 04:39:36 ct-10 NetworkManager[537]: <info>  [1574656776.0690] modem["ttyUSB0"]: modem state changed, 'unknown' --> 'registered' (reason: unknown)

systemd например запускает networkmanager раньше modemmanager. он вроде нужен для таких соединений.

sergej ★★★★★ ()
Ответ на: комментарий от sergej

Да, ModemManager стартует на секунду позже NM, но к моменту когда NM начинает попытки поднять соединение уже

modem-manager: ModemManager available
Или это не то? Если просто воткнуть модем немного погодя, то все равно получается та же история.

Zeta_Gundam ()

Созданный через GUI такой, подрубается при старте сессии пользователя:

$ nmcli connection show Megafon 
connection.id:                          Megafon
connection.uuid:                        3f86da6e-0e7a-4ae6-8841-0ac1496738b7
connection.stable-id:                   --
connection.type:                        gsm
connection.interface-name:              --
connection.autoconnect:                 да
connection.autoconnect-priority:        0
connection.autoconnect-retries:         -1 (default)
connection.multi-connect:               0 (default)
connection.auth-retries:                -1
connection.timestamp:                   1574660918
connection.read-only:                   нет
connection.permissions:                 --
connection.zone:                        --
connection.master:                      --
connection.slave-type:                  --
connection.autoconnect-slaves:          -1 (default)
connection.secondaries:                 --
connection.gateway-ping-timeout:        0
connection.metered:                     неизвестно
connection.lldp:                        default
connection.mdns:                        -1 (default)
connection.llmnr:                       -1 (default)
ipv4.method:                            auto
ipv4.dns:                               --
ipv4.dns-search:                        --
ipv4.dns-options:                       ""
lines 1-27...skipping...
connection.id:                          Megafon
connection.uuid:                        3f86da6e-0e7a-4ae6-8841-0ac1496738b7
connection.stable-id:                   --
connection.type:                        gsm
connection.interface-name:              --
connection.autoconnect:                 да
connection.autoconnect-priority:        0
connection.autoconnect-retries:         -1 (default)
connection.multi-connect:               0 (default)
connection.auth-retries:                -1
connection.timestamp:                   1574660918
connection.read-only:                   нет
connection.permissions:                 --
connection.zone:                        --
connection.master:                      --
connection.slave-type:                  --
connection.autoconnect-slaves:          -1 (default)
connection.secondaries:                 --
connection.gateway-ping-timeout:        0
connection.metered:                     неизвестно
connection.lldp:                        default
connection.mdns:                        -1 (default)
connection.llmnr:                       -1 (default)
ipv4.method:                            auto
ipv4.dns:                               --
ipv4.dns-search:                        --
ipv4.dns-options:                       ""
ipv4.dns-priority:                      0
ipv4.addresses:                         --
ipv4.gateway:                           --
ipv4.routes:                            --
ipv4.route-metric:                      -1
ipv4.route-table:                       0 (unspec)
ipv4.ignore-auto-routes:                нет
ipv4.ignore-auto-dns:                   нет
ipv4.dhcp-client-id:                    --
ipv4.dhcp-timeout:                      0 (default)
ipv4.dhcp-send-hostname:                да
ipv4.dhcp-hostname:                     --
ipv4.dhcp-fqdn:                         --
ipv4.never-default:                     нет
ipv4.may-fail:                          да
ipv4.dad-timeout:                       -1 (default)
ipv6.method:                            auto
ipv6.dns:                               --
ipv6.dns-search:                        --
ipv6.dns-options:                       ""
ipv6.dns-priority:                      0
ipv6.addresses:                         --
ipv6.gateway:                           --
ipv6.routes:                            --
ipv6.route-metric:                      -1
ipv6.route-table:                       0 (unspec)
ipv6.ignore-auto-routes:                нет
ipv6.ignore-auto-dns:                   нет
ipv6.never-default:                     нет
ipv6.may-fail:                          да
ipv6.ip6-privacy:                       0 (disabled)
ipv6.addr-gen-mode:                     stable-privacy
ipv6.dhcp-duid:                         --
ipv6.dhcp-send-hostname:                да
ipv6.dhcp-hostname:                     --
ipv6.token:                             --
gsm.number:                             *99#
gsm.username:                           --
gsm.password:                           <hidden>
gsm.password-flags:                     1 (под управлением агент<D0>)
gsm.apn:                                internet
gsm.network-id:                         --
gsm.pin:                                <hidden>
gsm.pin-flags:                          0 (нет)
gsm.home-only:                          нет
gsm.device-id:                          --
gsm.sim-id:                             --
gsm.sim-operator-id:                    --
gsm.mtu:                                автоматически
proxy.method:                           none
proxy.browser-only:                     нет
proxy.pac-url:                          --
proxy.pac-script:                       --
GENERAL.NAME:                           Megafon
GENERAL.UUID:                           3f86da6e-0e7a-4ae6-8841-0ac1496738b7
GENERAL.DEVICES:                        ttyUSB2
GENERAL.STATE:                          включено
GENERAL.DEFAULT:                        да
GENERAL.DEFAULT6:                       нет
GENERAL.SPEC-OBJECT:                    --
GENERAL.VPN:                            нет
GENERAL.DBUS-PATH:                      /org/freedesktop/NetworkManager/ActiveConnection/4
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/Settings/1
GENERAL.ZONE:                           --
GENERAL.MASTER-PATH:                    --
IP4.ADDRESS[1]:                         100.88.239.168/32
IP4.ADDRESS[2]:                         100.88.239.168/32
IP4.GATEWAY:                            0.0.0.0
IP4.ROUTE[1]:                           dst = 10.64.64.64/32, nh = 0.0.0.0, mt = 0
IP4.ROUTE[2]:                           dst = 10.64.64.64/32, nh = 0.0.0.0, mt = 700
IP4.ROUTE[3]:                           dst = 0.0.0.0/0, nh = 0.0.0.0, mt = 700
IP4.DNS[1]:                             10.77.48.99
IP4.DNS[2]:                             10.77.48.115
mandala ★★★★ ()
Ответ на: комментарий от mandala

Сделал похожий конфиг - все равно сам не включается. Да он и так был почти дефолтный.

connection.id:                          Megafon GPRS
connection.uuid:                        7291b54f-a21a-4cf2-bcc5-b5fc7b5c6206
connection.stable-id:                   --
connection.type:                        gsm
connection.interface-name:              --
connection.autoconnect:                 yes
connection.autoconnect-priority:        0
connection.autoconnect-retries:         -1 (default)
connection.multi-connect:               0 (default)
connection.auth-retries:                -1
connection.timestamp:                   1574661896
connection.read-only:                   no
connection.permissions:                 --
connection.zone:                        --
connection.master:                      --
connection.slave-type:                  --
connection.autoconnect-slaves:          -1 (default)
connection.secondaries:                 --
connection.gateway-ping-timeout:        0
connection.metered:                     unknown
connection.lldp:                        default
connection.mdns:                        -1 (default)
connection.llmnr:                       -1 (default)
ipv4.method:                            auto
ipv4.dns:                               --
ipv4.dns-search:                        --
ipv4.dns-options:                       ""
ipv4.dns-priority:                      0
ipv4.addresses:                         --
ipv4.gateway:                           --
ipv4.routes:                            --
ipv4.route-metric:                      -1
ipv4.route-table:                       0 (unspec)
ipv4.ignore-auto-routes:                no
ipv4.ignore-auto-dns:                   no
ipv4.dhcp-client-id:                    --
ipv4.dhcp-timeout:                      0 (default)
ipv4.dhcp-send-hostname:                yes
ipv4.dhcp-hostname:                     --
ipv4.dhcp-fqdn:                         --
ipv4.never-default:                     no
ipv4.may-fail:                          yes
ipv4.dad-timeout:                       -1 (default)
ipv6.method:                            auto
ipv6.dns:                               --
ipv6.dns-search:                        --
ipv6.dns-options:                       ""
ipv6.dns-priority:                      0
ipv6.addresses:                         --
ipv6.gateway:                           --
ipv6.routes:                            --
ipv6.route-metric:                      -1
ipv6.route-table:                       0 (unspec)
ipv6.ignore-auto-routes:                no
ipv6.ignore-auto-dns:                   no
ipv6.never-default:                     no
ipv6.may-fail:                          yes
ipv6.ip6-privacy:                       -1 (unknown)
ipv6.addr-gen-mode:                     stable-privacy
ipv6.dhcp-duid:                         --
ipv6.dhcp-send-hostname:                yes
ipv6.dhcp-hostname:                     --
ipv6.token:                             --
gsm.number:                             *99#
gsm.username:                           --
gsm.password:                           <hidden>
gsm.password-flags:                     0 (none)
gsm.apn:                                --
gsm.network-id:                         --
gsm.pin:                                <hidden>
gsm.pin-flags:                          0 (none)
gsm.home-only:                          no
gsm.device-id:                          --
gsm.sim-id:                             --
gsm.sim-operator-id:                    --
gsm.mtu:                                auto
proxy.method:                           none
proxy.browser-only:                     no
proxy.pac-url:                          --
proxy.pac-script:                       --
Zeta_Gundam ()
Ответ на: комментарий от Zeta_Gundam

Я не читал https://bugzilla.redhat.com/show_bug.cgi?id=1289523, просто поделюсь ссылкой. Просто времени реально нет сейчас разбираться, только вполз домой и вставать в 4-ре, щас спать лягу, посмотрю на днях если сам не решишь. Сам обычно делаю автостарт через PPP без иксов, а в иксах стартует нормально. Но ради спортивного интереса надо сделать, не юнит же писать, чтобы дергать NM.

mandala ★★★★ ()
Ответ на: комментарий от mandala

Тут симптомы немного другие, у чувака соединение не поднимается даже когда он сам его запускает.

Идея с юнитом мне самому уже начинает казаться не такой бредовой. Железка должна работать на местности максимально автономно, ехать к ней поднимать упавший интернет слишком далеко.

Zeta_Gundam ()
Ответ на: комментарий от Zeta_Gundam

Так, у меня то коннектится сейчас только при логине, так что я зря даже выкладывал свои параметры. Попробуй поискать как NM автоконнектится к вафле без логина пользователя, это более частый юзкейс – может быстрее найдешь. Сделаешь тогда по аналогии.

mandala ★★★★ ()

Наконец-то нагуглил, месяц назад сообщали о похожей проблеме — NetworkManager после первого сбоя больше не пытается подключиться:

https://www.mail-archive.com/networkmanager-list@gnome.org/msg28290.html

Движения по теме с тех пор не было, как я понимаю.

Вообще я подозреваю, что NM ориентируется на состояние устройства, когда перестает подключаться. Вся драма происходит в этих строках:

Nov 25 20:21:53 ct-10 ModemManager[497]: <info>  Modem /org/freedesktop/ModemManager1/Modem/0: state changed (enabled -> connecting)
Nov 25 20:21:53 ct-10 ModemManager[497]: <warn>  Couldn't find associated cdc-wdm port for 'net/wwx001e101f0000'
Nov 25 20:21:53 ct-10 ModemManager[497]: <info>  Modem /org/freedesktop/ModemManager1/Modem/0: state changed (connecting -> unknown)
Nov 25 20:21:53 ct-10 NetworkManager[528]: <info>  [1574713313.0222] modem["ttyUSB0"]: modem state changed, 'enabled' --> 'connecting' (reason: user-requested)
Nov 25 20:21:53 ct-10 NetworkManager[528]: <info>  [1574713313.0251] modem["ttyUSB0"]: modem state changed, 'connecting' --> 'unknown' (reason: user-requested)
Nov 25 20:21:53 ct-10 NetworkManager[528]: <info>  [1574713313.0254] device (ttyUSB0): state change: prepare -> disconnected (reason 'user-requested', sys-iface-state: 'managed')
Nov 25 20:21:53 ct-10 ModemManager[497]: <info>  Modem /org/freedesktop/ModemManager1/Modem/0: 3GPP Registration state changed (registering -> home)
Nov 25 20:21:53 ct-10 ModemManager[497]: <info>  Modem /org/freedesktop/ModemManager1/Modem/0: state changed (unknown -> registered)
Nov 25 20:21:53 ct-10 NetworkManager[528]: <info>  [1574713313.0662] modem["ttyUSB0"]: modem state changed, 'unknown' --> 'registered' (reason: unknown)

Zeta_Gundam ()
Последнее исправление: Zeta_Gundam (всего исправлений: 1 )
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.