Faking multiple physical adapters for DHCPDISCOVER

Terrence Koeman root at mediamonks.net
Tue Apr 11 05:00:04 UTC 2006


Hi,

I'm trying to 'fake' multiple phisical adapters in my FreeBSD 6.1-PRERELEASE
system, but I'm not getting anywhere.

-There are two 3Com 905C cards in the system (xl0 and xl1).
-xl1 is assigned a static private IP address and xl0 aquires an address from
my provider using DHCP.
-The system does NAT for several clients having private addresses.

I need to 'clone' the xl1 adapter to appear as three adapters, each with a
distinct MAC address. This because my provider has assigned me three
semi-static addresses of which I want to use 1 for outbound NAT-traffic and
two for static NAT.

These addresses are semi-static because they are basically MAC-based
reservations on the providers DHCP server, and it happens to be that I'm
required to aquire a DHCP lease for all three addresses for routing to work
properly. If I configure the addresses statically the connectivity
'disappears' after a while.

I tried using netgraph as suggested here:
http://ezine.daemonnews.org/200406/netgraph.html

ifconfig xl1 delete
ngctl mkpeer . eiface hook ether
ifconfig ngeth0 up
ngctl mkpeer ngeth0: bridge lower link0
ngctl name ngeth0:lower mybridge
ngctl connect xl1: mybridge: lower link1
ngctl connect xl1: mybridge: upper link2
ngctl connect ngeth0: mybridge: upper link3
ngctl msg xl1: setautosrc 0
ngctl msg xl1: setpromisc 1
ifconfig ngeth0 link 00:50:04:32:8a:6b

At this point everything seems OK, the MAC-address is correctly set and xl1
is in promiscous mode. However, when I try 'dhclient ngeth0' the adapter does
not get any response/lease.

I also tried using a vlan interface as following:

ifconfig vlan create
ngctl msg xl1: setautosrc 0
ifconfig vlan0 vlan 0 vlandev xl1 
ifconfig vlan0 link 00:50:04:32:8a:6b

The same here, 'dhclient vlan0' fails.

I also thought that it'd be much simpler to have a dhcp client that I could
instruct to spoof the MAC-addresses so that it would aquire leases for 3
distinct mac-addresses, and run as a daemon so that it renews them when they
expire. I could then just configure the addresses statically and don't have
to clone any adapters. However, I haven't found any client that could do
this...

At the moment I'm out of ideas and I was hoping that someone here could point
me in the right direction with this problem.

-- 
Regards,
Terrence Koeman

MediaMonks B.V. (www.mediamonks.com)
Please quote all replies in correspondence.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 4698 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20060411/8836c350/smime.bin


More information about the freebsd-questions mailing list