Title: Service discovery on specific IPv6 interface · Issue #1132 · python-zeroconf/python-zeroconf · GitHub
Open Graph Title: Service discovery on specific IPv6 interface · Issue #1132 · python-zeroconf/python-zeroconf
X Title: Service discovery on specific IPv6 interface · Issue #1132 · python-zeroconf/python-zeroconf
Description: Not sure if this is a bug or I am using the API wrong. Please advise. This is all IPv6-only network. I have a host with say three network interfaces : eth0, eth1 and eth2 - and I want to listen to advertisements coming only from eth1. My...
Open Graph Description: Not sure if this is a bug or I am using the API wrong. Please advise. This is all IPv6-only network. I have a host with say three network interfaces : eth0, eth1 and eth2 - and I want to listen to ...
X Description: Not sure if this is a bug or I am using the API wrong. Please advise. This is all IPv6-only network. I have a host with say three network interfaces : eth0, eth1 and eth2 - and I want to listen to ...
Opengraph URL: https://github.com/python-zeroconf/python-zeroconf/issues/1132
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Service discovery on specific IPv6 interface","articleBody":"Not sure if this is a bug or I am using the API wrong. Please advise. This is all IPv6-only network.\r\nI have a host with say three network interfaces : `eth0`, `eth1` and `eth2` - and I want to listen to advertisements coming only from `eth1`.\r\n\r\nMy service listener is based on `browser.py` example. The api calls look something like this:\r\n```\r\nclass ZeroconfListener:\r\n \"\"\"Class for zeroconf to populate\"\"\"\r\n\r\n def remove_service(self, _zeroconf, service_type, name):\r\n \"\"\"Called when zeroconf when a service is nolonger available\"\"\"\r\n do stuff\r\n\r\n def add_service(self, zeroconf, service_type, name):\r\n \"\"\"Called when zeroconf when a service becomes available\"\"\"\r\n do stuff\r\n\r\n def update_service(self, *_):\r\n \"\"\"Called internally by Zeroconf.\"\"\"\r\n not needed. do nothing\r\n\r\nzeroconf = Zeroconf(ip_version=IPVersion.V6Only, interfaces=[addr_of_eth1])\r\nservices = [\"_device-info._tcp.local.\"]\r\nServiceBrowser(zeroconf, services, ZeroconfListener())\r\n\r\nwhile True: # wait forever\r\n time.sleep(60)\r\n```\r\n\r\nThe problem is, I only want to listen to advertisements coming from `eth1` but this seems to listen to all the interfaces. I can verify this by publishing a `_device-info._tcp.local` service from a machine connected on `eth0` subnet. I suspect that is because I am not using `unicast` argument when initialising `Zeroconf` class, and this line puts a listener on all the interfaces: https://github.com/python-zeroconf/python-zeroconf/blob/18b3cd7176631069e3203f966c0addac75503345/src/zeroconf/_utils/net.py#L358\r\n\r\nTL;DR Question is, how do I restrict zeroconf to a specific interface? Is this a supported use case?\r\n","author":{"url":"https://github.com/lokesh2019","@type":"Person","name":"lokesh2019"},"datePublished":"2023-02-15T16:46:19Z","url":"https://github.com/python-zeroconf/python-zeroconf/issues/1132"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d97b68be-857d-03d1-426c-4176803a3323 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E32A:C25F6:B00B:ECC2:6B007D36 |
| html-safe-nonce | 17c7d7fc0c4673457a6d56525323353a21c211181b796a3bc089742fb390b56e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMzJBOkMyNUY2OkIwMEI6RUNDMjo2QjAwN0QzNiIsInZpc2l0b3JfaWQiOiI2MzEzNjIzNTM5MTkwNjI3NjM4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 20742ae0d4471f68b37fa2a3e91bce929525fef0e6f44a65d7f171e44bbb5649 |
| hovercard-subject-tag | issue:1586195596 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-zeroconf/python-zeroconf/1132/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ae3d0f7e7ceb300334e68bd7487887cc3aeb79664d8492a996900c4d4e664b5e/python-zeroconf/python-zeroconf/issues/1132 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ae3d0f7e7ceb300334e68bd7487887cc3aeb79664d8492a996900c4d4e664b5e/python-zeroconf/python-zeroconf/issues/1132 |
| og:image:alt | Not sure if this is a bug or I am using the API wrong. Please advise. This is all IPv6-only network. I have a host with say three network interfaces : eth0, eth1 and eth2 - and I want to listen to ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | lokesh2019 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 82c186f13e104004ab7bdb779f3195e59dd38bfde531aaa74b76470fc2462b83 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-zeroconf/python-zeroconf git https://github.com/python-zeroconf/python-zeroconf.git |
| octolytics-dimension-user_id | 120192235 |
| octolytics-dimension-user_login | python-zeroconf |
| octolytics-dimension-repository_id | 21548731 |
| octolytics-dimension-repository_nwo | python-zeroconf/python-zeroconf |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 21548731 |
| octolytics-dimension-repository_network_root_nwo | python-zeroconf/python-zeroconf |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d1bc2aa1939001689f5ce935982c10a6138f745c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width