# Adding multiple IP addresses on CentOS

Source: <https://beta.dedicated.com.tr/en/kb/adding-multiple-ip-addresses-on-centos>  
Last updated: 2026-11-28

To assign more than one IP address to a CentOS server or virtual server, you can use this method.

1. Open the `rc.local` file:

   ```bash
   nano /etc/rc.local
   ```

2. Add one line for each IP address you want to add (example):

   ```bash
   /sbin/ifconfig eth0:1 192.168.1.2 netmask 255.255.255.0
   /sbin/ifconfig eth0:2 192.168.1.3 netmask 255.255.255.0
   /sbin/ifconfig eth0:3 192.168.1.4 netmask 255.255.255.0
   ```

   **Note:** do not add the main IP address to this list.

3. Save the file and exit.
4. Run these commands:

   ```bash
   chmod 777 /sbin/ifconfig
   reboot
   ```

When the server restarts, all your IP addresses will have been added.
