summaryrefslogtreecommitdiff
path: root/hosts/kay
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2024-01-05 10:53:05 +0530
committersinanmohd <sinan@sinanmohd.com>2024-01-05 11:07:35 +0530
commitfa2c193c95511edb529e22b21a365beae82336fa (patch)
tree86fe5572dfeab5976d829b4535e190e81c4febb9 /hosts/kay
parent82e8629c0dd9bcd1f23064999fb2b9dad323bac2 (diff)
kay/network/he: fix routing issue after ip change
Diffstat (limited to 'hosts/kay')
-rw-r--r--hosts/kay/modules/hurricane.nix10
1 files changed, 8 insertions, 2 deletions
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
'';
};
}