Hi,
I wonder if it is possible to assign multiple IP addresses to
a dhcp client's interface via dhcpd (based on the interface's MAC).
If so, what would the configuration (dhcpd.conf file) on the
server side look like ?
I wonder if it is possible to assign multiple IP addresses to
a dhcp client's interface via dhcpd (based on the interface's MAC).
If so, what would the configuration (dhcpd.conf file) on the
server side look like ?
> I wonder if it is possible to assign multiple IP addresses to
> a dhcp client's interface via dhcpd (based on the interface's MAC).
> If so, what would the configuration (dhcpd.conf file) on the
> server side look like ?
# dhcpd.conf
#
# Configuration file for ISC dhcpd (see 'man dhcpd.conf')
#
default-lease-time 28800;
max-lease-time 43200;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option routers 192.168.0.1;
option domain-name-servers 192.168.0.1, 212.10.160.1, 212.10.160.2;
# rem domain-name for nslookup probs
option domain-name "domain.com";
# added as stated in dhcpd.conf man page
ddns-update-style ad-hoc;
subnet 192.168.0.0 netmask 255.255.255.0 {
# range 192.168.0.10 192.168.0.20;
host pc-1 {Quote:}
host w2k {Quote:}
host pc-6 {Quote:}
host pc-3 {Quote:}
Hope this helps,Quote:}
> > Hi,
> > I wonder if it is possible to assign multiple IP addresses to
> > a dhcp client's interface via dhcpd (based on the interface's MAC).
> > If so, what would the configuration (dhcpd.conf file) on the
> > server side look like ?
> The following is my personal config. It will assign an IP depending on
> the MAC. Hope this helps. BTW, all in the man pages...
Sorry, this is not the answer to my question. What you have done is
to assign one IP address to one interface via dhcp, which is trivial
and I know how to do. But I want to assign *multiple* IP addresses to
one interface (ie, IP aliasing), via dhcp.
Rudolf
[Snip]pets of what Nejat AYDIN
:>
:>
:> > Hi,
:> >
:> > I wonder if it is possible to assign multiple IP addresses to
:> > a dhcp client's interface via dhcpd (based on the interface's MAC).
:> > If so, what would the configuration (dhcpd.conf file) on the
:> > server side look like ?
:>
:> The following is my personal config. It will assign an IP depending on
:> the MAC. Hope this helps. BTW, all in the man pages...
: [...]
: Sorry, this is not the answer to my question. What you have done is
: to assign one IP address to one interface via dhcp, which is trivial
: and I know how to do. But I want to assign *multiple* IP addresses to
: one interface (ie, IP aliasing), via dhcp.
--
The biggest spendings on MY credit card are Pizza ...
... and Patents.
Rudolf, Dec. 15, 2002
If you want to assign by MAC address, then every virtual interface must
have a distinct MAC address.
By default, aliased MAC interfaces (eth0:1 for instance) all have the
same MAC address. It appears that I can't change this (using 'ifconfig
eth0:1 hw ether NEWMACADDR'). I get 'Device or resource busy' when I
try.
It would not be a great idea to do it this way anyway, as you would need
to be very cautious as to how you allocate MAC addresses so they don't
clash. (Although changing the first three bytes should be relatively
safe).
I think a better idea may be to allocate using a DHCP name. I've never
done this before, so I can't tell you what's involved. But you would
need to run the client for each interface, so that you can tell the
client to use a different name for each interface. If the machine is
called 'bob', then you would run your dhcp client advertising a name of
'bob-eth0:1' for instance, repeating for each virtual interface.
If you're using Debian, you could put the following in
/etc/network/interfaces. You should use the dhcpcd client. I've tried
this (unsuccessfully) using dhclient, and I doubt pump is flexible
enough to allow you to specify a client-identifier on the command line.
auto eth0
iface eth0 inet dhcp
auto eth0:0
iface eth0:0 inet dhcp
client_id bob-eth0:0
auto eth0:1
iface eth0:1 inet dhcp
client_id bob-eth0:1
Now, let's see if I can take a crack at setting up dhcpd to use
client_id as a basis for handing out names.
Here is a relevant section (abridged) from dhcpd.conf(5)
Host declarations are matched to actual DHCP or BOOTP clients by
matching the dhcp-client-identifier option specified in the
host declaration to the one supplied by the client, or, if the
host declaration or the client does not provide a
dhcp-client-identifier option, by matching the hardware
parameter in the host declaration to the network hardware address
supplied by the client. [...]
Please be aware that only the dhcp-client-identifier option
and the hardware address can be used to match a host
declaration. [...]
So, given that I'm requesting the MAC-based address for eth0, and
client_id-based addresses for the aliased interfaces, this should
hopefully work.
host bob {
hardware ethernet 00:40:F4:6F:BB:F0;
fixed-address bob.localdomain;
}
host bob-eth0_0 {
option dhcp-client-identifier "bob-eth0:0";
fixed-address 10.18.2.50;
}
host bob-eth0_1 {
option dhcp-client-identifier "bob-eth0:1";
fixed-address 10.18.2.51;
}
Testing this however, is a pain. I've tried with dhclient and dhcpcd.
Neither of which was happy to configure an interface that didn't exist
at the time. Of the two, dhcpcd would probably be preferable, as it
allows for a command-line option to specify the client identifier.
When I 'ifconfig eth0:0 up', it fails (Cannot assign requested address).
Seems as if it must be given an address to be created, it's not enough
to just have it 'UP'. I consider this a bug.
dhcpcd won't even configure the interface if I configure it with a dummy
address of 127.0.0.1 first (it say's the interface has been configured
with it's old address. I wonder if it gets confused because of the
colon?
In conclusion, you probably could do it, but getting your clients to
wrangle the task correctly could take a lot of work.
--
Cameron Kerr
Empowered by Perl!
1. Assigning multiple IP addresses to one interface
Hi all,
does anyone have an idea, how to assign multiple IP addresses to one(!)
single interface without using the vif hack? I'm using a 2.0.35 kernel
--> ip's not available yet.
Any suggestions are welcome...
Thanks
2. how to compile socket program?
3. IP Aliaseing (Multiple IP address to one interface)
4. Upgrading Kernel Help Needed
5. How can you assign two ip address to one interface
7. assign only one single IP address to 2 or more networks interface to your computer
8. Assigning IP Range via First Half of MAC ( hardware ) Address
9. Multiple IP-Addresses on one Ethernet Interface?
10. Multiple IP Addresses for one Interface.
11. multiple IP-Addresses on one interface
12. Multiple IP addresses (or hosts) on one LAN interface