aboutsummaryrefslogtreecommitdiffstats
path: root/host.nix
diff options
context:
space:
mode:
Diffstat (limited to 'host.nix')
-rw-r--r--host.nix15
1 files changed, 15 insertions, 0 deletions
diff --git a/host.nix b/host.nix
new file mode 100644
index 0000000..3368677
--- /dev/null
+++ b/host.nix
@@ -0,0 +1,15 @@
+# Host side of the guest's network: a tap device owned by the user running
+# the VM, NATed to the outside world.
+# usage (in the host's configuration.nix): imports = [ (import ./host.nix "tv") ];
+user: {
+ networking.interfaces.fctap0 = {
+ virtual = true;
+ virtualType = "tap";
+ virtualOwner = user;
+ ipv4.addresses = [{ address = "172.16.0.1"; prefixLength = 24; }];
+ };
+ networking.nat = {
+ enable = true;
+ internalInterfaces = [ "fctap0" ];
+ };
+}