aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md25
1 files changed, 20 insertions, 5 deletions
diff --git a/README.md b/README.md
index 422d100..5b81928 100644
--- a/README.md
+++ b/README.md
@@ -31,12 +31,26 @@ imports = [
that many tap devices. This sets up a bridge `fcbr0` (172.16.0.1/24,
and fdfc:fc::1/64) with the taps, DHCP and DNS for the guests, the egress proxy, and
nftables rules that keep the guests from reaching anything else, on the
-host, beyond, or each other. Each tap has a fixed address, and the bridge
-drops anything a guest sends from another, so the proxy knows whose a
-connection is. It needs `networking.nftables` (and enables it).
+host, beyond, or each other. Each running VM has a fixed address, and
+the bridge drops anything a guest sends from another, so the proxy knows
+whose a connection is. It needs `networking.nftables` (and enables it).
Optional arguments:
+- `vms`: static addresses for VMs, by name and user (172.16.0.2 to .254),
+ e.g. for the host to reach them with a reverse proxy:
+ `vms = { hermes = { user = "tv"; ip = "172.16.0.2"; }; };`. Any
+ number of them; the user's VM of that name (`--name hermes`) gets its
+ address on whichever of the user's taps it runs, so at most as many of
+ them run at the same time as the user has taps. Taps have addresses of
+ their own, for VMs without one: from 172.16.0.200 on, so they stand
+ out (but for VMs' there; at most 55 taps in all). The VMs'
+ addresses are also in `config.fc.vms.NAME` (`user`, `ip`, `ip6`):
+
+ ```nix
+ services.nginx.virtualHosts."hermes.example".locations."/".proxyPass =
+ "http://${config.fc.vms.hermes.ip}:9120";
+ ```
- `proxyPort` (default 10443): where the proxy listens; the guests' port
443 gets redirected there.
- `prefix6` (default `fdfc:fc::`): the guests' IPv6 /64. Each guest
@@ -122,7 +136,8 @@ Who may log in goes in a layer, e.g.:
{ users.users.root.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAA..." ]; }
```
-A guest on tap fctapN is 172.16.0.(N+2) (see `fc-egress vms`).
+A guest's address is its VM's, by name (`vms`, see host setup), or else
+its tap's own (see `fc-egress vms`).
The guest's system can be built in layers, each a NixOS module on top of
the ones before (the first on top of the base system):
@@ -175,7 +190,7 @@ named like the VM, else (no name) `default`:
fc-egress -l box allow https://cache.nixos.org
./result/bin/run-firecracker-vm --name box # list box
./result/bin/run-firecracker-vm --name box2 --egress box # list box, too
-fc-egress vms # running VMs: tap (as in the log), name, list
+fc-egress vms # running VMs: tap (as in the log), address, name, list
fc-egress -v box allow https://example.org # the list box uses
fc-egress use box default # switch box to another list
```