Hostxpeed
Login Get Started →
Server Management

How to Set Up Static IP

4 min read
23 views
Jun 10, 2026

Prerequisites

Before setting up static IP, make sure you have:

  • SSH access to your VPS
  • Static IP details (IP, netmask, gateway, DNS) from Hostxpeed support
  • Root or sudo privileges

⚠️ Incorrect static IP configuration will disconnect your SSH session. Have console access ready (via Hostxpeed portal).

Step 1: Gather Network Information

Contact Hostxpeed support for:

  • Static IP address
  • Subnet mask / prefix length
  • Default gateway
  • DNS servers

Step 2: Configure Static IP (Ubuntu/Debian Netplan)

sudo nano /etc/netplan/01-netcfg.yaml

Change from DHCP to static:

network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      addresses:
        - YOUR_STATIC_IP/24
      routes:
        - to: default
          via: YOUR_GATEWAY
      nameservers:
        addresses: [8.8.8.8, 8.8.4.4]

Apply:

sudo netplan apply

Step 3: Configure Static IP (CentOS/Rocky)

sudo nano /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
IPADDR=YOUR_STATIC_IP
NETMASK=255.255.255.0
GATEWAY=YOUR_GATEWAY
DNS1=8.8.8.8
DNS2=8.8.4.4

Restart network:

sudo systemctl restart network

Step 4: Verify Configuration

ip addr show eth0
ip route show
ping -c 3 8.8.8.8

✅ Static IP configured. Your VPS now uses a fixed IP address.

Was this article helpful?