FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 10-02-2011, 05:31 PM
Camaleón
 
Default IP address depending on the MAC

On Sun, 02 Oct 2011 18:31:59 +0200, Ireneusz Szcześniak wrote:

> I'm planning to install an image of Debian to a number of computers.
> Each of these computers will have the same configuration except the
> hostname and the IP address. The IP configuration has to be static. I
> can't use a DHCP server.
>
> QUESTION; Is there a way to assign a hostname and a static IP address at
> boot time depending on the MAC address of the computer's network
> interface card?

Hum... maybe you can use a different preseeding file with just varying
the hostname and IP address to fit every computer :-?

http://d-i.alioth.debian.org/manual/en.i386/apb.html

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: pan.2011.10.02.17.31.20@gmail.com">http://lists.debian.org/pan.2011.10.02.17.31.20@gmail.com
 
Old 10-02-2011, 06:02 PM
"H.S."
 
Default IP address depending on the MAC

On 02/10/11 12:31 PM, Ireneusz Szcześniak wrote:
> Hi,
>
> I'm planning to install an image of Debian to a number of computers.
> Each of these computers will have the same configuration except the
> hostname and the IP address. The IP configuration has to be static. I
> can't use a DHCP server.
>
> QUESTION; Is there a way to assign a hostname and a static IP address at
> boot time depending on the MAC address of the computer's network
> interface card?

I use dnsmasq for exactly this purpose (my home lan is quite small
though). Works quite well.




--

Please reply to this list only. I read this list on its corresponding
newsgroup on gmane.org. Replies sent to my email address are just
filtered to a folder in my mailbox and get periodically deleted without
ever having been read.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: j6a8up$niv$1@dough.gmane.org">http://lists.debian.org/j6a8up$niv$1@dough.gmane.org
 
Old 10-02-2011, 06:19 PM
green
 
Default IP address depending on the MAC

On 02/10/11 12:31 PM, Ireneusz Szcześniak wrote:
> The IP configuration has to be static. I can't use a DHCP server.

H.S. wrote at 2011-10-02 13:02 -0500:
> I use dnsmasq for exactly this purpose (my home lan is quite small
> though). Works quite well.

dnsmasq is a DHCP server, which the original poster said can not be used.
 
Old 10-02-2011, 06:52 PM
Javier Barroso
 
Default IP address depending on the MAC

Hello,

2011/10/2 Ireneusz Szcześniak <irek.szczesniak@gmail.com>:
> Hi,
>
> I'm planning to install an image of Debian to a number of computers. Each of
> these computers will have the same configuration except the hostname and the
> IP address. *The IP configuration has to be static. I can't use a DHCP
> server.
>
> QUESTION; Is there a way to assign a hostname and a static IP address at
> boot time depending on the MAC address of the computer's network interface
> card?
If you know which macs you will have, you can make an init script
which generate /etc/network/interface and /etc/hostname and /etc/hosts
the first boot and then remove itself.

Imagine:

$ cat /etc/machines
mac1 ip1 hostname1
....
macN ipN hostname N

$ cat /etc/init.d/10setnetworkonlyfirstboot
#!/bin/bash
mymac=$(ip add show dev eth0 | awk '/ether/ {print $2}')
myhost=$(awk "/$mymac/ {print $3}")
myip=$(awk "/$mymac/ {print $2}")

sed -i "s/IP/$myip" /etc/network/interfaces # and probably some
changes in /etc/hosts
sed -i "s/HOSTNAME/$myhost" /etc/hostname # and probably some changes
in /etc/hosts
rm -f /etc/init.d/10setnetworkonlyfirstboot

$ cat /etc/network/interfaces
auto eth0
iface eth0 inet static
address IP
network xxx
gateway yyy

$ cat /etc/hostname
HOSTNAME

Do you think this is a good approach ? It is not very elegant, but
maybe it works.

Regards,


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: CAL5yMZS7LCV89=epUiVV1b8E_0=oBZp7W87nbEydfgwUqJ9Zd g@mail.gmail.com">http://lists.debian.org/CAL5yMZS7LCV89=epUiVV1b8E_0=oBZp7W87nbEydfgwUqJ9Zd g@mail.gmail.com
 
