aboutsummaryrefslogtreecommitdiffstats
path: root/host.nix
blob: 33686777ff7d2b86c5bfbda8da54520802fd247d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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" ];
  };
}