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.
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 the Control panel, on the top menu, click Products and select Cloud Servers.
-
Open the server page → Ports tab.
-
From the port's menu, select Make Default Gateway.
-
From the server's menu, select Program Restart.
-
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 to be made the default gateway, e.g.192.168.0.5
;<server>
— The ID or name of the cloud server can be viewed with the commandopenstack server list
.
-
Perform a programmatic reboot of the server:
openstack server reboot <server>
Specify
<server>
— server ID or name. The list of servers can be viewed using theopenstack server list
command.