Acquiring DHCP addresses on subinterfaces

acaeti

Member
Mar 7, 2006
103
0
0
(crossposted at arstechnica, nobody there too helpful )

I am trying to setup a linux box with a single eth interface (some intel nic) but I want to grab multiple dhcp addresses with it (not static). Is this possible? I am running ubuntu.

Here's my /etc/network/interfaces:
--------------
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto eth0:1
iface eth0:1 inet dhcp
hwaddress ether 08:00:46:18:3D:99

auto eth0:2
iface eth0:2 inet dhcp
hwaddress ether 08:00:46:E8:4D:09

-----------

When i try and bring up eth0:x I get the following:

SIOCSIFFLAGS: Cannot assign requested address
SIOCSIFFLAGS: Cannot assign requested address
Bind socket to interface: No such device
Failed to bring up eth0:1.

I also get this gem in /var/log/syslog:

Sep 10 23:08:32 tiger-laptop dhclient: There is already a pid file /var/run/dhclient.eth0:1.pid with pid 134993416
Sep 10 23:08:32 tiger-laptop dhclient: Internet Systems Consortium DHCP Client V3.0.4
Sep 10 23:08:32 tiger-laptop dhclient: Copyright 2004-2006 Internet Systems Consortium.
Sep 10 23:08:32 tiger-laptop dhclient: All rights reserved.
Sep 10 23:08:32 tiger-laptop dhclient: For info, please visit http://www.isc.org/sw/dhcp/
Sep 10 23:08:32 tiger-laptop dhclient:
Sep 10 23:08:33 tiger-laptop dhclient: Bind socket to interface: No such device

I have tried a variety of comibinations. Putting statics on the eth0:x subints with dhcp or static on the eth0 int works just fine. IE this works:

eth0 as dhcp
eth0:1 as static
eth0:2 as static
eth0:x as static

or this works

eth0 as static
eth0:1 as static
eth0:2 as static
eth0:x as static

however, this does not work (and this is what I want):

eth0 as static or dhcp
eth0:x as dhcp

edited title for clarity
 

xSauronx

Lifer
Jul 14, 2000
19,582
4
81
according to this:

no

DHCP cannot be used with aliases

out of curiosity, why would you want it to?
 

acaeti

Member
Mar 7, 2006
103
0
0
Originally posted by: xSauronx
according to this:

no

DHCP cannot be used with aliases

Well that is incorrect as I have been at a minimum been able to use dhcp on the main (eth0) int and statics on the subints.

Also, in the man page for dhclient there is a setting for "pseudo" ints. I have been wrangling with this but getting nowhere. It seems to allow what I want but I don't know how to configure it correctly and googling for help just turns up endless copies of the man page.

out of curiosity, why would you want it to?

I can get multiple IPs on my dsl modem and I want to use them for separate machines on our internal network here with dyndns.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Well that is incorrect as I have been at a minimum been able to use dhcp on the main (eth0) int and statics on the subints.

The article is also for RH9 so it might have been correct then but somehow got fixed or just happens to work for you now by some weird coincidence and will cause problems for you down the road.

Looking at the dhcp-client source all it's doing at that point is trying to bind a packet socket to that interface so apparently Linux doesn't support packet sockets on interface aliases.

Although this seems to suggest that it's possible: http://www.kclug.org/pipermail.../2004-June/022946.html
 

Brazen

Diamond Member
Jul 14, 2000
4,259
0
0
Just for the heck of it, I tried setting up a virtual interface through Webmin on Ubuntu Dapper virtual machine, and it did not work either. You are probably out of luck.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |