LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 09-20-2010, 07:52 AM   #1
jitendra_kumar57
LQ Newbie
 
Registered: Aug 2010
Posts: 5

Rep: Reputation: 0
How to assign virtual ip in RHEL5.4


Hi All

How to assign virtual ip in RHEL5.4?
Please help me.

Thanks: Jitendra
 
Old 09-20-2010, 08:43 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
By virtual IP I assume you mean a second IP on the same NIC in the same OS? (That is as opposed to setting up one for Xen/KVM or other virtualization platform.)

In RHEL5.x it is simply a matter of creating a new file and restarting networking.

You should have a file such as ifcfg-eth0 (for first NIC) that would look something like:
Code:
# Intel Corporation 82546EB Gigabit Ethernet Controller (Copper)
DEVICE=eth0
BOOTPROTO=none
BROADCAST=10.0.15.255
HWADDR=01:03:05:D2:47:E1
IPADDR=10.0.9.1
NETMASK=255.255.0.0
NETWORK=10.0.9.0
ONBOOT=yes
ETHTOOL_OPTS="autoneg off speed 100 duplex full"
GATEWAY=10.0.9.1
TYPE=Ethernet
That is the one that would setup the main IP on eth0.

You can create another file named ifcfg-eth0:1 for the virtual that might look like:
Code:
# Intel Corporation 82546EB Gigabit Ethernet Controller (Copper)
# Alias for eth0
DEVICE=eth0:1
IPADDR=10.0.9.2
ONBOOT=yes
The next one after that would be ifcfg-eth0:2 then ifcfg-eth0:3 etc...

If it is the second NIC you'd substitute eth1 for eth0. Third NIC would be eth2 etc...

Once you've done this you should be able to ifup the interface. e.g. "ifup ifcfg-eth0:1".

CAUTION: This will disconnect any network sessions currently open so should only be run from Console: You can restart networking with "service network restart" if the ifup doesn't work for you.
 
1 members found this post helpful.
Old 09-21-2010, 12:02 AM   #3
jitendra_kumar57
LQ Newbie
 
Registered: Aug 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks a lot MensaWater,
We resolved the problem.

Regards
Jitendra
 
Old 09-21-2010, 11:02 AM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Please mark the issue RESOLVED in thread tools.

Also did you resolve it using the information I provided or in some other way? If the latter then please post your solution so others will be able to find it on future searches.
 
  


Reply



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
RHEL5 Virtual Machine Will Not Go To Boot Prompt? kevmcool Linux - Newbie 1 02-07-2010 07:56 AM
How to assign Debian running on virtual box a static ip? peterson.julia Linux - Newbie 5 01-12-2010 05:38 PM
RHEL5 and Virtual machines gcaldwel Red Hat 3 01-05-2009 08:26 AM
Difference b/w Virtual & Graphical consoles in RHEL5 kapilbajpai88 Linux - Newbie 4 11-20-2008 09:24 AM
question about install virtual system in Xen of RHEL5 sailershen Red Hat 0 04-26-2007 04:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 09:20 PM.

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
Open Source Consulting | Domain Registration