[ Next-in-Thread ]  [ Next Message ] 

Question: DHCP and manually set MAC address 

Forum: PCMCIA Network Adapter Issues
Date: 2000, Apr 12
From: Andreas Hotz ahotz

To use my laptop on the company network, I have to use DHCP. No problem so far. But I have to use DHCP with a manually configured MAC address. Don't ask me why this is so, it just is that way. The DHCP server won't answer me with thy MAC address burned into the adapter.

I could not find a suitable variable in the PCMCIA config scripts. I think I have to tweak a little with ifconfig. Maybe in the start_fn function in network.opts? Or should I change config instead. Any tips which is the best way to do it?

[ Next-in-Thread ]  [ Next Message ] 

Messages Inline: [ 0 ]  [ 1 ] 

There has got to be another way

Re: Question: DHCP and manually set MAC address (Andreas Hotz)
Date: 2000, Apr 12
From: David Hinds <dhinds@pcmcia.sourceforge.org>

That's totally brain dead.  You need to talk to your IT people and
give them your card's MAC address if necessary, so that they can
configure the DHCP server to recognize it.

Most cards do not permit overriding the MAC address.  And almost none
of the Linux net drivers provide an interface for doing it.

-- Dave

More: I agree, however...

Re: There has got to be another way (David Hinds)
Date: 2000, Apr 13
From: Andreas Hotz ahotz

That's what I said to them: It's braindead. But they won't listen. Talking something about we have to have addresses bound to a workstation (tied to a certain desk in a certain office, not an adapter). Up to some point (but not completely) I can understand what their problem is. Besides TCP/IP, they use SNA network functions and other services bound only to the MAC address. If an adapter is interchanged with another (could easily happen with PCMCIA cards) no address (TCP/IP or other) should change with the card. Additionally, their sniffers and network managing software has a direct link from the mac address to the office and working plance. Resumee: I tried to convince them of using the burnt-in mac address, but they did not accept. So I'm back with the problem

> Most cards do not permit overriding the MAC address.

Really? Under Windoze (NT, 95) and OS/2 all brands of our Ethernet adapters (Compaq Netelligent, Xircom, 3Com), both PCI and PCMCIA do not have problems with an overwritten mac address, and neither do the Token Ring cards.

> And almost none of the Linux net drivers provide an
> interface for doing it.

The ifconfig program in Linux does provide a parameter for this purpose, and if I use it:
./network stop eth0
ifconfig eth0 hw ether <address>
./network strat eth0
Then ifconfig --status shows the new address afterwards, and a ping to the adapter from another machine still delivers an answer. I could not manage it yet to use a sniffer to find out whether ifconfig just "lies" to me and in fact the adapter still uses the burnt-in mac address.

So if the whole thing does not really work in linux, then I'm stuck. But if it works, I'd like to know the excact point in the scripts where I should insert a hack. I could immagine thing should happen between "insmod" and "./network start eth0", before the dhcp call is made. But I'm quite new to linux and am not sure whether I am right.

Can you give me a hint? Of course I'll keep you posted with the results.

Andreas

Ok, maybe I don't know what I'm talking about

Re: More: I agree, however... (Andreas Hotz)
Date: 2000, Apr 13
From: David Hinds <dhinds@pcmcia.sourceforge.org>

I have never tried using this ifconfig interface. You are welcome to try it. Just edit /etc/pcmcia/network and add your ifconfig command before the interface is set up.

-- Dave

Ok: It works!

Re: Question: DHCP and manually set MAC address (Andreas Hotz)
Date: 2000, Apr 17
From: Andreas Hotz ahotz

The change of the adapter to a preset hardware address with ifconfig prior to calling DHCP works great for me. I tested it with a Compaq Netelligent Ethernet and an IBM Auto Token Ring adapter. My version of DHCP does not seem to work for Token Ring, but that's another story and does not have anything to do with the address change.

I tweaked David's network script (many thanks to David for discussing the stuff and giving hints) a little and added a new variable NEW_HWADDR to network.config and here we are. If network.opts sets this variable, the network script will try to change the adapters address to NEW_HWADDR. The version of David's scrip is: # network 1.63 2000/02/09 03:12:42 (David Hinds)

And here are the changes I made (this is an excerpt, showing only the changes I made to the "start" part of "case $ACTION in"):

>'start')
>
>    test "$IF_PORT" && /sbin/ifport $DEVICE $IF_PORT
>
>    cp $RESOLV $RESOLV.pcmcia.save
>
># Begin adddition by Andreas Hotz
>    if  [ "$NEW_HWADDR" ] ; then
>       case "$DEVICE" in
>       eth*)
>            IFDEVICE="ether"
>            ;;
>       tr*)
>    	    IFDEVICE="tr"
>    	    ;;
>       *)
>    	    logger "Device not recognized. Adress will not be overwritten"
>    	    IFDEVICE=""
>    	    ;;
>       esac
>       if [ "$IFDEVICE" ] ; then
>          logger "New device address will be set to" $NEW_HWADDR
>          /sbin/ifconfig $DEVICE hw $IFDEVICE $NEW_HWADDR
>       fi
>    fi
># End adddition by Andreas Hotz
>

The logger entries are for showing me anything that may go wrong. I have only Token Ring and Ethernet devices available, so I could not test whether the address change would work for other device types lile Arcnet. So I don't deal with other devices and give a "device not recognized" message back.

Could anybody else test whether this stuff works for him/her? And I think one could do the scripting better. I'm new to shell scripts and not an old linux/unix hacker (coming from OS/2 and REXX). So please feel free to make things better.

Andreas

DHCP and manually set MAC address


[ Add Message ]  to: "DHCP and manually set MAC address"

[ Members ]  [ Subscribe ]  [ Admin Mode ] 
[ Show Frames ]  [ Help for HyperNews at pcmcia-cs.sourceforge.net 1.10 ]