Score:1

Applying initcwn/ initrwnd to routes from DHCP

cw flag

I am using Amazon Linux 2023 (which is based on Fedora and uses systemd-networkd for DHCP).

ip route show shows routes like default via 10.0.0.1 dev enX0 proto dhcp src 10.0.0.211 metric 1024

I would like to have "initcwnd 50 initrwnd 50" applied to that route. I can do this via ip route change. This works until my lease expires. When DHCP renews it, I end up with a second (duplicate) default route.

I can create a conf file in /etc/systemd/network/ with contents like

[Match]
Name=enX0

[Network]
DHCP=yes

[Route]
Gateway=10.0.0.1
InitialCongestionWindow=50
InitialAdvertisedReceiveWindow=50
Metric=100

, but this still ends up duplicating routes or forcing me to hardcode things about them that should be configured dynamically with DHCP.

I would like my system to get routes and configuration from DHCP like it does today, but to keep my initcwn/ initrwnd values applied at all times. Is this possible?

Score:0
by flag

Yes, you could run a script after DHCP is renewed, first create a network dispatcher script directory

sudo mkdir -p /etc/systemd/network

then we will create a costum script to modify the route after DHCP renewal, create this file

sudo nano /etc/systemd/network/10-custom-route-settings.network

then add this inside

[Match]
Name=enX0

[Network]
DHCP=yes

[DHCP]
RouteMetric=100

[Route]
Gateway=_dhcp4_gateway
Destination=default
InitialCongestionWindow=50
InitialAdvertisedReceiveWindow=50

save and close then finaly we can restart systemd-networkd

sudo systemctl restart systemd-networkd
Bobby Impollonia avatar
cw flag
Thanks @Saxtheowl . Are you sure that script location is relevant for systemd-networkd ? I'm looking into and it seems like it might be for NetworkManager. (FWIW, I tried to upvote you, but apparently I don't have enough reputation to do so)
Saxtheowl avatar
by flag
yup, I modified my answer, you can just accept it if it fixed your problem.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.