Re: How to request specific IPaddress with DHCP?
On 21 Sep 2002, 23:40:00, Tom Massey wrote:
> * mdevin [2002-09-21 22:42]:
> > Hmmm, that is interesting. But how do I change my mac address? My
> > ethernet card has this hard coded in its chip by the manufacturer. I
> > can't see how you can override that. If you did, then the ARP system
> > would break, right?
> You can use ifconfig to change the MAC address quite easily on a
> number of cards. You need to bring the interface down first, and
> then the command is something like:
> ifconfig eth0 hw ether 00:00:AA:AA:AA:AA
> Where eth0 is the interface you want to change and 00:00:AA:AA:AA:AA
> is the MAC address you want to give it. I'm not entirely sure what
> this does to ARP requests, but I think the system is robust enough
> that this doesn't break anything. This doesn't work on all cards,
> and usually the changed address only lasts until the next boot.
Since you brought the interface down, and back up with a different MAC address,
there won't be any problem, AS LONG AS YOU PICK A MAC ADDRESS UNIQUE to
your IP Subnet.
The MAC address goes in the layer 2 header, both source and destination.
With IP, if you are sending a packet to another host that is on the same
IP sub-net as you (as determined you your IP address, their IP address, and
your subnet mask) you ARP for that hosts MAC address, and put it in the destitnation
MAC address field in the layer 2 header.
If you are sending a packet to another host that is NOT on the same IP sub-net
as you, you ARP for the MAC address of your default gateway, and put your
default-gateway's MAC address in the destination MAC address field in the
layer 2 header.
This way, the proper device picks up the packet based upon the layer 2 data.
Otherwise, every node on a sub-net would have to look at every packet to see if the layer
3 addressing meant it was for them . . . .
If DNS is the issue here, can I suggest that you use DynDNS.org, and use
ddclient to update your name there? And then use a cname in the real dns
name you want to use?
For example, register myhostname.homeip.net at DynDNS.org, and use ddclient
to update dyndns.org with myhostname.homeip.net (your machine)'s new, changed,
dhcp-served IP address everytime you get a new one (it runs as a daemon
and monitors ppp0 (a pppoe link) on my machines.
So, myhostname.homeip.net will always resolve to your host's IP address,
eventhough that address may change several times a day.
Then, in your "permanent", real DNS, make
myhostname.mydomain.com. CNAME myhostname.homeip.net.
This way, all lookups for myhostname.mydomain.com, generate a second lookup
to resove the CNAME, myhostname.homeip.net, and will return the proper IP
The only catch to this is MX records. If your dynamicly-assigned IP address
is a mail-exchanger, the MX records will have to use the dynamic DNS name,
since you can't use CNAME's in MX records.
so, in the mydomain.com zone file:
mydomain.com. MX 100 myhostname.homeip.net.
will make your host the mail-exchanger for your domain, eventhough it's in
the homeip.net domain . . .
hope this helps . . .