Configure the default gateway for the cloud server
Configure the default gateway for the cloud server
If multiple network interfaces are used on the cloud server, you can assign a specific interface as the default gateway.
note
For example, a cloud server has two network interfaces: the first is the IP address of the private subnet, and the second is the IP address of the public subnet to access the Internet. The first interface can be used as the default network interface, then the server will not have access to the Internet. To change the interface to the second (public) interface, you must set the public subnet port as the default gateway for the cloud server.
Control panel
OpenStack CLI
- In control panels go to Cloud platform → Servers.
- Open the server page → tab Ports.
- On the menu. of the port select Make it the default gateway.
- Perform a programmatic reboot of the server.
-
Configure the default gateway for the cloud server:
openstack server set \
--property x_sel_server_default_addr='{"ipv4":"<gateway>"}' \
<server>Specify:
<gateway>
— The IP address of the port you want to make the default gateway, e.g.192.168.0.5
;<server>
— The ID or name of the cloud server, can be viewed withopenstack server list