Step-by-Step Instructions:
For CentOS 7 Servers:
CentOS 7 typically uses the traditional network-scripts system.
- Access the server via SSH.
- Open your network interface configuration file:
sudo nano /etc/sysconfig/network-scripts/ifcfg-eth0
(If your interface is named differently, adjust accordingly — check with ip a.)
- Update or add the following lines:
IPADDR=YourNewIP
GATEWAY=YourNewGateway
Example:
IPADDR=104.160.9.50
GATEWAY=104.160.9.1
- Save and exit the file:
- Press Ctrl+X, then Y, then Enter
- Restart the network service:
sudo systemctl restart network
For CentOS 8 and CentOS Stream Servers:
CentOS 8 may use either network-scripts or NetworkManager (nmcli).
If network-scripts exist (common on hosting setups):
- Follow the CentOS 7 steps above (same commands).
If your server uses NetworkManager, follow these steps:
- Access the server via SSH.
- List the active connections:
nmcli connection show
- Edit your network connection:
nmcli connection edit YourConnectionName
- Set the new static IP:
set ipv4.addresses 104.160.9.50/24
set ipv4.gateway 104.160.9.1
set ipv4.dns 8.8.8.8,8.8.4.4
set ipv4.method manual
save
quit
- Restart networking:
sudo systemctl restart NetworkManager
Important Reminders:
- Ensure you enter IP addresses and gateways correctly to avoid disconnection.
- Always keep a console (IPMI/KVM) access ready if available, in case network access is lost.
- If unsure, contact your hosting support for confirmation before applying changes.
Need Assistance?
If you face any issues while updating the IP, feel free to open a support ticket via your client portal — we are here to help!
OffshoreDedicated.NET
Privacy Made Easy