Open zabbal opened 3 years ago
I'd also like to have such an integration. Afaik NetworkManager is the only way to do the configuration automatically right now.
@zabbal Could you provide wwan.network you currently manually create? I'd like to know what kind of information should be obtained from ModemManager.
@yuwata the basic one as outlined in mmcli -b 3
output above - something like:
[Match]
Name=wwan0
[Network]
Description=APN is test-internet.myapn
Address=10.10.42.234/30
Gateway=10.10.42.24
DNS=8.8.8.8,8.8.4.4
[Link]
RequiredForOnline=no
See https://www.freedesktop.org/software/ModemManager/man/latest/mmcli.1.html for more details.
I am not familiar with WWAN devices and ModemManager. But IIUC, ModemManager only retrieves address, gateway, DNS, and etc., provided by an internet provider, but not assign them. And the information is exposed through DBus. Is it true?
I guess wwan0 or so is created dynamically when connection is established. If that is true, then I think it is better to introduce new condition APN=
in [Match]
section. WDYT?
I am not familiar with WWAN devices and ModemManager. But IIUC, ModemManager only retrieves address, gateway, DNS, and etc., provided by an internet provider, but not assign them. And the information is exposed through DBus. Is it true?
Yes. That's correct.
I guess wwan0 or so is created dynamically when connection is established.
Yes.
If that is true, then I think it is better to introduce new condition
APN=
in[Match]
section. WDYT?
Good idea. Would be a nice to have match criteria for setups with multiple wwan connections. Nevertheless the biggest advantage would be if systemd-networkd would be able to receive the ip parameters via dbus and apply them on the interface.
@benibr Thanks.
ModemManager only retrieves address, gateway, DNS, and etc., provided by an internet provider, but not assign them.
Yes, exactly - the NetworkManager does that.
And the information is exposed through DBus. Is it true?
Precisely - that's what mmcli tool does.
Would be great to be able to replace NetworkManager with systemd-networkd.
The tricky thing which I don't understand yet is how to find the proper moment to assign the address etc - perhaps there's dbus signal from ModemManager which we could listen to?
@zabbal I look around a bit with d-feet and dbus-monitor. I guess it would make sense to wait until ModemManager announces a Bearer then wait for a PropertyChanged with the bool Connected=True
.
Sadly it looks like the the APN must be fetched seperatly, it's not in the connected message. But the IP config is
Example from dbus-monitor:
signal time=1629208586.362815 sender=:1.9 -> destination=(null destination) serial=406 path=/org/freedesktop/ModemManager1/Bearer/0; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
string "org.freedesktop.ModemManager1.Bearer"
array [
dict entry(
string "Stats"
variant array [
dict entry(
string "duration"
variant uint32 0
)
dict entry(
string "rx-bytes"
variant uint64 0
)
dict entry(
string "tx-bytes"
variant uint64 0
)
]
)
dict entry(
string "Ip4Config"
variant array [
dict entry(
string "method"
variant uint32 2
)
dict entry(
string "address"
variant string "10.117.110.168"
)
dict entry(
string "prefix"
variant uint32 16
)
dict entry(
string "dns1"
variant string "62.109.121.17"
)
dict entry(
string "dns2"
variant string "62.109.121.18"
)
dict entry(
string "dns3"
variant string "62.109.121.17"
)
dict entry(
string "gateway"
variant string "10.117.110.1"
)
]
)
dict entry(
string "Interface"
variant string "wwan0"
)
dict entry(
string "Connected"
variant boolean true
)
]
There's 1:1 correspondense between "Bearer" and "APN" in ModemManager. So we can always take bearer number N from that signal and make dbus call equivalent to mmcli -b N
to fetch an APN.
Although it's more of a nice-to-have feature - most users won't use several modems with different APN in parallel.
So, let me confirm. How about the following way?
wwanX
, then call ListBearers() method, and get the Interface property for each bearer, and find corresponding bearer."ip-type"
field in the Properties property to determine IP addressing type.Note, still e.g. mmcli --simple-connect="apn=test-internet.myapn" -m 5
needs to be called by user.
BTW, @zabbal and/or @benibr, could you provide the result of udevadm info /sys/class/net/wwanX
? I'd like to know how to determine the interface is a WWAN interface, as the interface name may be changed arbitrary. I guess, DEVTYPE
or DRIVER
field can be used. But not sure.
Hello @yuwata - I really appreciate your time on this. Here's the output from one machine:
udevadm info /sys/class/net/wwp0s20f0u3i12
P: /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.12/net/wwp0s20f0u3i12
L: 0
E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.12/net/wwp0s20f0u3i12
E: DEVTYPE=wwan
E: INTERFACE=wwp0s20f0u3i12
E: IFINDEX=8
E: SUBSYSTEM=net
E: USEC_INITIALIZED=250009396017
E: ID_NET_NAMING_SCHEME=v250
E: ID_NET_NAME_PATH=wwp0s20f0u3i12
E: ID_VENDOR=Sierra_Wireless__Incorporated
E: ID_VENDOR_ENC=Sierra\x20Wireless\x2c\x20Incorporated
E: ID_VENDOR_ID=1199
E: ID_MODEL=Sierra_Wireless_EM7455_Qualcomm_Snapdragon_X7_LTE-A
E: ID_MODEL_ENC=Sierra\x20Wireless\x20EM7455\x20Qualcomm\x20Snapdragon\x20X7\x20LTE-A
E: ID_MODEL_ID=9079
E: ID_REVISION=0006
E: ID_SERIAL=Sierra_Wireless__Incorporated_Sierra_Wireless_EM7455_Qualcomm_Snapdragon_X7_LTE-A_LF81510625021022
E: ID_SERIAL_SHORT=LF81510625021022
E: ID_TYPE=generic
E: ID_BUS=usb
E: ID_USB_INTERFACES=:020e00:0a0002:
E: ID_USB_INTERFACE_NUM=0c
E: ID_USB_DRIVER=cdc_mbim
E: ID_VENDOR_FROM_DATABASE=Sierra Wireless, Inc.
E: ID_MODEL_FROM_DATABASE=EM7455
E: ID_MM_CANDIDATE=1
E: ID_PATH=pci-0000:00:14.0-usb-0:3:1.12
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_3_1_12
E: ID_NET_DRIVER=cdc_mbim
E: ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link
E: ID_NET_NAME=wwp0s20f0u3i12
E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/wwp0s20f0u3i12
E: TAGS=:systemd:
E: CURRENT_TAGS=:systemd:
And from my work laptop:
udevadm info /sys/class/net/wwan0
P: /devices/pci0000:00/0000:00:1c.0/0000:08:00.0/mhi0/wwan/wwan0/net/wwan0
L: 0
E: DEVPATH=/devices/pci0000:00/0000:00:1c.0/0000:08:00.0/mhi0/wwan/wwan0/net/wwan0
E: DEVTYPE=wwan
E: INTERFACE=wwan0
E: IFINDEX=4
E: SUBSYSTEM=net
E: USEC_INITIALIZED=13764867
E: ID_BUS=pci
E: ID_VENDOR_ID=0x105b
E: ID_MODEL_ID=0xe0ab
E: ID_PCI_CLASS_FROM_DATABASE=Wireless controller
E: ID_VENDOR_FROM_DATABASE=Foxconn International, Inc.
E: ID_MM_CANDIDATE=1
E: ID_PATH=pci-0000:08:00.0
E: ID_PATH_TAG=pci-0000_08_00_0
E: ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link
E: ID_NET_NAME=wwan0
E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/wwan0
E: TAGS=:systemd:
E: CURRENT_TAGS=:systemd:
@dwrz and @dwrz-dbhg Thank you!
@zabbal, @benibr, @dwrz and @dwrz-dbhg, could you also show the result of busctl tree org.freedesktop.ModemManager1
?
└─/org
└─/org/freedesktop
└─/org/freedesktop/ModemManager1
├─/org/freedesktop/ModemManager1/Modem
│ └─/org/freedesktop/ModemManager1/Modem/9
└─/org/freedesktop/ModemManager1/SIM
├─/org/freedesktop/ModemManager1/SIM/18
└─/org/freedesktop/ModemManager1/SIM/19
🙏🏽
└─/org
└─/org/freedesktop
└─/org/freedesktop/ModemManager1
├─/org/freedesktop/ModemManager1/Modem
│ └─/org/freedesktop/ModemManager1/Modem/3
└─/org/freedesktop/ModemManager1/SIM
└─/org/freedesktop/ModemManager1/SIM/3
🙏🏽🙏🏽🙏🏽
Thank you!
Hi all! Could you test PR #22315?
Minor correction on what was discussed here: wwan0
shows up as soon as I plug in the modem onto the host.
Trying to find a bearer when the interface shows up won't work because the bearer is created when modemmanager is instructed to connect. So the bearer can also exist a short while before the connection is established too.
Minor correction on what was discussed here:
wwan0
shows up as soon as I plug in the modem onto the host.Trying to find a bearer when the interface shows up won't work because the bearer is created when modemmanager is instructed to connect. So the bearer can also exist a short while before the connection is established too.
Another note here. The data interface listed in the bearer object MAY be instantiated at runtime while the modem is connected and the bearer object created, so it may not even exist in the system if the modem is disconnected. We do this in ModemManager when multiplexing is enabled, as we can create N net interfaces multiplexed over a single wwan0 in order to connect to N different APNs.
@yuwata do you want me to send you some WWAN devices to test with?
@aleksander0m Oh, thanks. Yes, please if possible. Currently, I have no modem to test this feature. That's why this is stopped to be updated.
Hi all, thanks for the great work you are doing. Is there any news about this integration?
Sorry, not yet. But, I really want to implement that for next release (v253).
@yuwata so, v253 just dropped, and I don't see this feature in the release notes. Is it postponed to v254?
@killermoehre Ah, yeah, unfortunately...
I'm surprised by the lack of interest. It is very important issue.
@yuwata, I would be happy to sponsor your work on this project.
Would you mind contacting me on Twitter (same username) or (username)@gmail.com? I am sure we can arrange a way to purchase some hardware for you!
Just wondering, if there is additional information needed to bring up wwan (like PIN, APN, ... ) what is the expected place to store these in conjunction with this integration?
I'm happy to help with this however needed. I also sent already a modem to play with to @yuwata some time ago, if anyone else needs one, please let me know.
I've been told on IRC that this is the feature to watch to integrate networkd with a PPPoE setup. If so, that would be great. There are a lot of fibre gpon modems (like the Nokia XS-010X-Q) rolling out all of the world for consumers, and they need PPPoE to connect. Would be nice to have simple residential consumer Linux boxes able to use networkd instead of NetworkManager for that. Thanks!
@yuwata Any update on this? Or are other topics more important?
Is your feature request related to a problem? Please describe. Setting up WWAN connection with systemd-networkd is the major hurdle at the moment.
Describe the solution you'd like Ability to specify a new .network or .netdev link type which would talk with ModemManager to establish and properly configure IP interface managed by systemd-networkd
Describe alternatives you've considered Right now we have to resort to scripting and manual output parsing which is cumbersome and error-prone.
The typical WWAN connection bring-up looks as follows:
Now we have to parse the output of the mmcli (or use dbus - whatever) and get the IP address, Gateway and other parameters to generate wwan.network so it can be controlled with systemd-networkd.
Would be way more convenient if systemd-networkd could take care of low-level details and extract that information directly from ModemManager as well as gracefully handle network interruptions etc.
The systemd version you checked that didn't have the feature you are asking for 247