LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 11-03-2009, 05:31 AM   #1
saraswat
LQ Newbie
 
Registered: Nov 2009
Posts: 3

Rep: Reputation: 0
Dynamic IP Address on Virtual Interface in RHEL-5


Hi,

I have RHEL-5 installed on my machine, it has 1 ethernet interface eth0. on which i want to give 5 dynamic IP address (1 to eth0 & other 4 to its virtual interfaces).all interfaces need to get dynamic IP address from my DHCP server.

is it possible to get dynamic IP to virtual interfaces or not. if yes, then how?

plz suggest me. I am new to here and this is my first post.

thanks in advance.
 
Old 11-03-2009, 06:52 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 38,396

Rep: Reputation: 882Reputation: 882Reputation: 882Reputation: 882Reputation: 882Reputation: 882Reputation: 882
well you are going to have trouble here as a DHCP server will only see a single mac address come in for all the "virtual" interfaces you have, so only track 1 IP by default. I don't believe you can change the MAC on an aliased interface, which I presume is what you mean... an interface called eth0:1 up to eth0:5, which is *not* a different VLAN or anything, just a standard second, third, fourth IP on the same untagged nic.

examples on creating an aliased interface: http://pachome1.pacific.net.sg/~hari...uxipalias.html http://handsonhowto.com/virt.html

However if I want to change the MAC, then this happens:

ifconfig eth0:1 192.168.0.1 hw ether 11:12:13:14:15:16 up
SIOCSIFHWADDR: Cannot assign requested address

so you can't (apparently) change the MAC, and as such I don't see any way to get DHCP on each one. Quite why you'd want to is a separate issue altogether.

Maybe there's a way to create seperate internal interfaces with different MAC and bridge them all to eth0?
 
Old 11-03-2009, 10:14 PM   #3
chappel
LQ Newbie
 
Registered: Jul 2009
Posts: 8

Rep: Reputation: 1
If each of the virtual interfaces were on separate subnets via vlanning they could each get a different IP address. You'd have to define a different DHCP scope per subnet and set up DHCP request forwarding ('helper address' if it's cisco) on your gateway device. They would all have the same MAC address, but that doesn't matter if they are all talking on different subnets.

I'm not sure if that's what you are trying to do...

This tutorial looked helpful - http://www.cyberciti.biz/tips/howto-...work-vlan.html
 
Old 11-04-2009, 05:29 AM   #4
saraswat
LQ Newbie
 
Registered: Nov 2009
Posts: 3

Original Poster
Rep: Reputation: 0
acid_kewpie,
an applicatiom is running on my machine, which require 4 IP of same subnet. i usually do it to give static IP. but now the process is changed & need to take the IP from DHCP Server.

what can be the way to create seprate interface with different MAC & to get them IP from DHCP?
 
Old 11-04-2009, 07:52 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 38,396

Rep: Reputation: 882Reputation: 882Reputation: 882Reputation: 882Reputation: 882Reputation: 882Reputation: 882
To me this sounds like they get DHCP 5 IP's from their ISP and they want to use them all, which would rule out vlan's and the likes. I may well be wrong.
 
Old 11-04-2009, 08:32 AM   #6
zhjim
Member
 
Registered: Oct 2004
Distribution: Debian lenny & etch & sid, Slackware 13.)
Posts: 735
Blog Entries: 4

Rep: Reputation: 67
taken from man dhclient.conf

Quote:
pseudo "name" "real-name" { declarations ... }

Under some circumstances it can be useful to declare a pseudo-interface and have the DHCP client acquire a configuration for that interface. Each interâ
face that the DHCP client is supporting normally has a DHCP client state machine running on it to acquire and maintain its lease. A pseudo-interface is
just another state machine running on the interface named real-name, with its own lease and its own state. If you use this feature, you must provide a
client identifier for both the pseudo-interface and the actual interface, and the two identifiers must be different. You must also provide a separate
client script for the pseudo-interface to do what you want with the IP address. For example:

interface "ep0" {
send dhcp-client-identifier "my-client-ep0";
}
pseudo "secondary" "ep0" {
send dhcp-client-identifier "my-client-ep0-secondary";
script "/etc/dhclient-secondary";
}
Hope that helps. Or mabye create some virutal interfaces like xen does, give them a mac address and try to get a lease this way....
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Outgoing local trafic over virtual interface has not virtual ip address :-( tkmbe Linux - Networking 3 08-25-2009 09:03 PM
CARP virtual address/interface assinmet sarajevo *BSD 3 06-25-2009 05:18 AM
traffic has to go through the virtual interface ip address pudhiyavan Linux - Networking 2 03-27-2008 05:35 AM
Adding virtual interface for IP based virtual host pridefc Linux - General 6 03-16-2008 04:52 PM
[SOLVED] Converting static IP-address to dynamic IP-address Blue_Ice Linux - Networking 3 07-20-2006 04:35 AM


All times are GMT -5. The time now is 07:56 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration