Fix MacOS not assigning a correct IP address

Often times, especially on enterprise 802.1X networks, MacOS’s DHCP will exert extremely buggy behavior and fail to assign a good IPv4 address to a computer. Often, it can persist across logouts and reboots of the system. The TCP/IP behavior can be refreshed by deleting a few plist configuration files. Execute the following shell commands to fix the issue:

sudo sh
cd /Library/Preferences/SystemConfiguration/
rm preferences.plist com.apple.airport.preferences.plist NetworkInterfaces.plist

Rebooting the system will immediately fix the issue.