Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions default/systemd/network/15-ipheth.network
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Deprioritize iPhone USB tethering below Wi-Fi so plugging in an iPhone
# to charge does not hijack the default route.
#
# ipheth is the Linux kernel driver specific to iPhone USB Ethernet.
# Without this drop-in, the iPhone matches /etc/systemd/network/20-ethernet.network
# (which catches eth*/en*) and gets RouteMetric=100 — beating Wi-Fi (600) and
# taking over the default route the moment the phone hands out a DHCP lease.
#
# This file sorts before 20-ethernet.network lexically, so systemd-networkd
# matches it first for any interface whose driver is ipheth. Setting
# RouteMetric=700 keeps Wi-Fi primary when both are up. If Wi-Fi drops, the
# iPhone route automatically takes over.

[Match]
Driver=ipheth

[Link]
RequiredForOnline=no

[Network]
DHCP=yes

[DHCPv4]
RouteMetric=700

[IPv6AcceptRA]
RouteMetric=700
5 changes: 5 additions & 0 deletions install/config/hardware/network.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ sudo systemctl enable iwd.service
# Prevent systemd-networkd-wait-online timeout on boot
sudo systemctl disable systemd-networkd-wait-online.service
sudo systemctl mask systemd-networkd-wait-online.service

# Deprioritize iPhone USB tethering below Wi-Fi so plugging in an iPhone
# to charge does not hijack the default route.
Comment thread
alansikora marked this conversation as resolved.
sudo mkdir -p /etc/systemd/network
sudo cp ~/.local/share/omarchy/default/systemd/network/15-ipheth.network /etc/systemd/network/
5 changes: 5 additions & 0 deletions migrations/1777042493.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
echo "Deprioritize iPhone USB tethering below Wi-Fi so plugging in an iPhone to charge does not hijack the default route"

Comment thread
alansikora marked this conversation as resolved.
sudo mkdir -p /etc/systemd/network
sudo cp $OMARCHY_PATH/default/systemd/network/15-ipheth.network /etc/systemd/network/
sudo networkctl reload 2>/dev/null || sudo systemctl reload systemd-networkd 2>/dev/null || true