Launch the UniFi Controller and click on Launch a Browser to Manage the Network.
Click on Devices and locate the UniFi Security Gateway.
Click on the UniFi Security Gateway and then click Configuration from the right panel.
Expand the WAN tab and select between DHCP and Static depending on your ISP configuration. To save the settings, click on Queue Changes > Devices Pending Changes > Apply All.