{"action":"opened","number":1,"pull_request":{"url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/pulls/1","id":73148592,"html_url":"https://github.com/fabric8io/docker-iptables-redirector/pull/1","diff_url":"https://github.com/fabric8io/docker-iptables-redirector/pull/1.diff","patch_url":"https://github.com/fabric8io/docker-iptables-redirector/pull/1.patch","issue_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/issues/1","number":1,"state":"open","locked":false,"title":"Fixes required to actually redirect traffic from host and containers","user":{"login":"mumoshu","id":22009,"avatar_url":"https://avatars.githubusercontent.com/u/22009?v=3","gravatar_id":"","url":"https://api.github.com/users/mumoshu","html_url":"https://github.com/mumoshu","followers_url":"https://api.github.com/users/mumoshu/followers","following_url":"https://api.github.com/users/mumoshu/following{/other_user}","gists_url":"https://api.github.com/users/mumoshu/gists{/gist_id}","starred_url":"https://api.github.com/users/mumoshu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mumoshu/subscriptions","organizations_url":"https://api.github.com/users/mumoshu/orgs","repos_url":"https://api.github.com/users/mumoshu/repos","events_url":"https://api.github.com/users/mumoshu/events{/privacy}","received_events_url":"https://api.github.com/users/mumoshu/received_events","type":"User","site_admin":false},"body":"Hi, thanks for sharing this 👍 \r\n\r\nI have recently used docker-iptables-redirector for redirecting traffic from host/docker containers whose destination is `169.254.169.254`(AWS/GCP Metadata service endpoint) to another container([aws-mock-metadata](https://github.com/jtblin/aws-mock-metadata)).\r\nI'm assuming this kind of use-case is pretty common so we'd be happy if it is supported out of box.\r\n\r\nI had to do two things to make it work:\r\n\r\n(1) pass `--net=host` to the docker container running iptables-redirector for changes made to iptables by the redirector actually take effect on the host\r\n(2) Adding rules to not only OUTPUT chain but also PREROUTING chain. Rules in OUTPUT chain seems to redirect traffic from host but not from containers. If you want to redirect traffic from containers (which I assume is a pretty common use-case) we need to add rules to PREROUTING, too. See https://github.com/jtblin/aws-mock-metadata/pull/5 \r\n\r\nHence this pull request.\r\n\r\nDoes this change look appropriate for you?","created_at":"2016-06-09T02:10:43Z","updated_at":"2016-06-09T02:10:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c2d94a24018d615fc16befa0aa93f4e6ea222a7d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/pulls/1/commits","review_comments_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/pulls/1/comments","review_comment_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/issues/1/comments","statuses_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/statuses/5e36e65ef846857f32ec4bb20315f4916fd60140","head":{"label":"mumoshu:fixes-required-to-actually-redirect-traffic-from-host-and-containers","ref":"fixes-required-to-actually-redirect-traffic-from-host-and-containers","sha":"5e36e65ef846857f32ec4bb20315f4916fd60140","user":{"login":"mumoshu","id":22009,"avatar_url":"https://avatars.githubusercontent.com/u/22009?v=3","gravatar_id":"","url":"https://api.github.com/users/mumoshu","html_url":"https://github.com/mumoshu","followers_url":"https://api.github.com/users/mumoshu/followers","following_url":"https://api.github.com/users/mumoshu/following{/other_user}","gists_url":"https://api.github.com/users/mumoshu/gists{/gist_id}","starred_url":"https://api.github.com/users/mumoshu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mumoshu/subscriptions","organizations_url":"https://api.github.com/users/mumoshu/orgs","repos_url":"https://api.github.com/users/mumoshu/repos","events_url":"https://api.github.com/users/mumoshu/events{/privacy}","received_events_url":"https://api.github.com/users/mumoshu/received_events","type":"User","site_admin":false},"repo":{"id":60673890,"name":"docker-iptables-redirector","full_name":"mumoshu/docker-iptables-redirector","owner":{"login":"mumoshu","id":22009,"avatar_url":"https://avatars.githubusercontent.com/u/22009?v=3","gravatar_id":"","url":"https://api.github.com/users/mumoshu","html_url":"https://github.com/mumoshu","followers_url":"https://api.github.com/users/mumoshu/followers","following_url":"https://api.github.com/users/mumoshu/following{/other_user}","gists_url":"https://api.github.com/users/mumoshu/gists{/gist_id}","starred_url":"https://api.github.com/users/mumoshu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mumoshu/subscriptions","organizations_url":"https://api.github.com/users/mumoshu/orgs","repos_url":"https://api.github.com/users/mumoshu/repos","events_url":"https://api.github.com/users/mumoshu/events{/privacy}","received_events_url":"https://api.github.com/users/mumoshu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mumoshu/docker-iptables-redirector","description":"A simple Docker image that redirects traffic via DNAT to a different address/port","fork":true,"url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector","forks_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/forks","keys_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/teams","hooks_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/hooks","issue_events_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/issues/events{/number}","events_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/events","assignees_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/assignees{/user}","branches_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/branches{/branch}","tags_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/tags","blobs_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/git/refs{/sha}","trees_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/statuses/{sha}","languages_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/languages","stargazers_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/stargazers","contributors_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/contributors","subscribers_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/subscribers","subscription_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/subscription","commits_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/commits{/sha}","git_commits_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/git/commits{/sha}","comments_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/comments{/number}","issue_comment_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/issues/comments{/number}","contents_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/contents/{+path}","compare_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/merges","archive_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/downloads","issues_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/issues{/number}","pulls_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/pulls{/number}","milestones_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/milestones{/number}","notifications_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/labels{/name}","releases_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/releases{/id}","deployments_url":"https://api.github.com/repos/mumoshu/docker-iptables-redirector/deployments","created_at":"2016-06-08T06:24:30Z","updated_at":"2016-06-08T06:24:31Z","pushed_at":"2016-06-09T01:45:17Z","git_url":"git://github.com/mumoshu/docker-iptables-redirector.git","ssh_url":"git@github.com:mumoshu/docker-iptables-redirector.git","clone_url":"https://github.com/mumoshu/docker-iptables-redirector.git","svn_url":"https://github.com/mumoshu/docker-iptables-redirector","homepage":"http://fabric8.io","size":3,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"fabric8io:master","ref":"master","sha":"f4ed206ac38171a32aeabdce3679c2ff1c423160","user":{"login":"fabric8io","id":6074349,"avatar_url":"https://avatars.githubusercontent.com/u/6074349?v=3","gravatar_id":"","url":"https://api.github.com/users/fabric8io","html_url":"https://github.com/fabric8io","followers_url":"https://api.github.com/users/fabric8io/followers","following_url":"https://api.github.com/users/fabric8io/following{/other_user}","gists_url":"https://api.github.com/users/fabric8io/gists{/gist_id}","starred_url":"https://api.github.com/users/fabric8io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabric8io/subscriptions","organizations_url":"https://api.github.com/users/fabric8io/orgs","repos_url":"https://api.github.com/users/fabric8io/repos","events_url":"https://api.github.com/users/fabric8io/events{/privacy}","received_events_url":"https://api.github.com/users/fabric8io/received_events","type":"Organization","site_admin":false},"repo":{"id":59305801,"name":"docker-iptables-redirector","full_name":"fabric8io/docker-iptables-redirector","owner":{"login":"fabric8io","id":6074349,"avatar_url":"https://avatars.githubusercontent.com/u/6074349?v=3","gravatar_id":"","url":"https://api.github.com/users/fabric8io","html_url":"https://github.com/fabric8io","followers_url":"https://api.github.com/users/fabric8io/followers","following_url":"https://api.github.com/users/fabric8io/following{/other_user}","gists_url":"https://api.github.com/users/fabric8io/gists{/gist_id}","starred_url":"https://api.github.com/users/fabric8io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabric8io/subscriptions","organizations_url":"https://api.github.com/users/fabric8io/orgs","repos_url":"https://api.github.com/users/fabric8io/repos","events_url":"https://api.github.com/users/fabric8io/events{/privacy}","received_events_url":"https://api.github.com/users/fabric8io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fabric8io/docker-iptables-redirector","description":"A simple Docker image that redirects traffic via DNAT to a different address/port","fork":false,"url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector","forks_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/forks","keys_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/teams","hooks_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/hooks","issue_events_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/issues/events{/number}","events_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/events","assignees_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/assignees{/user}","branches_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/branches{/branch}","tags_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/tags","blobs_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/git/refs{/sha}","trees_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/statuses/{sha}","languages_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/languages","stargazers_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/stargazers","contributors_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/contributors","subscribers_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/subscribers","subscription_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/subscription","commits_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/commits{/sha}","git_commits_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/git/commits{/sha}","comments_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/comments{/number}","issue_comment_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/issues/comments{/number}","contents_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/contents/{+path}","compare_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/merges","archive_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/downloads","issues_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/issues{/number}","pulls_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/pulls{/number}","milestones_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/milestones{/number}","notifications_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/labels{/name}","releases_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/releases{/id}","deployments_url":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/deployments","created_at":"2016-05-20T15:33:47Z","updated_at":"2016-05-20T15:35:42Z","pushed_at":"2016-06-09T02:10:44Z","git_url":"git://github.com/fabric8io/docker-iptables-redirector.git","ssh_url":"git@github.com:fabric8io/docker-iptables-redirector.git","clone_url":"https://github.com/fabric8io/docker-iptables-redirector.git","svn_url":"https://github.com/fabric8io/docker-iptables-redirector","homepage":"http://fabric8.io","size":2,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/pulls/1"},"html":{"href":"https://github.com/fabric8io/docker-iptables-redirector/pull/1"},"issue":{"href":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/issues/1"},"comments":{"href":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/fabric8io/docker-iptables-redirector/statuses/5e36e65ef846857f32ec4bb20315f4916fd60140"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":2,"additions":6,"deletions":1,"changed_files":2}}
{"actor":{"display_login":"mumoshu"}}