Skip to content

Commit ba8ad7a

Browse files
huang-jlzulinx86
authored andcommitted
doc: fix missing iptables rule for network-for-clones.md
There lacks one iptables configuration about setup egress connectivity. As shown in [1], it should add a MASQUERADE rules inside the netns. After that, the host iptable rules of source ip 10.0.0.0/30 should work. Without that, the host can only see packet of ip 192.168.241.1/29 from guest VM. [1]: https://github.com/firecracker-microvm/firecracker/blame/7dfe2765849c2444a22defa11be8641508c5ce5c/tests/framework/microvm_helpers.py#L194 Signed-off-by: huang-jl <[email protected]>
1 parent 1ca8af1 commit ba8ad7a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

docs/snapshotting/network-for-clones.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ have the same internal IP).
113113
# Find the host egress device
114114
UPSTREAM=$(ip -j route list default |jq -r '.[0].dev')
115115
# anything coming from the VMs, we NAT the address
116+
ip netns exec fc0 iptables -t nat -A POSTROUTING -s 192.168.241.1/29 -o veth0 -j MASQUERADE
116117
iptables -t nat -A POSTROUTING -s 10.0.0.0/30 -o $UPSTREAM -j MASQUERADE
117118
# forward packets by default
118119
iptables -P FORWARD ACCEPT

0 commit comments

Comments
 (0)