How to remove cached network information from Apple device?
You have to release the IP address, not just renew it. This is because your DCHP client is going to attempt to request the lease it had previously so long as it hasn't expired. You have to force the client to ask for a new lease.
$ sudo ipconfig set <interface> BOOTP
$ sudo ipconfig set <interface> DHCP
Additionally, you can use the networksetup
command
$ networksetup -setdhcp <networkservice>
$ networksetup -setbootp <networkservice>
You would get the networkservice by issuing the command:
$ networksetup -listallnetworkservices
Of course, you could also do this in Network Preferences