You can modify the IP address of an Ubuntu Nic in two ways.
The first method is static modification.
Go to the/etc/Network/directory and modify the interfaces file.
# The primary network interface
Auto eth0
Iface eth0 Inet static
Address 110. 25 .*.*
Netmask 255.255.255.0
Gateway 110. 25. *. 1
# Auto eth0: 0
# Iface eth0: 0 Inet static
# Address 110. 25 .*.*
# Netmask 255.255.255.0
I added the blue part. eth0: 0 is similar to the array subscript. next, you can bind multiple objects, and so on. eth0: 1, eth0: 2, eth0: 3 ........
The second method is dynamic modification.
Use the ifconfig command
Sudo ifconfig eth0: 0 110. 25. *. * broadcast 110. 25. *. 255 netmask 255.255.255.0
Note:
The first method will not expire after you modify and restart the instance. If this method is slightly improper, remote connection will fail.
The second method takes effect only for the moment and will expire after restart, but will not cause inconvenience to you due to improper operations.
Run the ifconfig command to check the modification.
Eth0
Eth0: 0 (one more eth0: 0, check whether it is the same as the gateway of eth0)
Lo