summaryrefslogtreecommitdiff
path: root/Biz/Cloud/Networking.nix
blob: 4c8e058064d0d6f24b3493c7ed612254ffd47d7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{ lib, config, ... }:

let
  ports = {
    ssh = 22;
    http = 80;
    https = 443;
    sabten = 8080;
  };
in {
  networking = {
    firewall = {
      allowedTCPPorts = [
        ports.ssh
        ports.http
        ports.https
        ports.sabten
      ];
    };
    nameservers = [
      "67.207.67.2"
      "67.207.67.3"
    ];
    defaultGateway = "159.89.128.1";
    defaultGateway6 = "2604:a880:2:d0::1";
    dhcpcd.enable = false;
    usePredictableInterfaceNames = lib.mkForce true;
    interfaces = {
      eth0 = {
        ipv4.addresses = [
          { address="159.89.128.69"; prefixLength=20; }
          { address="10.46.0.6"; prefixLength=16; }
        ];
        ipv6.addresses = [
          { address="2604:a880:2:d0::35:c001"; prefixLength = 64; }
          { address="fe80::e899:c0ff:fe9c:e194"; prefixLength = 64; }
        ];
      };
    };
  };
  services.udev.extraRules = ''
    ATTR{address}=="ea:99:c0:9c:e1:94", NAME="eth0"
  '';
}