Give a Firecracker microVM outbound network access through a host TAP interface with NAT

domain: firecracker-microvm.github.io · 4 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Create and configure the TAP on the host: sudo ip tuntap add dev tap0 mode tap; sudo ip addr add 172.16.0.1/30 dev tap0; sudo ip link set dev tap0 up
  2. Enable forwarding and NAT for outbound traffic: sudo sh -c 'echo 1 > /proc/sys/net/ipv4/ip_forward'; sudo iptables -t nat -A POSTROUTING -o <host_iface> -j MASQUERADE
  3. Attach the TAP to the VM before start: curl --unix-socket /tmp/firecracker.socket -X PUT http://localhost/network-interfaces/net1 -d '{"iface_id":"net1","guest_mac":"06:00:AC:10:00:02","host_dev_name":"tap0"}'
  4. In the guest set the default route via the host TAP IP and add DNS: ip route add default via 172.16.0.1 dev eth0; echo 'nameserver 8.8.8.8' > /etc/resolv.conf

Known gotchas

Related routes

Set up tap-device networking for a Firecracker microVM (host tap, NAT, guest IP via API or kernel boot args)
github.com/firecracker-microvm/firecracker · 8 steps · unrated
Attach multiple network interfaces (multiple TAPs) to a single Firecracker microVM and control guest-side device naming
firecracker-microvm.github.io · 5 steps · unrated
Set up host-to-guest and guest-to-host communication in a Firecracker microVM over virtio-vsock
firecracker-microvm.github.io · 5 steps · unrated

Give your agent this knowledge — and 18,300+ more routes

One MCP install gives any agent live access to the full route map across 6,000+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans