Assigning two IP addresses to one ethernet card in Linux

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 Comments

  • 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

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

  • Sanix technodigits.wordpress.com says:

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

  • Ratheesh says:

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

  • William adexus.com says:

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

  • 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

XHTML: 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, linux dual ip address, assigning two IP in linux, more ip addressess linux, multiple ip on one eth, multiple ip on one ethernat, network card two addresse, nic card having two ip address, one ethernet card two ip linux, more ip address to one network card, linux two ips same card, linux multiple ip per nic, linux two ip one interface, linux two diffrent ip address same card, linux to ethernet card with the same ip, linux two ip per interface, linux one network card for 2 IP Addresses, linux one ethernet card more ips, linux network two ethernet cards with the same IP address, same ip over two ethernet card in linux, secondary ip on same nic linux, two ip adresses on one eth interface, two ip in one net card linux, two ip on one eth, two ip on one nettwork card linux, two ipaddress on linux, two ips eth0, windows 7 add ip address to interface, windows7 dual ips on nic, two ip addresses one network card, two ip addresses on the same network card linux, settin 2 ip for 1 ethernet card in linux, two addresses in the same nic linux, two ethernet cards with one IP address, two gateway on one ethernet card linux, two ip address on one ethernet card linux, two ip address on one nic linux, two ip addresses in the same network card linux, two ip addresses on one linux, windows7 multiple IP addresses for one nic, linux multiple ethernet adapters, giving ip address in linux, give linux two ip address, Fedora how to assign your network card an additional IP, can we assign two different IP addresses to same interface, assigning two different ip for same machine in linux, assigning one more ip to the same nic card linux, assigning multiple ip addresses to single ethernet, assign two IP with one machine linux, assign another ip address to the eth card, assign 2 ip address in fedora, adding a second ip on eth linux, 2 ip same network linux, 2 IP on same eth, 2 ip linux one interface, 2 IP in 1 NIC linux, 2 ip addresses on one nic bridge linux, 2 ip 1 interface linux, giving two ips to one interface in linux, how can i assign 2 ip on same eth in windows, How can you assign two IP addresses to one network card in linux, linux command for giving two ips to single nic, linux assigning two ip addresses, linux assign two different ip to eth0, linux 2 ips on eth, linux 2 ips, Linux 2 ip für 1 ethernet, linux 2 ip addresses one network card, linux 2 ip addresses on one nic, linux 2 ip addresses 1 ethernet, linux 2 ip address on one computer, ifconfig two addresses one interface, how to assign several IP on one NIC fedora, how to assign 2 IPs in 1 nic for fedora, How to add second IP to an interface in CentOS Linux?, How to add an additional ip to the same lan card in linux, how to add 2 gateway ip on single network card, how to 2 ip address same ethernet card linux, /etc/network/interfaces two address
Google Analytics Alternative