895bcdd1cb
For example, the following sets up a container named ‘foo’. The container will have a single network interface eth0, with IP address 10.231.136.2. The host will have an interface c-foo with IP address 10.231.136.1. systemd.containers.foo = { privateNetwork = true; hostAddress = "10.231.136.1"; localAddress = "10.231.136.2"; config = { services.openssh.enable = true; }; }; With ‘privateNetwork = true’, the container has the CAP_NET_ADMIN capability, allowing it to do arbitrary network configuration, such as setting up firewall rules. This is secure because it cannot touch the interfaces of the host. The helper program ‘run-in-netns’ is needed at the moment because ‘ip netns exec’ doesn't quite do the right thing (it remounts /sys without bind-mounting the original /sys/fs/cgroups). |
||
---|---|---|
.. | ||
amazon-config.nix | ||
amazon-image.nix | ||
container-login.nix | ||
containers.nix | ||
ec2-data.nix | ||
google-compute-config.nix | ||
google-compute-image.nix | ||
libvirtd.nix | ||
nova-config.nix | ||
nova-image.nix | ||
nova.nix | ||
qemu-opts | ||
qemu-vm.nix | ||
run-in-netns.c | ||
virtualbox-guest.nix | ||
virtualbox-image.nix | ||
xen-dom0.nix | ||
xen-domU.nix |