Change Internet Sharing subnet on Mac OS X

During one of our Support Essentials Courses a delegate asked me if it was possible to change the subnet supplied by Mac OS X default internet sharing service.

After some searching on both the system files and Google, I found that that the configuration file is located in /Library/Preferences/SystemConfiguration/

This file only gets created after you have switched internet sharing on. I’ve written this blog to show you how to change the internet sharing subnet on mac OS X. Originally the system gives out 192.168.2.* addresses and I’m now going to show you how to change it to 10.0.111.*

Original Settings

Screen Shot 2016-04-12 at 16.28.55

Now we are going to modify the file to suit our needs:

Step 1

If internet sharing is on, switch it off

Step 2

Create a backup of the config file just in case something goes wrong: open the terminal app and copy file to desktop:
sudo cp /Library/Preferences/SystemConfiguration/ ~/Desktop.

Step 3

Now let’s make the changes: to make it easier, continue using Terminal but this time, use defaults command. We need to add 3 lines:
sudo defaults write /Library/Preferences/SystemConfiguration/ NAT -dict-add SharingNetworkNumberStart
sudo defaults write /Library/Preferences/SystemConfiguration/ NAT -dict-add SharingNetworkNumberEnd
sudo defaults write /Library/Preferences/SystemConfiguration/ NAT -dict-add SharingNetworkMask

Step 4

Turn internet sharing ON and test. You should get something that looks like this:
Screen Shot 2016-04-12 at 17.10.39

4 Replies to "Change Internet Sharing subnet on Mac OS X"

  • I like this…but I was looking at the encryption strength keylength.




    Is there a way to make it a bit stronger? If I manipulate the BitEncrypt will I kill anything?:

  • High Sierra hard codes the defaults to, and resets them whenever you turn the service on.

  • You should advertise this more. I should have known this years ago. I have lost so much time on sharing networks that sometimes worked and then they did not. This is especially handy for people doing embedded computing with the Apple as in-between to the internet.

    Thanks a lot, Hans.

Leave a Reply

Your email address will not be published. Required fields are marked *

I accept the Privacy Policy