Re: raw-ip modem questions
Tor Rune Skoglund
Wed Apr 22 11:20:15 2020
Hi Roy,
Den 21.04.2020 20:54, skrev Roy Marples:
On 21/04/2020 16:14, Tor Rune Skoglund wrote:
there is a --dhcp option to dhcpcd which seems to be needed when
using raw-ip with qmi modems. I have systems who are being moved from
802-3 to raw-ip, since newer modems seem to lack support for 802-3.
To keep the setup as generic as possible, we still would like to use
dhcpcd without having to define too many details about the actual
type of modem on beforehand. Hence, for gms modems using qmi and
raw-ip, ideally we would like to just run dhcpcd in the background
and it should "just work" when the modem connects, much as when using
802-3 (except for a -HUP to dhcpcd).
The *only* way I am able to get dhcpcd to work is by running "dhcpcd
--dhcp -z wwp*". That always works.
However, it never works if dhcpcd is already running in the
background, no matter if it was started with --dhcp or not, and no
matter if the config file's allowinterfaces includes ww*.
So my questions are:
- What does --dhcp actually do in this case? man dhcpcd (at least on
my system) does not document the --dhcp option.
dhcpcd.conf(5) does :)
Ah! :)
- What am I doing wrong...? Kindof out of clues now. :)
ip a on wwan, before after the ip address is set:
5: wwp0s20u5u1i8: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500
qdisc pfifo_fast state UNKNOWN group default qlen 1000
link/none
inet 10.214.215.169/30 brd 10.214.215.171 scope global dynamic
noprefixroute wwp0s20u5u1i8
valid_lft 6868sec preferred_lft 5968sec
These are minimalistic systems using OpenRC and no NetworkManager nor
ModemManager. Kernel is 4.9. dhcpcd is 8.1.7 from Gentoo. udhcpc
works on the same system.
I presume this is too little info to be able to pinpoint the issue,
but any hints are appreciated. Thanks!
So by default, dhcpcd won't work on POINTOPOINT interfaces without
some kind of config.
putting this at the top of /etc/dhcpcd.conf might fix it for you:
allowinterfaces wwp*
I just tried this, and still to no avail. Here's the test case. The
starting point is a newly booted system with dhcpcd running in the
background. enp1s0 (cable) has received an ip address, and wwp* not - as
expected - since the mobile connection is not started yet.
head -n 10 /etc/dhcpcd.conf
# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.
# ww* is disabled from P2P by default. Also, need to add other interfaces as
# they will not be enabled by default when allowinterfaces is present.
allowinterfaces ww* en* wl*
# Trying to enable dhcp for all interfaces globally. Does not seem to
work? Needs to be set per interface?
dhcp
# Setting it on the interface directly for testing. (Problem for later:
We do not necessarily know the interface name on beforehand.)
tail -n 4 /etc/dhcpcd.conf
interface wwp0s20u5u1i8
dhcp
# Taking link down to be able to switch to raw-ip
ip link set dev wwp0s20u5u1i8 down
# Switching system to raw-ip
qmicli -d /dev/cdc-wdm0 --set-expected-data-format=raw-ip -p
[/dev/cdc-wdm0] expected data format set to: raw-ip
# Making sure that the card is in raw-ip mode
qmicli -d /dev/cdc-wdm0 --wda-get-data-format -p
[/dev/cdc-wdm0] Successfully got data format
QoS flow header: no
Link layer protocol: 'raw-ip'
Uplink data aggregation protocol: 'disabled'
Downlink data aggregation protocol: 'disabled'
NDP signature: '0'
Uplink data aggregation max size: '0'
Downlink data aggregation max size: '0'
# Starting the network
qmicli -d /dev/cdc-wdm0 --wds-start-network=ip-type=4 -p
--client-no-release-cid
[/dev/cdc-wdm0] Network started
Packet data handle: '1137719400'
[/dev/cdc-wdm0] Client ID not released:
Service: 'wds'
CID: '9'
# Checking that it did connect
qmicli -d /dev/cdc-wdm0 --wds-get-current-settings -p
[/dev/cdc-wdm0] Current settings retrieved:
IP Family: IPv4
IPv4 address: 10.214.215.169
IPv4 subnet mask: 255.255.255.252
IPv4 gateway address: 10.214.215.170
IPv4 primary DNS: 193.213.112.4
IPv4 secondary DNS: 130.67.15.198
MTU: 1430
Domains: none
# Up'ing the interface again
ip link set dev wwp0s20u5u1i8 up
Messages in syslog when doing that:
Apr 22 09:37:21 platform dhcpcd[2221]: wwp0s20u5u1i8: carrier acquired
Apr 22 09:37:21 platform dhcpcd[2221]: wwp0s20u5u1i8: IAID 9a:60:5f:91
Apr 22 09:37:22 platform dhcpcd[2221]: wwp0s20u5u1i8: soliciting a DHCP
lease
And that's it. At this point, I would have expected the interface to
receive the address.
However, when running the same procedure *without* dhcpcd already
running in the background, and then running:
dhcpcd wwp0s20u5u1i8
DUID 00:01:00:01:1a:82:6f:53:08:00:27:00:9e:58
wwp0s20u5u1i8: IAID 00:00:00:05
wwp0s20u5u1i8: soliciting a DHCP lease
wwp0s20u5u1i8: offered 10.214.215.169 from 10.214.215.170
wwp0s20u5u1i8: leased 10.214.215.169 for 7200 seconds
wwp0s20u5u1i8: adding route to 10.214.215.168/30
wwp0s20u5u1i8: adding default route via 10.214.215.170
forked to background, child pid 6814
works.
Any suggestions what I might be doing wrong? In dhcpcd.conf we have
xidhwaddr and noipv4ll enabled in addition to Gentoo's defaults.
BR, Tor Rune Skoglund
Archive administrator: postmaster@marples.name