Use 10.106.0.0/24 subnet to avoid collisions
The 106 byte is the code for 'j' (jungle) in ASCII: % printf j | od -t d 0000000 106 0000001 Reviewed-by: Aleix Roca Nonell <aleix.rocanonell@bsc.es>
This commit is contained in:
parent
2fe84c4cbc
commit
52380eae59
@ -12,7 +12,7 @@
|
|||||||
networking.wireguard.interfaces = {
|
networking.wireguard.interfaces = {
|
||||||
# "wg0" is the network interface name. You can name the interface arbitrarily.
|
# "wg0" is the network interface name. You can name the interface arbitrarily.
|
||||||
wg0 = {
|
wg0 = {
|
||||||
ips = [ "10.100.0.30/24" ];
|
ips = [ "10.106.0.30/24" ];
|
||||||
listenPort = 666;
|
listenPort = 666;
|
||||||
privateKeyFile = config.age.secrets.wgApex.path;
|
privateKeyFile = config.age.secrets.wgApex.path;
|
||||||
# Public key: VwhcN8vSOzdJEotQTpmPHBC52x3Hbv1lkFIyKubrnUA=
|
# Public key: VwhcN8vSOzdJEotQTpmPHBC52x3Hbv1lkFIyKubrnUA=
|
||||||
@ -20,7 +20,7 @@
|
|||||||
{
|
{
|
||||||
name = "Fox";
|
name = "Fox";
|
||||||
publicKey = "VfMPBQLQTKeyXJSwv8wBhc6OV0j2qAxUpX3kLHunK2Y=";
|
publicKey = "VfMPBQLQTKeyXJSwv8wBhc6OV0j2qAxUpX3kLHunK2Y=";
|
||||||
allowedIPs = [ "10.100.0.0/24" ];
|
allowedIPs = [ "10.106.0.0/24" ];
|
||||||
endpoint = "fox.ac.upc.edu:666";
|
endpoint = "fox.ac.upc.edu:666";
|
||||||
# Send keepalives every 25 seconds. Important to keep NAT tables alive.
|
# Send keepalives every 25 seconds. Important to keep NAT tables alive.
|
||||||
persistentKeepalive = 25;
|
persistentKeepalive = 25;
|
||||||
@ -30,6 +30,6 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
networking.hosts = {
|
networking.hosts = {
|
||||||
"10.100.0.1" = [ "fox" ];
|
"10.106.0.1" = [ "fox" ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# "wg0" is the network interface name. You can name the interface arbitrarily.
|
# "wg0" is the network interface name. You can name the interface arbitrarily.
|
||||||
wg0 = {
|
wg0 = {
|
||||||
# Determines the IP address and subnet of the server's end of the tunnel interface.
|
# Determines the IP address and subnet of the server's end of the tunnel interface.
|
||||||
ips = [ "10.100.0.1/24" ];
|
ips = [ "10.106.0.1/24" ];
|
||||||
|
|
||||||
# The port that WireGuard listens to. Must be accessible by the client.
|
# The port that WireGuard listens to. Must be accessible by the client.
|
||||||
listenPort = 666;
|
listenPort = 666;
|
||||||
@ -27,20 +27,20 @@
|
|||||||
name = "Apex";
|
name = "Apex";
|
||||||
publicKey = "VwhcN8vSOzdJEotQTpmPHBC52x3Hbv1lkFIyKubrnUA=";
|
publicKey = "VwhcN8vSOzdJEotQTpmPHBC52x3Hbv1lkFIyKubrnUA=";
|
||||||
# List of IPs assigned to this peer within the tunnel subnet. Used to configure routing.
|
# List of IPs assigned to this peer within the tunnel subnet. Used to configure routing.
|
||||||
allowedIPs = [ "10.100.0.30/32" ];
|
allowedIPs = [ "10.106.0.30/32" ];
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.hosts = {
|
networking.hosts = {
|
||||||
"10.100.0.30" = [ "apex" ];
|
"10.106.0.30" = [ "apex" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.firewall = {
|
networking.firewall = {
|
||||||
extraCommands = ''
|
extraCommands = ''
|
||||||
# Accept slurm connections to slurmd from apex (via wireguard)
|
# Accept slurm connections to slurmd from apex (via wireguard)
|
||||||
iptables -A nixos-fw -p tcp -i wg0 -s 10.100.0.30/32 -d 10.100.0.1/32 --dport 6818 -j nixos-fw-accept
|
iptables -A nixos-fw -p tcp -i wg0 -s 10.106.0.30/32 -d 10.106.0.1/32 --dport 6818 -j nixos-fw-accept
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -15,9 +15,9 @@
|
|||||||
iptables -A nixos-fw -p tcp -s 10.0.40.0/24 --dport 60000:61000 -j nixos-fw-accept
|
iptables -A nixos-fw -p tcp -s 10.0.40.0/24 --dport 60000:61000 -j nixos-fw-accept
|
||||||
|
|
||||||
# Accept slurm connections to controller from fox (via wireguard)
|
# Accept slurm connections to controller from fox (via wireguard)
|
||||||
iptables -A nixos-fw -p tcp -i wg0 -s 10.100.0.1/32 --dport 6817 -j nixos-fw-accept
|
iptables -A nixos-fw -p tcp -i wg0 -s 10.106.0.1/32 --dport 6817 -j nixos-fw-accept
|
||||||
# Accept slurm connections from fox for srun (via wireguard)
|
# Accept slurm connections from fox for srun (via wireguard)
|
||||||
iptables -A nixos-fw -p tcp -i wg0 -s 10.100.0.1/32 --dport 60000:61000 -j nixos-fw-accept
|
iptables -A nixos-fw -p tcp -i wg0 -s 10.106.0.1/32 --dport 60000:61000 -j nixos-fw-accept
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user