Sample Header Ad - 728x90

Using command line to switch On/Off IPv4 or IPv6 network on macOS

4 votes
1 answer
357 views
I'm looking for a way to switch On/Off IPv4 or IPv6 network from command line on macOS. Like the description here: https://apple.stackexchange.com/questions/7931/can-i-turn-off-ipv4-and-just-use-ipv6-on-my-mac one can turn On/Off IPv4 on macOS using the GUI. However, I'm trying to manage multiple Mac mini remotely, and therefore, would like to do the task from command line. In my case particularly, I'm able to access the macOS client via VNC viewer, which only support IPv4. Therefore, after disable the IPv4 from GUI via VNC session, I only have access to the client via IPv6 by using SSH. So, if this cannot be done via command line, I'll not able to recover the IPv4 unless I have access to that machine locally. So, I am looking forward for the command line that I can use to enable IPv4 on Mac, or even further, switch On/Off IPv6 network as well.
Asked by Weishan Yang (145 rep)
Apr 30, 2025, 09:46 AM
Last activity: May 1, 2025, 03:24 PM