{"action":"created","issue":{"url":"https://api.github.com/repos/vincentbernat/lldpd/issues/96","labels_url":"https://api.github.com/repos/vincentbernat/lldpd/issues/96/labels{/name}","comments_url":"https://api.github.com/repos/vincentbernat/lldpd/issues/96/comments","events_url":"https://api.github.com/repos/vincentbernat/lldpd/issues/96/events","html_url":"https://github.com/vincentbernat/lldpd/issues/96","id":57617314,"number":96,"title":"Improve automatic choice of management address?","user":{"login":"goadwharry","id":94608,"avatar_url":"https://avatars.githubusercontent.com/u/94608?v=3","gravatar_id":"","url":"https://api.github.com/users/goadwharry","html_url":"https://github.com/goadwharry","followers_url":"https://api.github.com/users/goadwharry/followers","following_url":"https://api.github.com/users/goadwharry/following{/other_user}","gists_url":"https://api.github.com/users/goadwharry/gists{/gist_id}","starred_url":"https://api.github.com/users/goadwharry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goadwharry/subscriptions","organizations_url":"https://api.github.com/users/goadwharry/orgs","repos_url":"https://api.github.com/users/goadwharry/repos","events_url":"https://api.github.com/users/goadwharry/events{/privacy}","received_events_url":"https://api.github.com/users/goadwharry/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-02-13T16:08:45Z","updated_at":"2015-02-13T20:16:20Z","closed_at":"2015-02-13T17:07:52Z","body":"Hello Vincent,\r\n\r\nI have a device which usually has 2 IP addresses on the same ethernet device (eth0):\r\n\r\nip address show eth0\r\n2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP8200> mtu 1500 qdisc pfifo_fast qlen 1000\r\n    link/ether 00:0c:8d:00:0c:0f brd ff:ff:ff:ff:ff:ff\r\n    inet 169.254.124.111/16 brd 169.254.255.255 scope link eth0:avahi\r\n       valid_lft forever preferred_lft forever\r\n    inet 192.168.65.133/24 brd 192.168.65.255 scope global eth0\r\n       valid_lft forever preferred_lft forever\r\n    inet6 fe80::20c:8dff:fe00:c0f/64 scope link \r\n       valid_lft forever preferred_lft forever\r\n\r\nOne address is always present and is a linked local (scope link) address like 169.254.124.111 and the other should be a regular address (scope global) like 192.168.65.133. This second address is usually available but it is possible that it has not been set up. \r\n\r\nStarting lldpd without parameters always results in the 1st address being used as the management address but this is always the linked local address on my system. Of course, I could use the \"-m \" parameter to set the management address but, in my case, both addresses are dynamically allocated and I cannot use fixed addresses in start up scripts (I guess I could use some bash-magic to extract the address I want...)\r\n\r\nI would suggest that it makes more sense for lldpd to choose the address that has a global scope as long as it exists to advertise as a management address and to fall back to the linked local address only if no global address is found. i.e. the management address should be the first global address found or, failing that, the first linked local address found.\r\n\r\nI must admit that I do not know if the above mentioned change makes any sense to anyone else's environment but it seems to me to be a better default than always choosing the first address.\r\n\r\nWhat do you think?\r\n\r\nThanks for your help and the great software!\r\n\r\n--\r\nHoward\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/vincentbernat/lldpd/issues/comments/74319459","html_url":"https://github.com/vincentbernat/lldpd/issues/96#issuecomment-74319459","issue_url":"https://api.github.com/repos/vincentbernat/lldpd/issues/96","id":74319459,"user":{"login":"goadwharry","id":94608,"avatar_url":"https://avatars.githubusercontent.com/u/94608?v=3","gravatar_id":"","url":"https://api.github.com/users/goadwharry","html_url":"https://github.com/goadwharry","followers_url":"https://api.github.com/users/goadwharry/followers","following_url":"https://api.github.com/users/goadwharry/following{/other_user}","gists_url":"https://api.github.com/users/goadwharry/gists{/gist_id}","starred_url":"https://api.github.com/users/goadwharry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goadwharry/subscriptions","organizations_url":"https://api.github.com/users/goadwharry/orgs","repos_url":"https://api.github.com/users/goadwharry/repos","events_url":"https://api.github.com/users/goadwharry/events{/privacy}","received_events_url":"https://api.github.com/users/goadwharry/received_events","type":"User","site_admin":false},"created_at":"2015-02-13T20:16:20Z","updated_at":"2015-02-13T20:16:20Z","body":"Thanks. It looks good. I will try it on Monday when I get access to the hardware again."}}