{"id":1577,"date":"2024-06-05T16:57:36","date_gmt":"2024-06-05T14:57:36","guid":{"rendered":"https:\/\/www.mcgill.org.za\/stuff\/?p=1577"},"modified":"2024-06-05T16:57:36","modified_gmt":"2024-06-05T14:57:36","slug":"workaround-for-neighbour-discovery-failure-for-static-configured-ipv6-on-linux-use-ipv4-gateway-mac-for-ipv6","status":"publish","type":"post","link":"https:\/\/www.mcgill.org.za\/stuff\/archives\/1577","title":{"rendered":"Workaround for Neighbour Discovery failure, for static-configured IPv6 on Linux: Use IPv4 gateway mac for IPv6"},"content":{"rendered":"\n<p>Here&#8217;s a shell script to figure out what the IP4 gateway MAC address is, and to set that as the IP6 gateway MAC:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#! \/bin\/bash\n\n# Get the v4 gateway IP address\nV4GW=$( ip route get 1 | sed 's\/.* via \/\/; s\/ .*\/\/; q' )\n# Get the MAC address for that\nV4MAC=$( ip neigh | grep -F -w \"$V4GW\" | sed 's\/.* lladdr \/\/; s\/ .*\/\/'; )\n# Get the IPv6 gateway IPv6 address\nV6GW=$( ip r g 1:: | sed 's\/.* via \/\/; s\/ .*\/\/; q' )\n# Check if the IPv6 gateway is in IP6-Neighbour-Discovery failure\nif ip n | grep -wF \"$V6GW\" | egrep -q 'INCOMPLETE|FAILED' ; then\n # Get the ip neigh&#91;bour] string, e.g. dev eth0 lladdr 00:01:02:00:ff:ee \n NEIGHBOUR=$(  ip neigh | grep -wF \"$V6GW\" | sed 's\/  *\\(INCOMPLETE\\|FAILED\\).*\/\/' )\n # delete the failed neighbour discovery\n ip neigh del $NEIGHBOUR\n # delete add a static neighbour\n ip neigh add $NEIGHBOUR lladdr $V4MAC\nfi<\/code><\/pre>\n\n\n\n<p>This was necessary for a machine where the gateway decided that responding to neighbour solicit requests was optional.  (Still don&#8217;t know why it felt like that.)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s a shell script to figure out what the IP4 gateway MAC address is, and to set that as the IP6 gateway MAC: This was necessary for a machine where the gateway decided that responding to neighbour solicit requests was &hellip; <a href=\"https:\/\/www.mcgill.org.za\/stuff\/archives\/1577\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":null,"sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[310,314,311,313,312,33,190],"class_list":["post-1577","post","type-post","status-publish","format-standard","hentry","category-stuff","tag-ipv6","tag-neighbor-discovery","tag-neighbor-solicit","tag-neighbour-discovery","tag-neighbour-solicit","tag-networking","tag-stuff"],"_links":{"self":[{"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/posts\/1577","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/comments?post=1577"}],"version-history":[{"count":1,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/posts\/1577\/revisions"}],"predecessor-version":[{"id":1578,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/posts\/1577\/revisions\/1578"}],"wp:attachment":[{"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/media?parent=1577"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/categories?post=1577"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/tags?post=1577"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}