22

When in the office, I'm connected to a 192.168.1.0/24 network. When Internet Sharing is off, the first entry of netstat -nr is

default            192.168.1.254      UGSc           10       62     en0

If I turn Internet Sharing on, it shows

default            link#5             UCS             2        0     en1

This is obviously incorrect and breaks all connectivity of my machine.

en1 is my wireless connection, whereas en0 is my Ethernet. If I then disable Internet Sharing, it even deletes the new incorrect route, so I'm left with no default route at all.

When I share, or after disabling Internet Sharing, I run this script:

route delete default
route add default 192.168.1.254

That fixes everything, but I'd love to know what's actually making this happen and how to properly fix it.

And just to say that at some point a few months ago, this was working absolutely perfectly, with no hitches, then one day when I brought the laptop home, I couldn't disable the internet sharing, so I couldn't connect to my home WiFi. I eventually had to restart the machine and since then this problem has been happening.

4
  • 3
    +1 just for a good description if the problem.
    – Hennes
    Commented Sep 17, 2013 at 16:30
  • In the Network settings, check the ordering of the different interfaces. It may be that the interface you are sharing with has a higher priority than the interface the indented default gateway is on.
    – jornane
    Commented May 15, 2014 at 20:47
  • Just curious, does the same thing happen on a different machine?
    – Mastaxx
    Commented Sep 4, 2023 at 17:12
  • Might do @Mastaxx, can't tell you now though as everything from the setup described in the question nearly 11 years ago is no more :D
    – seaders
    Commented Sep 5, 2023 at 20:25

2 Answers 2

0

If I understand correctly at the office you're sharing Internet connection over Wi-Fi, while at home you just want a plain Internet access over Wi-Fi, am I right?

Try creating another Wi-Fi interface for home access in System Preferences > Network > + button at the bottom of the list of network interfaces. Then use Wi-Fi 1 for Internet Sharring at your office and Wi-Fi 2 for Internet access at home.

Another thing that may be happenning here is subnets conflict, if it really occurs, try running the following command to change default ICS subnet (replace 192.168.x.0 in the address to some unused subnet range):

sudo defaults write
/Library/Preferences/SystemConfiguration/com.apple.nat
NAT -dict-add SharingNetworkNumberStart 192.168.x.0
-2

I don't know if it's directly related, but your setup is wrong. That could be why the config is resetting.

On your 'internal' interface you're manually setting the IP address to 192.168.1.254/255.255.255.0, and that's fine, but this interface should have NO router address specified. In your case you've set the router address to the server itself, which is never going to be accurate.

Secondly, the DHCP settings don't have a router address set. This means that your DHCP server will hand out addresses to clients, but won't tell them how to get to the outside world. Hardly seems appropriate to me.

In your DHCP settings you should set the router address to the address of your NAT server (in this case 192.168.1.254).

Try those fixes and see if it makes any difference.

1
  • Nope, none of this is true. Everything was fully DHCP only, and the only time anything was ever set manually was when something wasn't working and just an effort was made to get it back working. As for now, this is an old question, and I no longer use the same OS, laptop, network or Internet Sharing any more, so this ain't an issue!
    – seaders
    Commented Aug 30, 2014 at 22:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .