{"action":"created","issue":{"url":"https://api.github.com/repos/saschpe/libvirt-hook-qemu/issues/11","labels_url":"https://api.github.com/repos/saschpe/libvirt-hook-qemu/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/saschpe/libvirt-hook-qemu/issues/11/comments","events_url":"https://api.github.com/repos/saschpe/libvirt-hook-qemu/issues/11/events","html_url":"https://github.com/saschpe/libvirt-hook-qemu/pull/11","id":122856625,"number":11,"title":"Allow connections from host and guest as well as public","user":{"login":"bronson","id":1776,"avatar_url":"https://avatars.githubusercontent.com/u/1776?v=3","gravatar_id":"","url":"https://api.github.com/users/bronson","html_url":"https://github.com/bronson","followers_url":"https://api.github.com/users/bronson/followers","following_url":"https://api.github.com/users/bronson/following{/other_user}","gists_url":"https://api.github.com/users/bronson/gists{/gist_id}","starred_url":"https://api.github.com/users/bronson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bronson/subscriptions","organizations_url":"https://api.github.com/users/bronson/orgs","repos_url":"https://api.github.com/users/bronson/repos","events_url":"https://api.github.com/users/bronson/events{/privacy}","received_events_url":"https://api.github.com/users/bronson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-18T01:12:29Z","updated_at":"2016-01-22T12:20:25Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/saschpe/libvirt-hook-qemu/pulls/11","html_url":"https://github.com/saschpe/libvirt-hook-qemu/pull/11","diff_url":"https://github.com/saschpe/libvirt-hook-qemu/pull/11.diff","patch_url":"https://github.com/saschpe/libvirt-hook-qemu/pull/11.patch"},"body":"This is an experiment that seems to have worked...  Submitting it to see what you think, happy to modify or ignore.\r\n\r\nI had three problems with the qemu hook:\r\n\r\n* Connecting from the host to the forwarded port fails.  Packets from the host to the public IP are lost because apparently DNAT needs to happen in the OUTPUT chain as well as PREROUTING (some iptables thing).\r\n* Connecting from the guest to the forwarded port fails.  Packets from the guest to the public IP are lost because they need to be SNATed for the reply to be routed correctly.\r\n* if you edit `qemu.json` while a guest is running, the guest's rules won't be removed when it stops.  You either need to reboot the host or clean them up by hand.\r\n\r\nThis patchset addresses all three concerns.  It adds some rules, and it creates new chains for the rules so they can be flushed and deleted without regard to what their contents are.\r\n\r\nOne potential issue is that I no longer support \"interface\" in the JSON config since I didn't see any use for it.  If anyone has a use case that requires it, I can add it back.\r\n\r\nJust for reference, some iptables discussion that went into this patchset:\r\n* http://marc.info/?t=144918284000003&r=1&w=2\r\n* http://marc.info/?t=144922229800002&r=1&w=2"},"comment":{"url":"https://api.github.com/repos/saschpe/libvirt-hook-qemu/issues/comments/173902810","html_url":"https://github.com/saschpe/libvirt-hook-qemu/pull/11#issuecomment-173902810","issue_url":"https://api.github.com/repos/saschpe/libvirt-hook-qemu/issues/11","id":173902810,"user":{"login":"saschpe","id":115275,"avatar_url":"https://avatars.githubusercontent.com/u/115275?v=3","gravatar_id":"","url":"https://api.github.com/users/saschpe","html_url":"https://github.com/saschpe","followers_url":"https://api.github.com/users/saschpe/followers","following_url":"https://api.github.com/users/saschpe/following{/other_user}","gists_url":"https://api.github.com/users/saschpe/gists{/gist_id}","starred_url":"https://api.github.com/users/saschpe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saschpe/subscriptions","organizations_url":"https://api.github.com/users/saschpe/orgs","repos_url":"https://api.github.com/users/saschpe/repos","events_url":"https://api.github.com/users/saschpe/events{/privacy}","received_events_url":"https://api.github.com/users/saschpe/received_events","type":"User","site_admin":false},"created_at":"2016-01-22T12:20:25Z","updated_at":"2016-01-22T12:20:25Z","body":"Any update on this?"}}