#1  
Old 23rd July 2006, 20:47
savoyardal savoyardal is offline
Junior Member
 
Join Date: Jul 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default dummy devices and dhcp?

My school's network is set up in such a way that when it sees a MAC address you have registered to yourself, it assigns it an IP address and updates its entry in the campus DNS servers. So basically, no matter where I plug in to the network, I will always get the same hostname (but not IP address, since each building is in a different subnet). I'd like to be able to get dummy ethernet devices to broadcast DHCP requests, with their own MAC addresses so that I can get traffic bound for multiple hostnames sent to my machine. Essentially, I want the network to think my one ethernet adapter is actually a hub (a bridge maybe?) with multiple computers on it, so that I can then host multiple websites using Apache's virtual hosting abilities.

I've added a dummy device (dummy0) with
Code:
modprobe dummy
It shows up in ifconfig, and when I set the IP manually, I can ping it. When I try to
Code:
dhclient dummy0
it times out.

I've tried bridging eth0 and dummy0 with:
Code:
ifdown eth0
ifdown dummy0
brctl addbr br0
brctl addif dummy0
brctl addif eth0
ifconfig br0 up
ifconfig eth0 up
ifconfig dummy0 up
Since the br0 device takes on the MAC address of eth0, it gets a valid IP via DHCP with no problems. Trying to get dummy0 to get an IP still doesn't work.

All of these commands are run with root priviledges. I'm using ubuntu 6.06.

Can anyone point in the right direction?
Reply With Quote
Sponsored Links
  #2  
Old 24th July 2006, 16:52
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

Why don't you use eth0 to host your web sites?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 25th July 2006, 01:00
savoyardal savoyardal is offline
Junior Member
 
Join Date: Jul 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by falko
Why don't you use eth0 to host your web sites?
That's what I'm doing, except that my network card is only getting traffic bound for one of my hostnames. I want to add dummy interfaces so that I can get traffic bound for multiple hosts. Here's how the set up on 'their' end works:

1. You register a MAC address and pick a hostname for it.
2. Whenever that MAC address requests a DHCP lease, it is given an IP address valid in that building's subnet. At the same time, the DHCP server sends an update to the DNS server, telling it the new IP of that particular hostname.
3. I have no control over the DNS server, or the DHCP server. All I can do is register MAC addresses to myself.

Basically I need one network card to broadcast DHCP requests for multiple dummy cards. I know it's possible because Parallels and VMware both do it with their virtual ethernet devices. Howerver, I don't want to do any virtualization.

Anybody have any tips?
Reply With Quote
  #4  
Old 26th July 2006, 09:32
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

You could add this to /etc/network/interfaces:

Code:
auto dummy0
iface dummy0 inet dhcp
Restart your network afterwards:
Code:
/etc/init.d/networking restart
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 26th July 2006, 14:09
savoyardal savoyardal is offline
Junior Member
 
Join Date: Jul 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by falko
You could add this to /etc/network/interfaces:

Code:
auto dummy0
iface dummy0 inet dhcp
Restart your network afterwards:
Code:
/etc/init.d/networking restart
I tried that but then when I restart networking and it gets to dummy0 it sends out dhcp requests, but they dont seem to go anywhere, because the dhcp requests timeout while the dhcp requests on eth0 are answered instantly.

Anyone have any ideas?
Reply With Quote
  #6  
Old 27th July 2006, 13:23
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

Have you tried virtual interfaces, such as

Code:
auto eth0:0
iface eth0:0 inet dhcp
?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 27th July 2006, 18:46
savoyardal savoyardal is offline
Junior Member
 
Join Date: Jul 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by falko
Have you tried virtual interfaces, such as

Code:
auto eth0:0
iface eth0:0 inet dhcp
?
Since eth0:0 will acquire an IP address by broadcasting with eth0's MAC address, it will give me the same IP for eth0:0 as eth0.

Anyone have any suggestions?
Reply With Quote
  #8  
Old 28th July 2006, 14:26
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
 
Default

I'm not sure if you can set the MAC address for virtual interfaces with the ifconfig command, but you should have a look at
Code:
man ifconfig
And maybe the send_arp utility is interesting for you:
http://www.onlamp.com/pub/a/onlamp/2...349211&ATT=868
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:12.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.