summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2018-04-22 13:35:08 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2018-04-22 13:35:08 +0200
commit2ab67e4cff78ecf6c7f38d55838886033fe57520 (patch)
tree8f8bf5e809787473e038da7cfce33979167b80d6
parent993c1e0bc89d13a6ac6d93385b190851d731d96b (diff)
downloadnixos-2ab67e4cff78ecf6c7f38d55838886033fe57520.tar
nixos-2ab67e4cff78ecf6c7f38d55838886033fe57520.tar.gz
nixos-2ab67e4cff78ecf6c7f38d55838886033fe57520.tar.bz2
nixos-2ab67e4cff78ecf6c7f38d55838886033fe57520.tar.xz
nixos-2ab67e4cff78ecf6c7f38d55838886033fe57520.zip
nat on bragi
-rw-r--r--bragi.nix61
1 files changed, 50 insertions, 11 deletions
diff --git a/bragi.nix b/bragi.nix
index c490e6b6..2e66e504 100644
--- a/bragi.nix
+++ b/bragi.nix
@@ -43,15 +43,22 @@ in rec {
43 }; 43 };
44 44
45 interfaces.eth = { 45 interfaces.eth = {
46 proxyARP = true;
47 useDHCP = false; 46 useDHCP = false;
47 ipv4.addresses = [
48 { address = "10.141.4.1"; prefixLength = 24; }
49 ];
48 }; 50 };
49 51
50 interfaces.wlp4s0 = { 52 interfaces.wlp4s0 = {
51 proxyARP = true;
52 useDHCP = true; 53 useDHCP = true;
53 }; 54 };
54 55
56 nat = {
57 enable = true;
58 externalInterface = "wlp4s0";
59 internalInterfaces = [ "eth" ];
60 };
61
55 firewall.enable = false; 62 firewall.enable = false;
56 63
57 defaultMailServer = { 64 defaultMailServer = {
@@ -62,14 +69,46 @@ in rec {
62 }; 69 };
63 }; 70 };
64 71
65 systemd.services."dhcp-helper" = { 72 services.radvd = {
66 serviceConfig = { 73 enable = true;
67 ExecStart = '' 74 config = ''
68 ${pkgs.callPackage ./custom/dhcp-helper.nix {}}/bin/dhcp-helper -b wlp4s0 -n 75 interface eth {
69 ''; 76 AdvSendAdvert on;
70 }; 77 MinRtrAdvInterval 3;
71 78 MaxRtrAdvInterval 10;
72 wantedBy = [ "network.target" ]; 79
80 prefix ffff:ffff:ffff:ffff::/64 {
81 Base6Interface eth;
82
83 AdvOnLink on;
84 AdvAutonomous on;
85 # AdvRouterAddr on;
86 };
87 };
88
89 interface wlp4s0 {
90 AdvSendAdvert on;
91 MinRtrAdvInterval 3;
92 MaxRtrAdvInterval 10;
93
94 prefix ffff:ffff:ffff:ffff::/64 {
95 Base6Interface eth;
96
97 AdvOnLink on;
98 AdvAutonomous on;
99 # AdvRouterAddr on;
100 };
101 };
102 '';
103 };
104
105 services.dhcpcd = {
106 enable = true;
107 extraConfig = ''
108 interface wlp4s0
109 ipv6rs
110 ia_pd 1/::/64 eth/0/64
111 '';
73 }; 112 };
74 113
75 nixpkgs = { 114 nixpkgs = {