[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: laptop,dhcp,fixed addresses



hey alan,

thanks again! I'm learning a lot. questions keep coming though, just stop answering when you get fed up I guess...

Alan Chandler wrote:
On Thursday 14 April 2005 02:10, Matt Price wrote:

Just so that you are not totally confused, my main server has 192.168.0.20 as its main ip address, but also (on the same ethernet card) has 192.168.0.30 and 192.168.0.39 addresses. These are created with additional stanza's in /etc/network/interfaces (heres a snippet to show what I mean)

iface eth1 inet static
        address 192.168.0.20
        netmask 255.255.255.0

iface eth1:0 inet static
        address 192.168.0.30
        netmask 255.255.255.0


hey, didn't know you could do that.  interesting.


; below are allocated via dhcp because of compatibility at university
eeyore  IN      A       192.168.0.23    ; Emily's Portable
piglet  IN      A       192.168.0.24    ; Sarah's Portable
; Special for work portable - must be allocated by dhcp because of
; Work - it uses the mac address to find this address.
rabbit  IN      A       192.168.0.25

these I don't get.  If they IP's are allocated via dhcp, how do you know
in advance that they will get the address you assign here?  Are you
doing some kind of magic with the dhcp server?


Yes - see my dhcp file - it uses the mac address of the ethernet card to detect which machine they are. Some of the portables have two addresses so I have to play some silly tricks to cover them both. Note, this also contains a way of setting hostnames.

ah, very nice. I am going to try and set up something precisely parallel -- still haven't been near enough to the classroom to actually DO IT -- but soon I hope. meanwhile, a question:

I'm intrigued by the ocmments in your dns files like:
; Special for work portable - must be allocated by dhcp because of
; Work - it uses the mac address to find this address.

Do you have some trick that enables you to move between locations without changing the network interface? On my laptop I have the following ocnfiguration:

# The first network card - this entry was created during the Debian installation
iface dynamic inet dhcp

# when connecting via another laptop, use dhcp;
# otherwise use the static configuration
auto eth0
 iface eth0 inet static
        address 192.168.2.198
         netmask 255.255.255.0
        broadcast 192.168.2.255
        gateway 192.168.2.1

 iface net-sidsmith inet static
        address 128.100.34.173
        netmask 255.255.255.0
        network 128.100.34.0
        broadcast 128.100.34.127
        gateway 128.100.34.1


and then this little script I wrote brings one up and the other down:

ifdown -a
ifup eth0=net-sidsmith
ifup lo

do you have a trick that somehow avoids such manipulation?

m



Reply to: