Modified NAT setup to work reliably with libvirtd #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ted,
Thanks for this very useful piece of code. I'm using it to punch holes from a guest VM out to the 'public' network. Libvirtd sets up a private RFC1918 network for these VM's then creates iptables rules to restrict direct access in to the VM's, and NAT so the guests can get out. Currently the rules in natpmd.action don't work in this setup. This is partly because the rules are appended and are never reached, and partly due to problems with the FORWARD chain rule not matching. This change not only inserts them but changes the FORWARD chain rule to use the DNAT connection tracking state. It works well and I think would work in more diverse setups than the original.
Regards
Nick
PS. I also wrote a Ruby Gem (natpmp) to control this feature. It's up on github and rubygems too.