Create Multiple IP Addresses to One Single Network Interface

Download all articles in PDF format with our TecMint Content Subscription and Linux Support Services starting at $39 per month.

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...

55 Responses

  1. ashwin says:

    when i try to make the files using ” cp ifcfg-eth0 ifcfg-eth0:0″
    it is showing me permission denied. pls help

    • Ravi Saive says:

      @Ashwin,

      I hope you running that command as root user, if not switch to root user and execute, it needs root privileges to execute that command.

  2. rajesh says:

    how many ips we can create using ip alisasing??

  3. dilip says:

    Please tell me how to add route permanently in linux

    • Ravi Saive says:

      @Dilip,

      To add a permanent static route on CentOS, RHEL or Fedora distributions, use the following command.

      # echo "192.168.10.0/16 via 192.168.5.5" >> /etc/sysconfig/network-scripts/route-eth0
      

      If you’re using Debian or Ubuntu distribution, try to run the following command to add a static route permanently.

      # echo "up route add -net 192.168.10.0/16 gw 192.168.5.5 dev eth0" >> /etc/network/interfaces
      

      Don’t forget to replace the IP address with your route IP address

  4. 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

  5. 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

  6. akhil says:

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

Got something to say? Join the discussion.

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

Join Over 95000+ Linux Users
  1. 77,543
  2. 4,213
  3. 35,218

Enter your email to get latest Linux Howto's