Old 10-02-2011, 07:19 PM
Camaleón
 
Default IP address depending on the MAC

On Sun, 02 Oct 2011 20:06:45 +0200, Ireneusz Szcześniak wrote:

> On 02.10.2011 19:31, Camaleón wrote:
>
>> On Sun, 02 Oct 2011 18:31:59 +0200, Ireneusz Szcześniak wrote:
>>
>>> I'm planning to install an image of Debian to a number of computers.
>>> Each of these computers will have the same configuration except the
>>> hostname and the IP address. The IP configuration has to be static. I
>>> can't use a DHCP server.
>>>
>>> QUESTION; Is there a way to assign a hostname and a static IP address
>>> at boot time depending on the MAC address of the computer's network
>>> interface card?
>>
>> Hum... maybe you can use a different preseeding file with just varying
>> the hostname and IP address to fit every computer :-?
>>
>> http://d-i.alioth.debian.org/manual/en.i386/apb.html

> Camaleón, thank you for your input. However, I don't want to install
> the system from scratch, but to clone a previously prepared image.

Ah... okay :-)

> True, I wasn't clear enough. Ideally, I would like to have a config
> file that would list MAC addresses and IP addresses that these NICs
> should have.

Hum... if I understood you correctly, you want to "dump" a previously
generated ISO image into a set of computers, right?

Then I dunno how to get the job done as the image will just "copy back"
all of the settings that were stored on it when it was generated so if
hostname and networking settings were configured to use fixed values (and
not dynamically set) this will prevail when system first boots.

But I fail to see the problem in making the required changes afterwards,
once the system starts up :-?

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: pan.2011.10.02.19.19.27@gmail.com">http://lists.debian.org/pan.2011.10.02.19.19.27@gmail.com
 
Old 10-02-2011, 08:37 PM
Raf Czlonka
 
Default IP address depending on the MAC

On Sun, Oct 02, 2011 at 05:31:59PM BST, Ireneusz Szcześniak wrote:
> I'm planning to install an image of Debian to a number of computers.
> Each of these computers will have the same configuration except the
> hostname and the IP address. The IP configuration has to be static.
> I can't use a DHCP server.
>
> QUESTION; Is there a way to assign a hostname and a static IP
> address at boot time depending on the MAC address of the computer's
> network interface card?

I was about to suggest preseeding as well - works great if you combine
it with pxelinux, even if you need to set up a DHCP server on a small
subnet only for that purpose. But if it doesn't, your option is a
script - try some scripts/rules from ifupdown* packages and/or maybe
combined them with one of the IP autoconfig utils found in Debian.

Regards,
--
Raf


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20111002203733.GA21107@linuxstuff.pl">http://lists.debian.org/20111002203733.GA21107@linuxstuff.pl
 
Old 10-02-2011, 10:13 PM
"H.S."
 
Default IP address depending on the MAC

On 02/10/11 02:08 PM, Ireneusz Szcześniak wrote:
> Dnsmasq is a DHCP and DNS server combined. As I mentioned before, I
> can't use a DHCP server.
>
> On 02.10.2011 20:02, H.S. wrote:
>> On 02/10/11 12:31 PM, Ireneusz Szcześniak wrote:
>>> Hi,
>>>
>>> I'm planning to install an image of Debian to a number of computers.
>>> Each of these computers will have the same configuration except the
>>> hostname and the IP address. The IP configuration has to be static. I
>>> can't use a DHCP server.
>>>
>>> QUESTION; Is there a way to assign a hostname and a static IP address at
>>> boot time depending on the MAC address of the computer's network
>>> interface card?
>>
>> I use dnsmasq for exactly this purpose (my home lan is quite small
>> though). Works quite well.
>
>

Ah, was too hasty in reading and replying, sorry about that. It did feel
like the answer was too obvious

--

Please reply to this list only. I read this list on its corresponding
newsgroup on gmane.org. Replies sent to my email address are just
filtered to a folder in my mailbox and get periodically deleted without
ever having been read.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: j6anmj$bb8$1@dough.gmane.org">http://lists.debian.org/j6anmj$bb8$1@dough.gmane.org


