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 All Outline: 1 2 All

None 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
1. More I agree, however... by Andreas Hotz, 2000, Apr 13
(_ None Ok, maybe I don't know what I'm talking about by David Hinds, 2000, Apr 13

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