Best method to disabling ipv6?

rcurran
Contributor

Couldn't seem to find it in managed prefs or config profiles.

Thanks!

6 REPLIES 6

tron_jones
Release Candidate Programs Tester

Use a script in a policy to turn it off. Set the policy to network state changed and run a script that finds what service they are using and disable it.

networksetup -setv6off <network service>

winops
New Contributor

Hi, there - I need to disable IPv6 using casper and I'm a windows admin! no clue how to achieve this. I'm oretty good with powershell scripting so I thougt I would "get" it but I'm afraid I need guidance. Could you assist me in step-by-step how to disable IPv6 in Casper for all computers?

daz_wallace
Contributor III

Hey Winops,

The simplest and easiest way would be:
1) Create a new policy in Casper.
2) In the new policy, add a "Files and Processes" item. 3) In the last box ("Execute Command") add the following line:

networksetup -setv6off [network service]

4) Replace the "[network service] with the GUI name of the interface you wish to turn IPV6 off for.
Possible Valid Examples:
"Ethernet"
"Built-in Ethernet"
"Wi-Fi"
"Thunderbolt Ethernet"
5) Set the triggers as you wish. I'd possible suggest "Startup" and / or "Logout". That way you should avoid the risk of network connections reinitialising and annoying users.
6) Scope your new policy to a very small number of devices, gradely adding more once you confirm it doesn't break anything.

Oh, did I also mention, always test heavily before hitting scoping to your entire estate.

Hope that helps!

Darren

fgeronimo
New Contributor

The link below should help you with this (comment out the proxy settings for each device). I have tested this with a small group of systems (MBPs,MBAs,Mac Mini) and it worked fine for me. Like daz_dar said

Oh, did I also mention, always test heavily before hitting scoping to your entire estate

https://jamfnation.jamfsoftware.com/discussion.html?id=11649#responseChild67008

jrepasky
New Contributor III

!/bin/sh

networksetup -listallnetworkservices | sed "1 d" | while read output ;do networksetup -setv6off "$output";done

donmontalvo
Esteemed Contributor III

@jrepasky might want to add grep -v * to skip any inactive services.

For example if iPhone USB is inactive, the command won't throw an error.

--
https://donmontalvo.com