There was a problem loading the comments.

How to Set a Static IP on Your VPS

Support Portal  »  Knowledgebase  »  Viewing Article

  Print

EZSCALE VPS uses DHCP by default to assign your IP address. If DHCP isn't working or you need to configure your IP manually, follow this guide.

 

Find Your Network Details

Before you start, get your IP information from the VirtFusion panel:

  1. Log in and select your VPS.
  2. Go to the Network tab.
  3. Note your IPv4 address, subnet mask/prefix, gateway, and IPv6 address (if assigned).

 

Ubuntu / Debian (Netplan)

Edit (or create) the netplan configuration file:

nano /etc/netplan/50-cloud-init.yaml

 

Replace the contents with the following template. Substitute your actual values:

network:
  version: 2
  ethernets:
    eth0:
      addresses:
        - 192.0.2.10/24
        - "2001:db8::10/48"
      routes:
        - to: default
          via: 192.0.2.1
        - to: default
          via: "2001:db8::1"
          on-link: true
      nameservers:
        addresses:
          - 8.8.8.8
          - 8.8.4.4
          - "2001:4860:4860::8888"
          - "2001:4860:4860::8844"

Important notes:

  • Replace eth0 with your actual interface name (check with ip a — it might be ens3 or similar).
  • The IPv6 gateway entry must include on-link: true because the gateway is on a different /64 subnet.
  • IPv6 addresses in YAML should be wrapped in quotes.

Secure the file and apply:

chmod 600 /etc/netplan/50-cloud-init.yaml
sudo netplan apply

 

AlmaLinux / Rocky Linux (NetworkManager)

Use nmcli to configure your static IP. Replace the example values with your own:

# Set IPv4 static configuration
nmcli con mod "System eth0" ipv4.addresses "192.0.2.10/24"
nmcli con mod "System eth0" ipv4.gateway "192.0.2.1"
nmcli con mod "System eth0" ipv4.dns "8.8.8.8,8.8.4.4"
nmcli con mod "System eth0" ipv4.method manual

# Set IPv6 static configuration
nmcli con mod "System eth0" ipv6.addresses "2001:db8::10/48"
nmcli con mod "System eth0" ipv6.gateway "2001:db8::1"
nmcli con mod "System eth0" ipv6.dns "2001:4860:4860::8888,2001:4860:4860::8844"
nmcli con mod "System eth0" ipv6.method manual

# Apply changes
nmcli con up "System eth0"

 

Note: Your connection name might differ. Run nmcli con show to list available connections and use the correct name.

 

Disable Cloud-Init Network Override

Cloud-init may overwrite your manual network config on reboot. To prevent this:

mkdir -p /etc/cloud/cloud.cfg.d
cat > /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg <<EOF
network: {config: disabled}
EOF

 

Test Your Configuration

After applying, verify everything works:

# Test IPv4
ping -c 3 8.8.8.8

# Test IPv6
ping6 -c 3 2001:4860:4860::8888

# Test DNS
ping -c 3 google.com

# Verify your IP config
ip a

If you lose connectivity after applying the static IP, use the VNC console to access your VPS and correct the configuration.


Share via
Did you find this article useful?  

Related Articles


Comments

Add Comment

Replying to  

© EZSCALE Hosting, LLC