- Notifications
You must be signed in to change notification settings - Fork2.2k
-
I followed the guide and got ssh to 192.168.0.3 from default netns to work, but pinging 1.1.1.1 from the guest fails.
Using default ubuntu-22.04.ext4 rootfs with its guest mac setup and I think there might be an error in the guide since connecting to the guest makes sense (192.168.0.3 through to tap through to guest), but how would NATing the packetsto 192.168.0.3 result in them going to my actual network interface ( |
BetaWas this translation helpful?Give feedback.
All reactions
Replies: 5 comments 7 replies
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
I made my own setup like this: Netns with And forwarding from tap to vpeer according to network setup guide with iptables inside the netns. While this works, it requires 6 iptables rules (7, if also making a clone address with DNAT accessible from outside the netns) and can probably somehow be simplified. Plus, why does the original guide not work like I described? |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
After some more networking pain I reduced the amount of necessary rules from 7 to 5 so I'm actually gonna stick with my solution instead of the broken one in the docs: 1 (inside netns) - mark connections from guest as connections from inside netns |
BetaWas this translation helpful?Give feedback.
All reactions
-
Hi@kanpov it may be the host configuration was not fully captured back when this guide was written. As you said we could update it to use |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Funnily enough, the working example you link doesn't use a single |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
BetaWas this translation helpful?Give feedback.
All reactions
-
Hi, I actually tried the guide myself and I run into the same issues, it is not functional. I thought it could be fixed with @kanpov what is the rule you call |
BetaWas this translation helpful?Give feedback.
All reactions
-
The last rule is DNAT inside the netns to rewrite the globally-routable IP to the one representing the guest inside the netns. |
BetaWas this translation helpful?Give feedback.
All reactions
-
For the full code, you can check out the fcnet crate I made that implements both simple and netns networking. For netns, it uses 1 forwarding chain and 2 rewrites instead of 2 forwarding chains like in CI |
BetaWas this translation helpful?Give feedback.
All reactions
-
I guess that ishttps://github.com/kanpov/fcnet/blob/master/src/netns.rs? Thanks, I will take a look at it. |
BetaWas this translation helpful?Give feedback.
All reactions
-
Provided an updated guide in#4848. I think that at least works with what we have in the integration tests even if it's not optimal. Also removed the performance section since we don't have a way of rerunning those tests. |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Thanks for the effort! As for the optimal claim, I don't actually have concrete benchmarks that would prove that FORWARD,MASQUERADE + DNAT for connectivity to the guest and SNAT + FORWARD,MASQUERADE for connectivity from the guest are faster than FORWARD,MASQUERADE + FORWARD,MASQUERADE on both, I made that assumption based on the reduction in iptables rules. So I suppose it'd be interesting to actually make that benchmark, but doing it "properly" in the context of Firecracker would entail recovering those tests or creating new ones. |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1
-
Update on this: after#4877 gets merged with major improvements to the mainline network setup doc, I'm gonna be working on de-crusting the network-for-clones setup as well, with nftables support and less rules as described above. |
BetaWas this translation helpful?Give feedback.
