Hmm .. So we are running out of resources and can’t buy a new ethernet card for the system. No problems, whatever the reason, we can assign two or more IP addresses to our linux box using only one NIC.

I’ll do it in Fedora.

Go to /etc/sysconfig/network-scripts/ directory
Copy ifcfg-eth0 to the same directory and name the copy as ifcfg-eth0:0.
Edit ifcfg-eth0:0 and enter your new IP address settings
And you’re done. So simple na. You can add up to 255 different IP addresses to one linux machine using this technique. Having trouble doing it? ask us now and we’re here to help you..

6 Responses to “Assigning two IP addresses to one ethernet card in Linux”

  1. Niraj kapadia.biz says:

    Hi Sanix,

    Your trick worked in Fedora 7 – however, what I needed to do is one extra step.

    After modifying the file eth0:0 in directory “/etc/sysconfig/network-scripts” I found that I could not PING with both the interfaces from another XP computer on my LAN.

    What I did is went to NETWORK GUI under ADMINISTRATION and ACTIVATE each interface individually – even though it shows as ALREADY ACTIVATED.

    Then it works great !!!

    Cheers,
    Niraj

  2. gdahl none says:

    Actually, I know this topic is old but came across it in a search.. so I thought I would throw out my way of doing it:

    vi /etc/sysconfig/network-scripts/ifcfg-eth0-range0

    Add the following:

    IPADDR_START=”192.168.1.2″
    IPADDR_END=”192.168.1.254
    CLONENUM_START=0

    So, this will tell linux to bind all Ip addresses starting at 192.168.1.2 to 192.168.1.254.. it’s a much easier way.

  3. Sanix technodigits.wordpress.com says:

    thank you so much gdahl .. I will try out your way too.. it looks so interesting..

  4. Ratheesh says:

    We have used this for our official use. Thanks to all

  5. William adexus.com says:

    Is it posible to assign two IP addresses to one bonded interface?

  6. reza beigi hrezab.blugspot.com says:

    yes . it is possible by this command :
    ifconfig eth0:1 192.168.1.2 subnet 255.255.255.0 up
    for first interface and
    ifconfig eth0:2 192.168.100.200 subnet 255.255.255.0 up
    for the other

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Incoming search terms for the article:

linux two ip addresses on one nic, linux one nic two ips, windows7 multiple IP addresses for one nic, network card two addresse, multiple ip on one ethernat, multiple ip on one eth, multiple ip address fedora eth, more ip address to one network card, linux two ip one interface, linux two diffrent ip address same card, linux to ethernet card with the same ip, linux second address to interface, linux one network card for 2 IP Addresses, linux one ethernet card two ip address, linux multiple ethernet adapters, Linux assigning two network in one interface, one ethernet card two ip linux, same ip over two ethernet card in linux, windows 7 giving dual IP address on the same card, windows 7 add ip address to interface, two ips one nic linux, two ipaddress on linux, two ip on one nettwork card linux, two ip on one eth, two ip in one net card linux, two ip adresses on one eth interface, two ip addresses on the same network card linux, two ip addresses on one linux, two ip addresses in the same network card linux, two ip address on one nic linux, two ip address on one ethernet card linux, SETTING TWO IP ADDRESS in ONE LAN card or NIC linux, settin 2 ip for 1 ethernet card in linux, linux assigning two ip addresses, linux assign two different ip to eth0, linux add second ip to eternet card, how can i assign 2 ip on same eth in windows, giving two ips to one interface in linux, giving ip in linux os, giving ip address in linux, Fedora how to assign your network card an additional IP, ethernet 2 ips, can we assign two different IP addresses to same interface, CAN WE ADD TWO DIFFERENT IP ADDRESSE TO SAME INTERFACE, assigning two different ip for same machine in linux, assigning multiple ip addresses to single ethernet, assign two IP with one machine linux, assign two ip to one linux machine, assign lan card ip address in fedora 10, assign another ip address to the eth card, 2 IP on same eth, how can I give multiple Ips on one ethernet card in linux?, How can you assign two IP addresses to one network card in linux, linux 2nd ip on same interface card, linux 2 ip same eth, linux 2 ip addresses 1 ethernet, linux 2 ip address on one computer, linux & two ip on one nic, how to assign two ips to one system linux, how to assign two ip address on one lan card in linux, how to assign several IP on one NIC fedora, how to assign multiple ip adress to ethernet adapter linux, how to assign 2 IPs in 1 nic for fedora, how to assign 2 ip to single NIC in linux, How to add second IP to an interface in CentOS Linux?, how to add 2 gateway ip on single network card, how to add 2 ethernet card in fedora, how to 2 ip address same ethernet card linux, 2 IP in 1 NIC linux