Commit Graph

21 Commits

Author SHA1 Message Date
Michael Tremer
8d09028b69 network: Force dhcpcd to ask for an IP address
So since all this static nonsense wasn't feeling right, I opened a
ticket upstream and got a lead how to actually get some proper DHCP
working.

  https://github.com/NetworkConfiguration/dhcpcd/issues/129

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-12-17 17:20:46 +00:00
Michael Tremer
86ba5ce316 dhcpcd.exe: Add a safety net to make sure we always have a route
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-12-17 17:20:46 +00:00
Michael Tremer
ece96c6f56 dhcpcd.exe: Ignore some events
We don't want any log messages printed.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-12-17 17:20:46 +00:00
Michael Tremer
e3da491238 dhcpcd.exe: Reformat the reason dispatcher
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-12-17 17:20:46 +00:00
Michael Tremer
cb4b6f433e dhcpcd.exe: Fix typo in configuring DNS server
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-12-17 17:20:46 +00:00
Michael Tremer
c2e2c2824a dhcpcd.exe: Run everything no matter how RED is configured
This could potentially create problems when we abuse these functions to
launch the DHCP client on IPTV interfaces. This would have to be tested
and confirmed or potentially we would need some more changes to keep
supporting that use-case, too.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-12-17 17:20:46 +00:00
Michael Tremer
7a67f77f10 dhcpcd.exe: Only touch /var/ipfire/red/active once
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-12-17 17:20:46 +00:00
Michael Tremer
4ffd18a774 dhcpcd.exe: Do not overwrite the default gateway when empty
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-12-17 17:20:46 +00:00
Michael Tremer
ccf36e9e8c dhcpcd.exe: Use DNS servers from QMI
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-12-17 17:20:46 +00:00
Michael Tremer
261727435d dhcpcd.exe: Store the default gateway when in QMI mode
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-12-17 17:20:46 +00:00
Michael Tremer
36914cce70 dhcpcd.exe: Only set gateway when we have received one
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-12-17 17:20:46 +00:00
Michael Tremer
11f6226f65 dhcpcd.exe: Actually use the received MTU
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-12-17 17:20:46 +00:00
Michael Tremer
a22e3c8ec7 dhcpcd.exe: Flush any configured IP addresses on shutdown
This allows us to start with a fresh interface every time dhcpcd is
being restarted.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-12-17 17:20:46 +00:00
Michael Tremer
957863f754 network: Add support for QMI modems
QMI is a proprietary interface from Qualcomm which are absolute pioneers
when it comes to interfacing with modems. I don't think there would be
any way to make this any more complicated and bloated.

So, bascially we will put the modem into a raw IP mode which changes the
interface into Point-to-Point mode.

We then configure the provider settings using qmicli. After that, the
modem will try to connect to the provider and obtain an IP address.

We will then start a DHCP client which does not do any DHCP-ing because
implementing that would be too complicated. Instead we do something even
*more* complicated where we would launch a custom script which asks the
modem for the allocated IP address and will configure it into the
device. The DHCP client then reads that IP address from the device and
pretends it came up with it by itself. Such an easy way to do this.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-12-17 17:20:45 +00:00
Michael Tremer
33d2aa6d02 dhcpcd.exe: Allow using the DHCP setup scripts when RED is not configured as DHCP
This is useful for dial-up methods that use DHCP, but when RED_TYPE is
configured as PPP.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-12-17 17:20:45 +00:00
Michael Tremer
177ec16705 dhcpcd: Log any unhandled client events
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-12-17 17:20:45 +00:00
Peter Müller
66c3619872 Early spring clean: Remove trailing whitespaces, and correct licence headers
Bumping across one of our scripts with very long trailing whitespaces, I
thought it might be a good idea to clean these up. Doing so, some
missing or inconsistent licence headers were fixed.

There is no need in shipping all these files en bloc, as their
functionality won't change.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-02-18 23:54:57 +00:00
Michael Tremer
1434fa0df5 DNS: Write name servers received from ISP to /var/run/dns{1,2}
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-01-07 13:35:45 +00:00
Arne Fitzenreiter
bedfda83c9 dhcpcd.exe: remove red.down run on "NOCARRIER"
after "NOCARRIER" the dhcp client always run "EXPIRE" event.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-12-01 18:33:19 +01:00
Arne Fitzenreiter
455291f90e 70-dhcpdd.exe: don't run red.down scripts at "PREINIT"
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-12-01 14:43:49 +01:00
Jonatan Schlag
629fcb1d47 Move network initscripts to src/initscripts/networking
Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
2017-02-22 11:57:20 +01:00