Detach & Attach interface on a Ubuntu instance

Guide on how to detach and attach a network interface on a Ubuntu instance

Overview

If you need to change interface on a Ubuntu instance, then this is the procedure to use.

  1. Run the following command in the instance.

     sudo cloud-init clean
    
  2. Shut down the instance

  3. Detach / Attach the network interface

  4. Start the instance

  5. Reassociate Floating IP with the instance

Last modified April 22, 2024: added useful options (#171) (7e11b10)