Skip to content

Commit dfd57bd

Browse files
authored
Merge branch 'main' into pin-6.1
2 parents 45cb495 + 555563b commit dfd57bd

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

docs/getting-started.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,17 +197,16 @@ 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+
# This tries to determine the name of the host network interface to forward
203+
# VM's outbound network traffic through. If outbound traffic doesn't work,
204+
# double check this returns the correct interface!
205+
HOST_IFACE=$(ip -j route list default |jq -r '.[0].dev')
202206

203207
# Set up microVM internet access
204208
sudo iptables -t nat -D POSTROUTING -o "$HOST_IFACE" -j MASQUERADE || true
205-
sudo iptables -D FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT \
206-
|| true
207-
sudo iptables -D FORWARD -i "$TAP_DEV" -o "$HOST_IFACE" -j ACCEPT || true
208209
sudo iptables -t nat -A POSTROUTING -o "$HOST_IFACE" -j MASQUERADE
209-
sudo iptables -I FORWARD 1 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
210-
sudo iptables -I FORWARD 1 -i "$TAP_DEV" -o "$HOST_IFACE" -j ACCEPT
211210

212211
API_SOCKET="/tmp/firecracker.socket"
213212
LOGFILE="./firecracker.log"

0 commit comments

Comments
 (0)