Create Multiple IP Addresses to One Single Network Interface

If you have any questions or problems regarding this article and want help within 24 Hours? Ask Now

Support TecMint: Did you find this tutorial helpful?. Please help to keep it alive by donating. Every cent counts! - Donate Now

Narad Shrestha

He has over 10 years of rich IT experience which includes various Linux Distros, FOSS and Networking. Narad always believes sharing IT knowledge with others and adopts new technology with ease.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

Receive Your Free Complimentary eBook NOW! -

Download Free Linux eBooks

Advanced Bash-Scripting Guide
Linux Bible
A Newbie's Getting Started Guide to Linux
Introduction to Linux - A Hands on Guide

You may also like...

49 Responses

  1. kashu says:

    typo…

    [root@ctos67 ~]# ip a s eth0
    2: eth0: mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 52:54:00:1c:9e:77 brd ff:ff:ff:ff:ff:ff
    inet 192.168.123.2/24 brd 192.168.123.255 scope global eth0
    inet6 fe80::5054:ff:fe1c:9e77/64 scope link
    valid_lft forever preferred_lft forever

    [root@ctos67 ~]# for i in {10..20}; do ip a a 192.168.123.${i}/24 dev eth0:$i; done
    [root@ctos67 ~]# ip a s eth0
    2: eth0: mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 52:54:00:1c:9e:77 brd ff:ff:ff:ff:ff:ff
    inet 192.168.123.2/24 brd 192.168.123.255 scope global eth0
    inet 192.168.123.10/24 scope global secondary eth0
    inet 192.168.123.11/24 scope global secondary eth0
    inet 192.168.123.12/24 scope global secondary eth0
    inet 192.168.123.13/24 scope global secondary eth0
    inet 192.168.123.14/24 scope global secondary eth0
    inet 192.168.123.15/24 scope global secondary eth0
    inet 192.168.123.16/24 scope global secondary eth0
    inet 192.168.123.17/24 scope global secondary eth0
    inet 192.168.123.18/24 scope global secondary eth0
    inet 192.168.123.19/24 scope global secondary eth0
    inet 192.168.123.20/24 scope global secondary eth0
    inet6 fe80::5054:ff:fe1c:9e77/64 scope link
    valid_lft forever preferred_lft forever

    [root@ctos67 ~]# for i in {10..20}; do ip a d 192.168.123.${i}/24 dev eth0:$i; done
    [root@ctos67 ~]# ip a s eth0
    2: eth0: mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 52:54:00:1c:9e:77 brd ff:ff:ff:ff:ff:ff
    inet 192.168.123.2/24 brd 192.168.123.255 scope global eth0
    inet6 fe80::5054:ff:fe1c:9e77/64 scope link
    valid_lft forever preferred_lft forever

  2. kashu says:

    I’d like to use ip command to temporarily create multiple ip address.

    for i in {0..10}; do ip a a 192.168.123.${i}/24 dev eth0:${i}; done

  3. akhil says:

    easy way is to use the command in centos
    ifconfig eth0:1 192.168.0.101

Leave a Reply

Your email address will not be published. Required fields are marked *

Join Over 95000+ Linux Users
  1. 66,682
  2. 3,836
  3. 31,647

Enter your email to get latest Linux Howto's