HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=4)
-   -   dummy devices and dhcp? (http://www.howtoforge.com/forums/showthread.php?t=5738)

savoyardal 23rd July 2006 20:47

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?

falko 24th July 2006 16:52

Why don't you use eth0 to host your web sites?

savoyardal 25th July 2006 01:00

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?

falko 26th July 2006 09:32

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

savoyardal 26th July 2006 14:09

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?

falko 27th July 2006 13:23

Have you tried virtual interfaces, such as

Code:

auto eth0:0
iface eth0:0 inet dhcp

?

savoyardal 27th July 2006 18:46

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?

falko 28th July 2006 14:26

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


All times are GMT +2. The time now is 21:08.

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