Compare commits

...

4 commits

Author SHA1 Message Date
127cd52258 typo 2023-09-04 18:31:40 +00:00
caf5b4291e sources 2023-09-04 17:51:17 +00:00
b3c23d1621 I don't think we need those two bits 2023-09-04 17:50:43 +00:00
5820e7e257 routing for second interface 2023-09-04 17:49:33 +00:00

View file

@ -81,4 +81,30 @@ in {
name = name; name = name;
}; };
}; };
# from https://discourse.nixos.org/t/second-default-gateway/22220/5 and https://www.thomas-krenn.com/en/wiki/Two_Default_Gateways_on_One_System
networking = {
iproute2 = {
enable = true;
rttablesExtraConfig =
''1 rt2'';
};
};
systemd.services.secondGateway = {
description = "External route.";
path = [pkgs.bash pkgs.iproute];
script = ''
ip route add 193.1.96.160/28 dev eth1 src 193.1.96.165 table rt2
ip route add default via 193.1.96.161 dev eth1 table rt2
ip rule add from 193.1.96.165/28 table rt2
ip rule add to 193.1.96.165/28 table rt2
'';
serviceConfig = {
Type= "oneshot";
User = "root";
Restart = "no";
};
};
} }