LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-11-2012, 03:45 AM   #1
sunzeal
LQ Newbie
 
Registered: Sep 2012
Posts: 26

Rep: Reputation: Disabled
How to have Virtual IP Address


Hi

I have IP Address assigned via DHCP.

In all the guides i find that they have static IP Address but in my virtual machine, my ip address is via DHCP.

So any guide on how can i have a virtual ip address over single NIC so that i can use it for heartbeat.

Current Configuration of ETH0 :-

Code:
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:0C:29:8F:BF:13
IPV6INIT=yes
NM_CONTROLLED=yes
ONBOOT=yes
TYPE=Ethernet
UUID="f29eae5a-60af-4705-8e89-3613bb83a499"
USERCTL=no

I tried and copy pasted it with ETH0:01 and upped that interface with command ifup eth0:01. Than did ifconfig but could not find anything, it just shows eth0 and lo.
 
Old 12-11-2012, 09:33 AM   #2
blueh2o
Member
 
Registered: Jul 2011
Distribution: CentOS, Ubuntu, Fedora, Solaris, RHEL, Debian
Posts: 100

Rep: Reputation: 3
Quote:
Originally Posted by sunzeal View Post
I tried and copy pasted it with ETH0:01 and upped that interface with command ifup eth0:01.
You cannot use DHCP on an alias interface. You'll want to assign a static IP.
 
Old 12-11-2012, 01:07 PM   #3
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,617

Rep: Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695
He said ti right, but ..

To make it clear, your physical interface CAN have a dynamic address and your alias a static. The other way does not work.
You need to assign an address and settings to the alias.

You might look at http://www.cyberciti.biz/tips/ubuntu...rk-device.html for details.
 
Old 12-11-2012, 03:33 PM   #4
sunzeal
LQ Newbie
 
Registered: Sep 2012
Posts: 26

Original Poster
Rep: Reputation: Disabled
thanks blueh20 & wpeckham.

That method from cyberciti worked, but was wondering, the address which i create with ifconfig eth0:0 192.168.1.11 up can be considered as a virtual IP address ?

I am able to ping the address i create, but i cannot see it in : ifconfig -a
 
  


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
When IOMMU is enabled, how to get the Kernel Virtual Address from a Physical address leechaotang Linux - Kernel 1 11-10-2011 12:21 AM
Converting virtual address to physical address in the kernel DBQ Programming 0 02-07-2010 06:30 PM
how to translate virtual address to physical address in linux application saurin Programming 1 11-18-2009 09:05 PM
Does user stack have a fixed address location in its virtual address? lqu Linux - Kernel 1 09-11-2009 01:28 PM
Outgoing local trafic over virtual interface has not virtual ip address :-( tkmbe Linux - Networking 3 08-25-2009 08:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:51 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
Open Source Consulting | Domain Registration