Add support for dynamic "NAT" interfaces (-L/local interface).
authorreyk <reyk@openbsd.org>
Wed, 19 Apr 2017 15:38:32 +0000 (15:38 +0000)
committerreyk <reyk@openbsd.org>
Wed, 19 Apr 2017 15:38:32 +0000 (15:38 +0000)
commit470adcf5f09468c440f98fb57a26d5d9f66eb933
treefd9f20d9cb0c7951b4f4a923d7114d6b6409e904
parent9b6a64127deb1b83dcff3be06f373dc1b5768659
Add support for dynamic "NAT" interfaces (-L/local interface).

When a local interface is configured, vmd configures a /31 address on
the tap(4) interface of the host and provides another IP in the same
subnet via DHCP (BOOTP) to the VM.  vmd runs an internal BOOTP server
that replies with IP, gateway, and DNS addresses to the VM.  The
built-in server only ever responds to the VM on the inside and cannot
leak its DHCP responses to the outside.

Thanks to Uwe Werler, Josh Grosse, and some others for testing!

OK deraadt@
15 files changed:
usr.sbin/vmctl/main.c
usr.sbin/vmctl/vmctl.8
usr.sbin/vmctl/vmctl.c
usr.sbin/vmd/Makefile
usr.sbin/vmd/dhcp.c [new file with mode: 0644]
usr.sbin/vmd/dhcp.h [new file with mode: 0644]
usr.sbin/vmd/packet.c [new file with mode: 0644]
usr.sbin/vmd/parse.y
usr.sbin/vmd/priv.c
usr.sbin/vmd/virtio.c
usr.sbin/vmd/virtio.h
usr.sbin/vmd/vm.c
usr.sbin/vmd/vm.conf.5
usr.sbin/vmd/vmd.c
usr.sbin/vmd/vmd.h