Assign Multiple Secondary IPs on Different Operating Systems

Networking

Assign Multiple Secondary IPs on Different Operating Systems

Linux (RHEL / CentOS / Alma Linux / Rocky Linux)

Method 1: Permanent Configuration (Alma Linux 8/9, Rocky Linux 8/9)

Edit the network configuration:

Bash
nmcli connection modify eth0 +ipv4.addresses 192.168.1.101/24
nmcli connection modify eth0 +ipv4.addresses 192.168.1.102/24
nmcli connection modify eth0 +ipv4.addresses 192.168.1.103/24
nmcli connection up eth0

Verify:

Bash
nmcli connection show eth0
ip addr show eth0

Ubuntu 20.04 / 22.04 / 24.04

Edit Netplan configuration:

Bash
nano /etc/netplan/00-installer-config.yaml

Example:

Bash
network:
version: 2
ethernets:
ens18:
addresses:
– 192.168.1.100/24
– 192.168.1.101/24
– 192.168.1.102/24
– 192.168.1.103/24
gateway4: 192.168.1.1
nameservers:
addresses:
– 8.8.8.8
– 1.1.1.1

Apply:

Bash
netplan generate
netplan apply

Verify:

Bash
ip addr

Debian 11 / 12

Edit:

Bash
nano /etc/network/interfaces

Example:

Bash

auto ens18
iface ens18 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
auto ens18:0
iface ens18:0 inet static
address 192.168.1.101
netmask 255.255.255.0
auto ens18:1
iface ens18:1 inet static
address 192.168.1.102
netmask 255.255.255.0
auto ens18:2
iface ens18:2 inet static
address 192.168.1.103
netmask 255.255.255.0

Restart networking:

Bash
systemctl restart networking

Assign Multiple Secondary IPs on Windows Server 2016 / 2019 / 2022 / 2025

Method:  GUI Method

  • Open Network Connections
  • Right-click Network Adapter → Properties
  • Select Internet Protocol Version 4 (TCP/IPv4)Properties
  • Click Advanced
  • Under IP addresses, click Add
  • Add each secondary IP:
    192.168.1.101
    192.168.1.102
  • Click OK

PowerShell Method

PowerShell
New-NetIPAddress -InterfaceAlias “Ethernet” -IPAddress 192.168.1.101 -PrefixLength 24
New-NetIPAddress -InterfaceAlias “Ethernet” -IPAddress 192.168.1.102 -PrefixLength 24
New-NetIPAddress -InterfaceAlias “Ethernet” -IPAddress 192.168.1.103 -PrefixLength 24

Verify:

PowerShell
Get-NetIPAddress