CariNet Forums  
Go Back   CariNet Forums > Linux Questions

Reply
 
Thread Tools Search this Thread Display Modes
Old 08-04-2008, 02:00 PM   #1 (permalink)
Cari.net Staff
 
Happy Clicker's Avatar
 
Join Date: May 2008
Posts: 14
Default Adding additional IP's

How to set multiple IP addresses using Linux command line

Go to /etc/sysconfig/network-scripts
Make multiple copies of ifcfg-eth0 and name them as ifcfg-eth0:0, ifcfg-eth0:1 etc.
Open each of them and at least change the IPADDR to your chosen IP address and the NETMASK to the subnet mask for that IP address.
A sample entry would look like this:

DEVICE=eth0:0
BOOTPROTO=static
IPADDR=111.100.111.21
NETMASK=255.255.255.0
ONBOOT=yes

Restart the network:
/sbin/service network restart

You are done!
------------------------------------------------------------------

Red Hat / CentOS / Fedora Multiple IP address range

You can assign multiple ip address range as follows to eth0:

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

Append following code from 111.00.111.100 to 111.00.111.300:

IPADDR_START=111.00.111.100
IPADDR_END=111.00.111.300
CLONENUM_START=0
NETMASK=255.255.255.0

Save and close the file.
Happy Clicker is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Share on FacebookStumble this Post!Google Bookmark this Post!Bookmark to Slashdot!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


All times are GMT -7. The time now is 04:21 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0