| ... | @@ -46,12 +46,14 @@ in | ... | @@ -46,12 +46,14 @@ in |
| 46 | cniVersion = "1.0.0"; | 46 | cniVersion = "1.0.0"; |
| 47 | name = "sandbox"; | 47 | name = "sandbox"; |
| 48 | plugins = [ | 48 | plugins = [ |
| | 49 | { type = "loopback"; } |
| 49 | { type = "bridge"; bridge = "sandbox0"; isGateway = true; ipMasq = true; ipam = { type = "host-local"; ranges = [ [ { subnet = "10.89.0.0/24"; } ] ]; routes = [ { dst = "0.0.0.0/0"; } ]; }; } | 50 | { type = "bridge"; bridge = "sandbox0"; isGateway = true; ipMasq = true; ipam = { type = "host-local"; ranges = [ [ { subnet = "10.89.0.0/24"; } ] ]; routes = [ { dst = "0.0.0.0/0"; } ]; }; } |
| 50 | { type = "portmap"; capabilities.portMappings = true; snat = true; } | 51 | { type = "portmap"; capabilities.portMappings = true; snat = true; } |
| 51 | ]; | 52 | ]; |
| 52 | }; | 53 | }; |
| 53 | services.nomad.settings.client.cni_path = "${pkgs.cni-plugins}/bin"; | 54 | services.nomad.settings.client.cni_path = "${pkgs.cni-plugins}/bin"; |
| 54 | services.nomad.settings.client.cni_config_dir = "/etc/cni/net.d"; | 55 | services.nomad.settings.client.cni_config_dir = "/etc/cni/net.d"; |
| | 56 | systemd.services.nomad.restartTriggers = [ config.environment.etc."cni/net.d/sandbox.conflist".source ]; |
| 55 | networking.firewall.interfaces.sandbox0.allowedTCPPorts = [ 15432 ]; | 57 | networking.firewall.interfaces.sandbox0.allowedTCPPorts = [ 15432 ]; |
| 56 | networking.firewall.extraStopCommands = '' | 58 | networking.firewall.extraStopCommands = '' |
| 57 | iptables -t raw -D PREROUTING -i sandbox0 -j sandbox-egress 2>/dev/null || true | 59 | iptables -t raw -D PREROUTING -i sandbox0 -j sandbox-egress 2>/dev/null || true |