Mon Oct 3 01:30:01 2011
Return-path: <aur-general-bounces@archlinux.org>
Envelope-to: tom@linux-archive.org
Delivery-date: Mon, 03 Oct 2011 01:07:37 +0300
Received: from gerolde.archlinux.org ([66.211.214.132]:40157 helo=archlinux.org)
by s2.java-tips.org with esmtp (Exim 4.69)
(envelope-from <aur-general-bounces@archlinux.org>)
id 1RAUC8-0006Ye-TJ
for tom@linux-archive.org; Mon, 03 Oct 2011 01:07:36 +0300
Received: from gudrun.archlinux.org (gudrun.archlinux.org [66.211.214.131])
by archlinux.org (Postfix) with ESMTP id 78A4B90050;
Sun, 2 Oct 2011 18:16:29 -0400 (EDT)
Received: from archlinux.org (gerolde.archlinux.org [66.211.214.132])
by gudrun.archlinux.org (Postfix) with ESMTP id 78E648421D
for <aur-general@archlinux.org>; Sun, 2 Oct 2011 18:16:28 -0400 (EDT)
Received-SPF: pass (gmail.com ... _spf.google.com: 209.85.210.172 is
authorized to use 'eduardosanchezmunoz@gmail.com' in 'mfrom' identity
(mechanism 'ip4:209.85.128.0/17' matched)) receiver=gerolde.archlinux.org;
identity=mailfrom; envelope-from="eduardosanchezmunoz@gmail.com";
helo=mail-iy0-f172.google.com; client-ip 9.85.210.172
Received: from mail-iy0-f172.google.com (mail-iy0-f172.google.com
[209.85.210.172])
by archlinux.org (Postfix) with ESMTPS id 5C7E19004E
for <aur-general@archlinux.org>; Sun, 2 Oct 2011 18:16:27 -0400 (EDT)
Received: by iaby26 with SMTP id y26so4325047iab.3
for <aur-general@archlinux.org>; Sun, 02 Oct 2011 15:16:41 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
h=mime-version:in-reply-to:references:date:message-id:subject:from:to
:content-type; bh=Ho1TwyM9zEWXl1lb9GoT3dt4bJxKOLieB0HPtgLybXk=;
b=pS5lutqhuaCz7+ARTrQmz+3/WMG5bKubbX5DHb/UUy19vOGZuAdNRBp/flnBfEv4Gk
xhWu1rACNeYcbHaqJSpxImcD1fe+NCFfy3XjXmZ3R6qC7hPvm9 FhZIb2TdJ/bXKCnHyr
ziDOrrW4/+P3ZhjgFLjvfDF5dO3aSWq/9XPMAMIME-Version: 1.0
Received: by 10.42.18.4 with SMTP id v4mr6474953ica.124.1317593801336; Sun, 02
Oct 2011 15:16:41 -0700 (PDT)
Received: by 10.42.213.3 with HTTP; Sun, 2 Oct 2011 15:16:41 -0700 (PDT)
Received: by 10.42.213.3 with HTTP; Sun, 2 Oct 2011 15:16:41 -0700 (PDT)
In-Reply-To: <4E88D0FE.3080809@t-online.de>
References: <CAPvM6ZPkgSOALqMg5E=m0yGf0t7iMmo+=kk5BLe6=LsbMTSz mA@mail.gmail.com>
<4E88D0FE.3080809@t-online.de>
Date: Mon, 3 Oct 2011 00:16:41 +0200
Message-ID: <CAPvM6ZMK+p5yae-5uGodWQWHa4VMEag7JMf_0qR�TOL1UiFA@mail.gmail.com >
From: =?ISO-8859-1?Q?Eduardo_S�hez_Mu� <eduardosanchezmunoz@gmail.com>
To: "Discussion about the Arch User Repository (AUR)"
<aur-general@archlinux.org>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Content-Filtered-By: Mailman/MimeDel 2.1.14
Subject: Re: [aur-general] Package deleteion request
X-BeenThere: aur-general@archlinux.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: "Discussion about the Arch User Repository (AUR)"
<aur-general@archlinux.org>
List-Id: "Discussion about the Arch User Repository (AUR)"
<aur-general.archlinux.org>
List-Unsubscribe: <http://mailman.archlinux.org/mailman/options/aur-general>,
<mailto:aur-general-request@archlinux.org?subject=unsubscribe>
List-Archive: <http://mailman.archlinux.org/pipermail/aur-general>
List-Post: <mailto:aur-general@archlinux.org>
List-Help: <mailto:aur-general-request@archlinux.org?subject=help>
List-Subscribe: <http://mailman.archlinux.org/mailman/listinfo/aur-general>,
<mailto:aur-general-request@archlinux.org?subject=subscribe>
Errors-To: aur-general-bounces@archlinux.org
Sender: aur-general-bounces@archlinux.org

