Skip to content

Commit 4fc4880

Browse files
committed
fix: properly setup outbound network connectivity in getting started
the getting started guide was hardcoding eth0 as the network interface on the host to route outbound microvm network traffic to. However, on EC2 instances (and my laptop), that's wrong, because its not called eth0. So instead dynamically determine the hopefully correct network interface on the host. Fixes: #4930 Suggested-by: Pablo Barbáchano <[email protected]> Signed-off-by: Patrick Roy <[email protected]>
1 parent 4c33853 commit 4fc4880

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/getting-started.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,9 @@ sudo ip link set dev "$TAP_DEV" up
197197

198198
# Enable ip forwarding
199199
sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
200+
sudo iptables -P FORWARD ACCEPT
200201

201-
HOST_IFACE="eth0"
202+
HOST_IFACE=$(ip -j route list default |jq -r '.[0].dev')
202203

203204
# Set up microVM internet access
204205
sudo iptables -t nat -D POSTROUTING -o "$HOST_IFACE" -j MASQUERADE || true

0 commit comments

Comments
 (0)