{ addr = wg-intra-peers.${hostName}.ipv4; port = 22; }
];
};
-networking.firewall.extraCommands = lib.mkIf config.services.openssh.enable ''
- ip46tables -A nixos-fw -i wg-intra -p tcp -m tcp --dport 22 -j ACCEPT
-'';
-systemd.services.sshd.after = ["wireguard-wg-intra.service"];
+
+environment.etc."NetworkManager/dispatcher.d/congctl" = {
+ mode = "700";
+ source = pkgs.writeShellScript "congctl" ''
+ case $NM_DISPATCHER_ACTION in
+ up)
+ case $DEVICE_IP_IFACE in
+ # WLAN or WWAN
+ # https://en.wikipedia.org/wiki/TCP_congestion_control#TCP_Westwood+
+ wl*|ww*)
+ ip route show dev $DEVICE_IP_IFACE |
+ while read -r route; do
+ ip route change $route dev $DEVICE_IP_IFACE congctl westwood
+ done
+ ip r >>/tmp/log
+ ;;
+ esac
+ ;;
+ esac
+ '';
+};
}