{"action":"created","comment":{"url":"https://api.github.com/repos/appc/cni/pulls/comments/46467297","id":46467297,"diff_hunk":"@@ -38,3 +38,40 @@ Because all ipvlan interfaces share the MAC address with the host interface, DHC\n Therefore the container will not be able to reach the host via `ipvlan` interface.\n Be sure to also have container join a network that provides connectivity to the host (e.g. `ptp`).\n * A single master interface can not be enslaved by both `macvlan` and `ipvlan`.\n+\n+### Using ipvlan and dhcp\n+There are two considerations when using \"ipvlan\" plugin together with \"dhcp\" IPAM plugin.\n+\n+First, since ipvlan driver uses the destination address in the IP packet when deciding to which slave the packet should be forwarded to, it will not work if the container interface is not yet assigned an IP.\n+Since the DHCP packets are exchanged to determine which IP should be used, the interface will not yet have an IP address.\n+A DHCP server typically unicasts the replies back to the client which will cause the ipvlan driver to drop the replies.\n+To work around this, the DHCP client needs to instruct the DHCP server to use broadcasts instead.\n+This can be accomplished by setting the \"broadcast\" flag in the \"ipam\" section of the network configuration:\n+\n+```\n+{\n+\t\"name\": \"mynet\",\n+\t\"type\": \"ipvlan\",\n+\t\"master\": \"eth0\",\n+\t\"ipam\": {\n+\t\t\"type\": \"dhcp\",\n+\t\t\"broadcast\": true\n+\t}\n+}\n+```\n+\n+Second, because all ipvlan interfaces share the MAC address of the master interface, DHCP servers will have trouble identifying and tracking individual container interfaces.\n+To combat this, it is necessary to include DHCP option 61 (Client Identifier) in DHCP messages.\n+DHCP plugin will do so if \"sendClientID\" flag is enabled (default).","path":"Documentation/ipvlan.md","position":28,"original_position":28,"commit_id":"c36218df7debfad74e751f4bcfbf3b5fba9a6f88","original_commit_id":"c36218df7debfad74e751f4bcfbf3b5fba9a6f88","user":{"login":"joshix","id":72905,"avatar_url":"https://avatars.githubusercontent.com/u/72905?v=3","gravatar_id":"","url":"https://api.github.com/users/joshix","html_url":"https://github.com/joshix","followers_url":"https://api.github.com/users/joshix/followers","following_url":"https://api.github.com/users/joshix/following{/other_user}","gists_url":"https://api.github.com/users/joshix/gists{/gist_id}","starred_url":"https://api.github.com/users/joshix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshix/subscriptions","organizations_url":"https://api.github.com/users/joshix/orgs","repos_url":"https://api.github.com/users/joshix/repos","events_url":"https://api.github.com/users/joshix/events{/privacy}","received_events_url":"https://api.github.com/users/joshix/received_events","type":"User","site_admin":false},"body":"The DHCP plugin will emit such client identifiers if the `sendClientID` flag is set, as it is by default.","created_at":"2015-12-02T20:02:34Z","updated_at":"2015-12-02T20:02:34Z","html_url":"https://github.com/appc/cni/pull/83#discussion_r46467297","pull_request_url":"https://api.github.com/repos/appc/cni/pulls/83","_links":{"self":{"href":"https://api.github.com/repos/appc/cni/pulls/comments/46467297"},"html":{"href":"https://github.com/appc/cni/pull/83#discussion_r46467297"},"pull_request":{"href":"https://api.github.com/repos/appc/cni/pulls/83"}}},"pull_request":{"url":"https://api.github.com/repos/appc/cni/pulls/83","id":51401951,"html_url":"https://github.com/appc/cni/pull/83","diff_url":"https://github.com/appc/cni/pull/83.diff","patch_url":"https://github.com/appc/cni/pull/83.patch","issue_url":"https://api.github.com/repos/appc/cni/issues/83","number":83,"state":"open","locked":false,"title":"Send ClientID DHCP option in DISCOVER/ACK msgs","user":{"login":"eyakubovich","id":3586053,"avatar_url":"https://avatars.githubusercontent.com/u/3586053?v=3","gravatar_id":"","url":"https://api.github.com/users/eyakubovich","html_url":"https://github.com/eyakubovich","followers_url":"https://api.github.com/users/eyakubovich/followers","following_url":"https://api.github.com/users/eyakubovich/following{/other_user}","gists_url":"https://api.github.com/users/eyakubovich/gists{/gist_id}","starred_url":"https://api.github.com/users/eyakubovich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eyakubovich/subscriptions","organizations_url":"https://api.github.com/users/eyakubovich/orgs","repos_url":"https://api.github.com/users/eyakubovich/repos","events_url":"https://api.github.com/users/eyakubovich/events{/privacy}","received_events_url":"https://api.github.com/users/eyakubovich/received_events","type":"User","site_admin":false},"body":"ClientID is \"containerid/netname\" and can help\r\nwith visibility into allocated IPs in DHCP server.\r\nUnforunately it still does not make it possible\r\nto use DHCP with ipvlan as the messages coming\r\nfrom the DHCP server can't be forwarded to the\r\ncorrect ipvlan interface since they don't yet\r\nhave the IP assigned.\r\n\r\nFixes #17","created_at":"2015-11-20T20:07:52Z","updated_at":"2015-12-02T20:02:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"909205bbfc33c876b4c8e30a275be70fd5f2955f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/appc/cni/pulls/83/commits","review_comments_url":"https://api.github.com/repos/appc/cni/pulls/83/comments","review_comment_url":"https://api.github.com/repos/appc/cni/pulls/comments{/number}","comments_url":"https://api.github.com/repos/appc/cni/issues/83/comments","statuses_url":"https://api.github.com/repos/appc/cni/statuses/c36218df7debfad74e751f4bcfbf3b5fba9a6f88","head":{"label":"eyakubovich:dhcp-client-id","ref":"dhcp-client-id","sha":"c36218df7debfad74e751f4bcfbf3b5fba9a6f88","user":{"login":"eyakubovich","id":3586053,"avatar_url":"https://avatars.githubusercontent.com/u/3586053?v=3","gravatar_id":"","url":"https://api.github.com/users/eyakubovich","html_url":"https://github.com/eyakubovich","followers_url":"https://api.github.com/users/eyakubovich/followers","following_url":"https://api.github.com/users/eyakubovich/following{/other_user}","gists_url":"https://api.github.com/users/eyakubovich/gists{/gist_id}","starred_url":"https://api.github.com/users/eyakubovich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eyakubovich/subscriptions","organizations_url":"https://api.github.com/users/eyakubovich/orgs","repos_url":"https://api.github.com/users/eyakubovich/repos","events_url":"https://api.github.com/users/eyakubovich/events{/privacy}","received_events_url":"https://api.github.com/users/eyakubovich/received_events","type":"User","site_admin":false},"repo":{"id":34010510,"name":"cni","full_name":"eyakubovich/cni","owner":{"login":"eyakubovich","id":3586053,"avatar_url":"https://avatars.githubusercontent.com/u/3586053?v=3","gravatar_id":"","url":"https://api.github.com/users/eyakubovich","html_url":"https://github.com/eyakubovich","followers_url":"https://api.github.com/users/eyakubovich/followers","following_url":"https://api.github.com/users/eyakubovich/following{/other_user}","gists_url":"https://api.github.com/users/eyakubovich/gists{/gist_id}","starred_url":"https://api.github.com/users/eyakubovich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eyakubovich/subscriptions","organizations_url":"https://api.github.com/users/eyakubovich/orgs","repos_url":"https://api.github.com/users/eyakubovich/repos","events_url":"https://api.github.com/users/eyakubovich/events{/privacy}","received_events_url":"https://api.github.com/users/eyakubovich/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eyakubovich/cni","description":"","fork":true,"url":"https://api.github.com/repos/eyakubovich/cni","forks_url":"https://api.github.com/repos/eyakubovich/cni/forks","keys_url":"https://api.github.com/repos/eyakubovich/cni/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eyakubovich/cni/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eyakubovich/cni/teams","hooks_url":"https://api.github.com/repos/eyakubovich/cni/hooks","issue_events_url":"https://api.github.com/repos/eyakubovich/cni/issues/events{/number}","events_url":"https://api.github.com/repos/eyakubovich/cni/events","assignees_url":"https://api.github.com/repos/eyakubovich/cni/assignees{/user}","branches_url":"https://api.github.com/repos/eyakubovich/cni/branches{/branch}","tags_url":"https://api.github.com/repos/eyakubovich/cni/tags","blobs_url":"https://api.github.com/repos/eyakubovich/cni/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eyakubovich/cni/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eyakubovich/cni/git/refs{/sha}","trees_url":"https://api.github.com/repos/eyakubovich/cni/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eyakubovich/cni/statuses/{sha}","languages_url":"https://api.github.com/repos/eyakubovich/cni/languages","stargazers_url":"https://api.github.com/repos/eyakubovich/cni/stargazers","contributors_url":"https://api.github.com/repos/eyakubovich/cni/contributors","subscribers_url":"https://api.github.com/repos/eyakubovich/cni/subscribers","subscription_url":"https://api.github.com/repos/eyakubovich/cni/subscription","commits_url":"https://api.github.com/repos/eyakubovich/cni/commits{/sha}","git_commits_url":"https://api.github.com/repos/eyakubovich/cni/git/commits{/sha}","comments_url":"https://api.github.com/repos/eyakubovich/cni/comments{/number}","issue_comment_url":"https://api.github.com/repos/eyakubovich/cni/issues/comments{/number}","contents_url":"https://api.github.com/repos/eyakubovich/cni/contents/{+path}","compare_url":"https://api.github.com/repos/eyakubovich/cni/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eyakubovich/cni/merges","archive_url":"https://api.github.com/repos/eyakubovich/cni/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eyakubovich/cni/downloads","issues_url":"https://api.github.com/repos/eyakubovich/cni/issues{/number}","pulls_url":"https://api.github.com/repos/eyakubovich/cni/pulls{/number}","milestones_url":"https://api.github.com/repos/eyakubovich/cni/milestones{/number}","notifications_url":"https://api.github.com/repos/eyakubovich/cni/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eyakubovich/cni/labels{/name}","releases_url":"https://api.github.com/repos/eyakubovich/cni/releases{/id}","created_at":"2015-04-15T18:12:43Z","updated_at":"2015-04-27T21:15:49Z","pushed_at":"2015-12-02T17:34:34Z","git_url":"git://github.com/eyakubovich/cni.git","ssh_url":"git@github.com:eyakubovich/cni.git","clone_url":"https://github.com/eyakubovich/cni.git","svn_url":"https://github.com/eyakubovich/cni","homepage":null,"size":1467,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"appc:master","ref":"master","sha":"f777ca50e50ddecdca561cb22ca4a0c4e5ec17c9","user":{"login":"appc","id":10080092,"avatar_url":"https://avatars.githubusercontent.com/u/10080092?v=3","gravatar_id":"","url":"https://api.github.com/users/appc","html_url":"https://github.com/appc","followers_url":"https://api.github.com/users/appc/followers","following_url":"https://api.github.com/users/appc/following{/other_user}","gists_url":"https://api.github.com/users/appc/gists{/gist_id}","starred_url":"https://api.github.com/users/appc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appc/subscriptions","organizations_url":"https://api.github.com/users/appc/orgs","repos_url":"https://api.github.com/users/appc/repos","events_url":"https://api.github.com/users/appc/events{/privacy}","received_events_url":"https://api.github.com/users/appc/received_events","type":"Organization","site_admin":false},"repo":{"id":33429211,"name":"cni","full_name":"appc/cni","owner":{"login":"appc","id":10080092,"avatar_url":"https://avatars.githubusercontent.com/u/10080092?v=3","gravatar_id":"","url":"https://api.github.com/users/appc","html_url":"https://github.com/appc","followers_url":"https://api.github.com/users/appc/followers","following_url":"https://api.github.com/users/appc/following{/other_user}","gists_url":"https://api.github.com/users/appc/gists{/gist_id}","starred_url":"https://api.github.com/users/appc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appc/subscriptions","organizations_url":"https://api.github.com/users/appc/orgs","repos_url":"https://api.github.com/users/appc/repos","events_url":"https://api.github.com/users/appc/events{/privacy}","received_events_url":"https://api.github.com/users/appc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/appc/cni","description":"Container Network Interface","fork":false,"url":"https://api.github.com/repos/appc/cni","forks_url":"https://api.github.com/repos/appc/cni/forks","keys_url":"https://api.github.com/repos/appc/cni/keys{/key_id}","collaborators_url":"https://api.github.com/repos/appc/cni/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/appc/cni/teams","hooks_url":"https://api.github.com/repos/appc/cni/hooks","issue_events_url":"https://api.github.com/repos/appc/cni/issues/events{/number}","events_url":"https://api.github.com/repos/appc/cni/events","assignees_url":"https://api.github.com/repos/appc/cni/assignees{/user}","branches_url":"https://api.github.com/repos/appc/cni/branches{/branch}","tags_url":"https://api.github.com/repos/appc/cni/tags","blobs_url":"https://api.github.com/repos/appc/cni/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/appc/cni/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/appc/cni/git/refs{/sha}","trees_url":"https://api.github.com/repos/appc/cni/git/trees{/sha}","statuses_url":"https://api.github.com/repos/appc/cni/statuses/{sha}","languages_url":"https://api.github.com/repos/appc/cni/languages","stargazers_url":"https://api.github.com/repos/appc/cni/stargazers","contributors_url":"https://api.github.com/repos/appc/cni/contributors","subscribers_url":"https://api.github.com/repos/appc/cni/subscribers","subscription_url":"https://api.github.com/repos/appc/cni/subscription","commits_url":"https://api.github.com/repos/appc/cni/commits{/sha}","git_commits_url":"https://api.github.com/repos/appc/cni/git/commits{/sha}","comments_url":"https://api.github.com/repos/appc/cni/comments{/number}","issue_comment_url":"https://api.github.com/repos/appc/cni/issues/comments{/number}","contents_url":"https://api.github.com/repos/appc/cni/contents/{+path}","compare_url":"https://api.github.com/repos/appc/cni/compare/{base}...{head}","merges_url":"https://api.github.com/repos/appc/cni/merges","archive_url":"https://api.github.com/repos/appc/cni/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/appc/cni/downloads","issues_url":"https://api.github.com/repos/appc/cni/issues{/number}","pulls_url":"https://api.github.com/repos/appc/cni/pulls{/number}","milestones_url":"https://api.github.com/repos/appc/cni/milestones{/number}","notifications_url":"https://api.github.com/repos/appc/cni/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/appc/cni/labels{/name}","releases_url":"https://api.github.com/repos/appc/cni/releases{/id}","created_at":"2015-04-05T03:35:49Z","updated_at":"2015-12-02T04:27:41Z","pushed_at":"2015-12-02T17:34:34Z","git_url":"git://github.com/appc/cni.git","ssh_url":"git@github.com:appc/cni.git","clone_url":"https://github.com/appc/cni.git","svn_url":"https://github.com/appc/cni","homepage":"","size":1967,"stargazers_count":51,"watchers_count":51,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":22,"forks":14,"open_issues":22,"watchers":51,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/appc/cni/pulls/83"},"html":{"href":"https://github.com/appc/cni/pull/83"},"issue":{"href":"https://api.github.com/repos/appc/cni/issues/83"},"comments":{"href":"https://api.github.com/repos/appc/cni/issues/83/comments"},"review_comments":{"href":"https://api.github.com/repos/appc/cni/pulls/83/comments"},"review_comment":{"href":"https://api.github.com/repos/appc/cni/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/appc/cni/pulls/83/commits"},"statuses":{"href":"https://api.github.com/repos/appc/cni/statuses/c36218df7debfad74e751f4bcfbf3b5fba9a6f88"}}}}