LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-02-2014, 05:40 AM   #1
ashlyjay
Member
 
Registered: Dec 2006
Posts: 32

Rep: Reputation: 16
assigning NIC IP range with an exception of a specific ip address


hi everyone,

Good day.

OS: centos 6
Ip address range: 192.168.0.10 to 192.168.0.100

we can assign these ipaddres in just on NIC right using below:

#DEVICE="eth0"
#BOOTPROTO=none
#NM_CONTROLLED="yes"
#ONBOOT=yes
TYPE="Ethernet"
IPADDR_START=192.168.0.10
IPADDR_END=192.168.0.100
IPV6INIT=no


however, my question is that, i want that ip range but i dont want the ip address 192.168.0.50 on it. is there a way I can make an exception on this one ipaddress?

or do you have a suggestions?

regards,

jason
 
Old 09-03-2014, 04:51 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 15,658

Rep: Reputation: 2257Reputation: 2257Reputation: 2257Reputation: 2257Reputation: 2257Reputation: 2257Reputation: 2257Reputation: 2257Reputation: 2257Reputation: 2257Reputation: 2257
"Range configuration file
To bind a range of multiple IP addresses to
the eth0 device, create a file named
"
/etc/sysconfig/network-scripts/ifcfg-eth0-range0
" and place the
following network settings in this file:
[root@ocs /root]# more
/etc/sysconfig/network-scr
ipts/ifcfg-eth0-range0
DEVICE=
eth0-range0
IPADDR_START
=192.168.0.20
IPADDR_END=192.168.0.40
CLONENUM_START=0
NETMASK=255.255.255.0
ONBOOT=yes
You can have more than one range file as
long as all of t
he IP addresses are
within a single "Class C-sized" network. "

So last line suggests to make two ranges.

http://www.itcourseware.com/docs/oc-...linux2-4-1.pdf
 
Old 09-03-2014, 05:08 PM   #3
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Create two files: name one 'ifcfg-eth0-range0' and the other 'ifcfg-eth0-range1'

Then in each:
Code:
# ifcfg-eth0-range0
TYPE="Ethernet"
IPADDR_START=192.168.0.10
IPADDR_END=192.168.0.49
Code:
# ifcfg-eth0-range1
TYPE="Ethernet"
IPADDR_START=192.168.0.51
IPADDR_END=192.168.0.100
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error!! str2addr:Address 35 outside range of address field length 1 !!! MounaRM Linux - Networking 2 07-29-2015 12:51 AM
Specific DHCPD address range offered to wifi access point? abisko00 Linux - Networking 7 06-15-2012 03:55 PM
assigning range of ip address not working- ifcfg-eth0-range0 anjan_rs@hotmail.com Red Hat 4 09-08-2011 02:36 AM
ANSI C: force malloc to return address with specific range. Neuzen Programming 2 01-04-2009 04:14 PM
assigning ip from windows dhcp server for specific class imax36581 Linux - Networking 3 07-17-2008 08:16 AM


All times are GMT -5. The time now is 09:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration