{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/18169","labels_url":"https://api.github.com/repos/docker/docker/issues/18169/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/18169/comments","events_url":"https://api.github.com/repos/docker/docker/issues/18169/events","html_url":"https://github.com/docker/docker/issues/18169","id":118415515,"number":18169,"title":"Docker doesn't remove MASQUERADE nat rule when removing network","user":{"login":"ssadler","id":125019,"avatar_url":"https://avatars.githubusercontent.com/u/125019?v=3","gravatar_id":"","url":"https://api.github.com/users/ssadler","html_url":"https://github.com/ssadler","followers_url":"https://api.github.com/users/ssadler/followers","following_url":"https://api.github.com/users/ssadler/following{/other_user}","gists_url":"https://api.github.com/users/ssadler/gists{/gist_id}","starred_url":"https://api.github.com/users/ssadler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ssadler/subscriptions","organizations_url":"https://api.github.com/users/ssadler/orgs","repos_url":"https://api.github.com/users/ssadler/repos","events_url":"https://api.github.com/users/ssadler/events{/privacy}","received_events_url":"https://api.github.com/users/ssadler/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/group/networking","name":"group/networking","color":"F6FBFF"},{"url":"https://api.github.com/repos/docker/docker/labels/kind/bug","name":"kind/bug","color":"FF8C94"},{"url":"https://api.github.com/repos/docker/docker/labels/priority/P2","name":"priority/P2","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/docker/docker/milestones/48","html_url":"https://github.com/docker/docker/milestones/1.9.2","labels_url":"https://api.github.com/repos/docker/docker/milestones/48/labels","id":1425631,"number":48,"title":"1.9.2","description":"Tentative patch release. Probably never used, unless we find something worth releasing.","creator":{"login":"calavera","id":1050,"avatar_url":"https://avatars.githubusercontent.com/u/1050?v=3","gravatar_id":"","url":"https://api.github.com/users/calavera","html_url":"https://github.com/calavera","followers_url":"https://api.github.com/users/calavera/followers","following_url":"https://api.github.com/users/calavera/following{/other_user}","gists_url":"https://api.github.com/users/calavera/gists{/gist_id}","starred_url":"https://api.github.com/users/calavera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calavera/subscriptions","organizations_url":"https://api.github.com/users/calavera/orgs","repos_url":"https://api.github.com/users/calavera/repos","events_url":"https://api.github.com/users/calavera/events{/privacy}","received_events_url":"https://api.github.com/users/calavera/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":11,"state":"open","created_at":"2015-11-23T17:39:46Z","updated_at":"2015-12-03T18:53:13Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2015-11-23T16:15:22Z","updated_at":"2015-12-04T01:11:17Z","closed_at":null,"body":"Description of problem:\r\n\r\nDocker doesn't remove MASQUERADE rule from iptables when network is rm'ed.\r\n\r\nIf the same network is created, removed, then created again, the rule\r\nis duplicated in iptables. One result of this is that the **gateway address\r\nis wrongly propagated as the source address of a connection**.\r\n\r\n`docker version`:\r\n\r\n    Client:\r\n     Version:      1.9.0\r\n     API version:  1.21\r\n     Go version:   go1.4.2\r\n     Git commit:   76d6bc9\r\n     Built:        Tue Nov  3 17:48:04 UTC 2015\r\n     OS/Arch:      linux/amd64\r\n\r\n    Server:\r\n     Version:      1.9.0\r\n     API version:  1.21\r\n     Go version:   go1.4.2\r\n     Git commit:   76d6bc9\r\n     Built:        Tue Nov  3 17:48:04 UTC 2015\r\n     OS/Arch:      linux/amd64\r\n\r\n`docker info`:\r\n\r\n    Containers: 41\r\n    Images: 52\r\n    Server Version: 1.9.0\r\n    Storage Driver: aufs\r\n     Root Dir: /var/lib/docker/aufs\r\n     Backing Filesystem: extfs\r\n     Dirs: 134\r\n     Dirperm1 Supported: true\r\n    Execution Driver: native-0.2\r\n    Logging Driver: json-file\r\n    Kernel Version: 3.19.0-33-generic\r\n    Operating System: Ubuntu 15.04\r\n    CPUs: 4\r\n    Total Memory: 7.705 GiB\r\n    Name: wackbook\r\n    ID: VNVB:5RAY:RLCV:FJ4U:IHYI:T2V3:E7AD:KOTF:ZZAI:UB5X:LAA7:JCPA\r\n    WARNING: No swap limit support\r\n\r\n`uname -a`:\r\n\r\n    Linux wackbook 3.19.0-33-generic #38-Ubuntu SMP Fri Nov 6 18:18:12 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux\r\n\r\nEnvironment details (AWS, VirtualBox, physical, etc.):\r\n\r\nPhysical laptop\r\n\r\nHow reproducible:\r\n\r\nEasy?\r\n\r\nSteps to Reproduce:\r\n1. `docker network create --subnet=10.5.5.0/24 batman`\r\n2. `docker network rm batman`\r\n3. `docker network create --subnet=10.5.5.0/24 batman`\r\n4. `iptables -t nat -L | grep 10.5.5`\r\n\r\n\r\nActual Results:\r\n\r\n    MASQUERADE  all  --  10.5.5.0/24          anywhere\r\n    MASQUERADE  all  --  10.5.5.0/24          anywhere\r\n\r\nExpected Results:\r\n\r\n    MASQUERADE  all  --  10.5.5.0/24          anywhere\r\n\r\nAdditional info:\r\n\r\nCross reference #7540 which may be related"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/161842803","html_url":"https://github.com/docker/docker/issues/18169#issuecomment-161842803","issue_url":"https://api.github.com/repos/docker/docker/issues/18169","id":161842803,"user":{"login":"ssadler","id":125019,"avatar_url":"https://avatars.githubusercontent.com/u/125019?v=3","gravatar_id":"","url":"https://api.github.com/users/ssadler","html_url":"https://github.com/ssadler","followers_url":"https://api.github.com/users/ssadler/followers","following_url":"https://api.github.com/users/ssadler/following{/other_user}","gists_url":"https://api.github.com/users/ssadler/gists{/gist_id}","starred_url":"https://api.github.com/users/ssadler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ssadler/subscriptions","organizations_url":"https://api.github.com/users/ssadler/orgs","repos_url":"https://api.github.com/users/ssadler/repos","events_url":"https://api.github.com/users/ssadler/events{/privacy}","received_events_url":"https://api.github.com/users/ssadler/received_events","type":"User","site_admin":false},"created_at":"2015-12-04T01:11:16Z","updated_at":"2015-12-04T01:11:16Z","body":"Thanks @WeiZhang555 @aboch "}}