Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

adding ip on centos

Posted on 2011-09-02
8
Medium Priority
?
496 Views
Last Modified: 2012-05-12
hello,
I usually add extra ips to the Centos server by editing

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

then adding

IPADDR_START=72.5.2.1
IPADDR_END=72.5.2.8
CLONENUM_START=0
NETMASK=255.255.255.0

but now i got different ips like

72.5.2.1
72.6.8.5
72.7.6.6
72.8.6.8

what do I do now?
0
Comment
Question by:XK8ER
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 38

Expert Comment

by:wesly_chen
ID: 36474609
Could you post the output of
ls /etc/sysconfig/network-scripts/ifcfg-eth0*
/sbin/ifconfig -a
0
 
LVL 80

Accepted Solution

by:
arnold earned 2000 total points
ID: 36474674
copy ifcfg-eth0 as ifcfg-eth0:1 and add settings there
the :1 references an index which will have the IP.
Setting multiple IPs from different segments could be trouble as your example has public IPs, i.e. the path an outgoing packet may take will depend on how you configure your routing/firewall if any to make sure that a packet that came in on one IP leaves taking the same path.
(tagging)
YOu could add the entry into /etc/rc.local

/sbin/ifconfig eth0:1 72.6.8.5 netmask 255.255.255.0  metric y broadcast 72.6.8.z up

repeat the above altering the index and the IP/broadcast/metric as you see fit.
You may need to use route to add entry to the routing table to handle the traffic originating from 72.6.8.5 through the suitable gateway for this IP.

The metric will assign control which path a packet takes to the remote side.

The lower the metric, the higher the preference for this path
netstat -rn will display the routing table on the system.
0
 
LVL 1

Author Comment

by:XK8ER
ID: 36476050
im using that command but it doesnt seem to work..

-(01:14 22 PM)-(root@alpha)-(~) $ /sbin/ifconfig eth0:1 72.6.8.5 netmask 255.255.255.0  metric y broadcast 72.6.8.z up
SIOCSIFMETRIC: Operation not supported
72.6.8.z: Unknown host
-(01:14 54 PM)-(root@alpha)-(~) $  
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
LVL 1

Author Comment

by:XK8ER
ID: 36476057
what if I do this?

vi /etc/sysconfig/network-scripts/ifcfg-eth0:1

DEVICE=eth0:1
BOOTPROTO=static
HWADDR=00:30:48:5A:24:54
IPADDR=72.6.8.5
NETMASK=255.255.255.0
ONBOOT=yes

Open in new window

0
 
LVL 38

Expert Comment

by:wesly_chen
ID: 36476173
> /sbin/ifconfig eth0:1 72.6.8.5 netmask 255.255.255.0  metric y broadcast 72.6.8.z up
replace z with 255
/sbin/ifconfig eth0:1 72.6.8.5 netmask 255.255.255.0  metric y broadcast 72.6.8.255 up
0
 
LVL 1

Author Comment

by:XK8ER
ID: 36476180
I did exactly the same thing on my last post and it worked..

is that okay? I can keep doing the same thing for

vi /etc/sysconfig/network-scripts/ifcfg-eth0:1
vi /etc/sysconfig/network-scripts/ifcfg-eth0:2
vi /etc/sysconfig/network-scripts/ifcfg-eth0:3

etc..
0
 
LVL 38

Expert Comment

by:wesly_chen
ID: 36476249
yes.
0
 
LVL 80

Expert Comment

by:arnold
ID: 36476563
That's what I have outlined in comment http:#a36474674
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses

598 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question