Sorry! I forgot to give the reason.
Yes, the projects have been moved from.one version control to another or
renamed, so now the old PKGBUILDs are not working.

Thanks.
El 02/10/2011 23:00, "Stefan Husmann" <stefan-husmann@t-online.de> escribi� Am 02.10.2011 19:22, schrieb Eduardo S�hez Mu�
>> Hello, I would like to delete all my packages [1] of the AUR that have
been
>> marked as outdate.
>>
>> Thanks
>>
>> [1] https://aur.archlinux.org/packages.php?SeB=m&K=eduardosm
>>
> Hello,
>
> why? We normally do not delete packages without a good reason. I saw some
> concurring VCS-versions (svn versus hg or so) among your packages. That
> would be a good reason.
>
> If you just want to get rid of them, you can just orphan them.
>
> Best Regards
> Stefan
 
Old 10-02-2011, 11:36 PM
Liam O'Toole
 
Default IP address depending on the MAC

On 2011-10-02, Ireneusz Szcześniak <irek.szczesniak@gmail.com> wrote:
> Dnsmasq is a DHCP and DNS server combined. As I mentioned before, I
> can't use a DHCP server.
>
> On 02.10.2011 20:02, H.S. wrote:
>> On 02/10/11 12:31 PM, Ireneusz Szcześniak wrote:
>>> Hi,
>>>
>>> I'm planning to install an image of Debian to a number of computers.
>>> Each of these computers will have the same configuration except the
>>> hostname and the IP address. The IP configuration has to be static. I
>>> can't use a DHCP server.
>>>
>>> QUESTION; Is there a way to assign a hostname and a static IP address at
>>> boot time depending on the MAC address of the computer's network
>>> interface card?
>>
>> I use dnsmasq for exactly this purpose (my home lan is quite small
>> though). Works quite well.
>

Could you elaborate on why you can't use a DHCP server? I ask this
because you can set up dnsmasq to assign a fixed IP address to a client
based on its hostname or MAC address, and to give clients an infinite
lease. Therefore it offers a convenient way to allocate effectively
static IP addresses from a central location.

--
Liam O'Toole
Cork, Ireland


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: slrnj8htci.2d1.liam.p.otoole@dipsy.tubbynet">http://lists.debian.org/slrnj8htci.2d1.liam.p.otoole@dipsy.tubbynet
 
Old 10-02-2011, 11:45 PM
Lisi
 
Default IP address depending on the MAC

On Sunday 02 October 2011 17:31:59 Ireneusz Szcześniak wrote:
> QUESTION; Is there a way to assign a hostname and a static IP address
> at boot time depending on the MAC address of the computer's network
> interface card?

I can do this via my router if I wish, and set the computer up with dhcp. It
is possible to tell the router that specific addresses must be reserved for
specific MACS.

Lisi


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 201110030045.26730.lisi.reisz@gmail.com">http://lists.debian.org/201110030045.26730.lisi.reisz@gmail.com
 
Old 10-02-2011, 11:46 PM
Lisi
 
Default IP address depending on the MAC

On Sunday 02 October 2011 19:08:26 Ireneusz Szcześniak wrote:
> As I mentioned before, I
> can't use a DHCP server.

Ah, sorry. I missed that. Ignore the noise from me!

Lisi


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 201110030046.31830.lisi.reisz@gmail.com">http://lists.debian.org/201110030046.31830.lisi.reisz@gmail.com
 

Thread Tools




All times are GMT. The time now is 02:30 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org