MacBook – How to reset LAN ethernet adapter after switching the network

ethernetlightningmacbook proNetwork

I have MacBook Pro 2017. I have the very same docker hub at work and at home (moshi). Both have LAN cables attached. However, I can use only one of them: for example, when I make my work LAN working, I can't simply go home and have it home LAN working – and vice versa.

Is there a way to reset LAN adapter? I tried to disable/enable it with ifconfig; however I am not sure which adapter is one for the LAN cable? I am not getting any IP address, and I was expecting something like 169.x.x.x

EDIT: what I do now is to plug off the docker hub and then plug it on. I don't know why this matters on osx.

Best Answer

Use "Locations" in Network Preferences

enter image description here

Create a location for work and another for home. Next, set up your preferences for each location. When you switch the location it will automatically reset your adapters and apply the new configuration.