From fa2c193c95511edb529e22b21a365beae82336fa Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Fri, 5 Jan 2024 10:53:05 +0530 Subject: kay/network/he: fix routing issue after ip change --- hosts/kay/modules/hurricane.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'hosts/kay') diff --git a/hosts/kay/modules/hurricane.nix b/hosts/kay/modules/hurricane.nix index 272f120..3630a01 100644 --- a/hosts/kay/modules/hurricane.nix +++ b/hosts/kay/modules/hurricane.nix @@ -67,7 +67,7 @@ in services.pppd.script."02-${iface}" = { - runtimeInputs = with pkgs; [ curl coreutils iproute2 ]; + runtimeInputs = with pkgs; [ curl coreutils iproute2 iputils ]; text = '' wan_ip="$4" username="$(cat ${config.sops.secrets."hurricane/username".path})" @@ -80,10 +80,16 @@ in done while [ ! -e /sys/class/net/${iface} ]; do - sleep 1 # make sure ${iface} is up + sleep 1 # make sure ${iface} is up done ip tunnel change ${iface} local "$wan_ip" mode sit + + # for unknown reason gateway don't seems to know where to route + # incoming traffic if we do not ping the gateway after ip change + while ! ping -c1 ${gateway}; do + sleep 1 + done ''; }; } -- cgit v1.2.3