Is it possible, either via the command line or C code using the sysctl/fcntl/etc. APIs, to disable IPv6 router solicitations, router advertisement acceptance, etc. on OSX for a specific interface? It seems possible via sysctl from the command line, but only system-wide.

The Linux sysctl equivalent is:

sysctl net.ipv6.conf.<ifname>.autoconf=0
sysctl net.ipv6.conf.<ifname>.accept_ra=0
sysctl net.ipv6.conf.<ifname>.accept_redirects=0
sysctl net.ipv6.conf.<ifname>.router_solicitations=0

(The last is redundant, probably unnecessary.)

On Linux this does it for one interface, but not all interfaces.

I don't want to disable link-local addressing or prevent a manual configuration using ifconfig, just to get OSX to disable and ignore IPv6 router autoconf stuff.


You can get a list of interfaces with:

networksetup -listallnetworkservices

And then shut it off on a per interface basis:

networksetup -setv6off "Ethernet 1"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.