Menu Close

How to Configure Multiple IP Addresses on One Server (Step-by-Step)

When you first set up a server, configuring a single IP address is usually enough to get you started. But as your network grows — maybe you’re running multiple websites, containerized apps, or mail services — a single IP address can start feeling limiting.

That’s when knowing how to configure multiple IP addresses becomes incredibly useful.

Whether you’re a system administrator managing multiple virtual hosts or just experimenting with network configurations on your home server, this guide walks you through the why, when, and how of assigning multiple IP addresses to a single network interface — across Linux and Windows systems.

Let’s dive in.


Why Configure Multiple IP Addresses?

Before we get technical, let’s cover the big picture. Why would anyone need more than one IP address on a server?

Common Use Cases:

  • Hosting multiple SSL websites on the same server

  • Running multiple containers or virtual machines

  • Configuring email services with dedicated IPs

  • Load balancing and redundancy setups

  • Network segmentation for improved security

  • Development environments with multiple isolated services

It’s a simple concept, but it unlocks a ton of flexibility in how you manage traffic, services, and scalability.


How It Works: The Basics

Your server typically has one network interface (like eth0 or ens33). That interface can be assigned more than one IP address — either:

  • Manually (static assignment)

  • Via DHCP (if supported by your network)

Most modern operating systems allow IP aliasing, which lets you bind multiple addresses to the same NIC. You can configure them temporarily (until reboot) or permanently (survive reboots via config files).

Now, let’s break down how to do this.


Configuring Multiple IP Addresses on Linux

Let’s start with Linux — one of the most common server OS choices.

We’ll cover two major methods:

  • Using command line tools (temporary)

  • Editing network configuration files (permanent)


Method 1: Temporary IP Assignment via Command Line

This is useful for quick tests or temporary setups.

Step-by-Step Example (Ubuntu/Debian):

sudo ip addr add 192.168.1.101/24 dev eth0
  • 192.168.1.101 is the new IP you’re adding.

  • /24 is the subnet mask (same as 255.255.255.0).

  • eth0 is your network interface.

You can verify with:

ip addr show eth0

You’ll see both IPs now listed under the same interface.

Important: This will disappear after reboot.


Method 2: Permanent IP Assignment (Ubuntu/Debian)

To make the changes survive reboot:

For Netplan (Ubuntu 18.04+):

Edit the Netplan config file, usually found in /etc/netplan/:

network:
  version: 2
  ethernets:
    eth0:
      dhcp4: no
      addresses:
        - 192.168.1.100/24
        - 192.168.1.101/24
      gateway4: 192.168.1.1
      nameservers:
        addresses: [8.8.8.8, 1.1.1.1]

Apply changes with:

sudo netplan apply

For Legacy Systems (ifupdown):

Edit /etc/network/interfaces:

auto eth0
iface eth0 inet static
    address 192.168.1.100
    netmask 255.255.255.0
    gateway 192.168.1.1

auto eth0:0
iface eth0:0 inet static
    address 192.168.1.101
    netmask 255.255.255.0

Restart networking:

sudo systemctl restart networking

Now you have two IPs assigned permanently!


Bonus: CentOS/RHEL

Edit the interface configuration file:

sudo nano /etc/sysconfig/network-scripts/ifcfg-eth0:0

Add:

DEVICE=eth0:0
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.1.101
NETMASK=255.255.255.0

Restart network:

sudo systemctl restart network

You can add more alias files like eth0:1, eth0:2, etc.


Configuring Multiple IPs on Windows

Yes, you can assign multiple IPs to a Windows machine too. It’s just as easy — no scripting needed.

Step-by-Step:

  1. Go to Control Panel > Network and Sharing Center

  2. Click on Change adapter settings

  3. Right-click your active network adapter → Properties

  4. Select Internet Protocol Version 4 (TCP/IPv4) → Click Properties

  5. Click Advanced…

  6. Under IP Addresses, click Add…

  7. Enter the additional IP and subnet. Click OK.

That’s it! Your Windows server or desktop can now respond to multiple IPs.


Verify It’s Working

On Linux:

ip a
ping 192.168.1.101

On Windows:

ipconfig
ping 192.168.1.101

Make sure the new IP responds and is reachable from the network.


Configuring Services to Use Multiple IPs

After setting up multiple IPs, you can bind different services to different IPs. Examples:

Nginx:

server {
    listen 192.168.1.100:80;
    server_name site-one.com;
    ...
}

server {
    listen 192.168.1.101:80;
    server_name site-two.com;
    ...
}

Apache:

<VirtualHost 192.168.1.100:80>
    ServerName site-one.com
    ...
</VirtualHost>

<VirtualHost 192.168.1.101:80>
    ServerName site-two.com
    ...
</VirtualHost>

This is how shared servers host multiple websites on the same machine with different IPs.


Security Considerations

While setting up multiple IPs can be powerful, keep security in mind:

  • Use firewalls like UFW, iptables, or firewalld to restrict traffic per IP

  • Ensure each service listens only on the necessary IPs

  • Avoid exposing unnecessary services to the public

You can also assign internal-only IPs for private traffic between containers or services — this can improve both performance and security.


Troubleshooting Tips

If new IPs don’t work:

  • Check for typos in config files

  • Restart networking or the system

  • Use ping, curl, and telnet to test connectivity

  • Ensure no IP conflicts on the network


Final Thoughts: Mastering IP Flexibility

Knowing how to configure multiple IP addresses on a single server isn’t just a sysadmin trick — it’s a practical skill that improves how you manage your infrastructure.

From running multiple websites and Docker containers to creating secure, segmented networks, multiple IPs unlock new possibilities for control, performance, and organization.

If you’re working on a server that hosts more than one service — or planning to — this is one configuration trick that’s 100% worth learning.


Ready to scale your hosting setup?
Start with a VPS that supports custom IP configurations and gives you root access. Whether you’re on Linux or Windows, multiple IPs can take your architecture from basic to professional.


 

Let me know if you’d like this turned into a downloadable PDF, email newsletter, or infographic for your website!