Welcome to the { mindfrost82.com } forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Linux > Linux Networking

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-30-2008, 08:55 AM
Andreas Moroder
 
Posts: n/a
network init script for two machines ( image )

Hello,

Before I start with the question I have to explain the situation:

we have two identical machines ( except the mac address ) with RAID
disks and SLES 10. To have them identical we move one of the raid disks
from one machine to the second and recreate the raid. The hostname and
the IP are the only things that have to be different.

Now to the question:

how can I create a network init script that sets two different hostnames
and IP adresses starting from the mac address ?
If it finds MAC 00:30:05:9B:3B:03 it should set hostname hosta and Ip
10.1.1.10, if it finds MAC 00:30:05:9B:3B:1B, then hostname should be
hostb and IP 10.1.1.12

Thanks
Andreas
Reply With Quote
  #2 (permalink)  
Old 06-30-2008, 11:05 AM
Bill Marcum
 
Posts: n/a
Re: network init script for two machines ( image )

On 2008-06-30, Andreas Moroder <Andreas.moroder@[nospam]> wrote:
>
>
> Hello,
>
> Before I start with the question I have to explain the situation:
>
> we have two identical machines ( except the mac address ) with RAID
> disks and SLES 10. To have them identical we move one of the raid disks
> from one machine to the second and recreate the raid. The hostname and
> the IP are the only things that have to be different.
>
> Now to the question:
>
> how can I create a network init script that sets two different hostnames
> and IP adresses starting from the mac address ?
> If it finds MAC 00:30:05:9B:3B:03 it should set hostname hosta and Ip
> 10.1.1.10, if it finds MAC 00:30:05:9B:3B:1B, then hostname should be
> hostb and IP 10.1.1.12
>
> Thanks
> Andreas


DHCP
Avahi
IPv6
Reply With Quote
  #3 (permalink)  
Old 06-30-2008, 12:33 PM
Andreas Moroder
 
Posts: n/a
Re: network init script for two machines ( image )

Bill Marcum schrieb:
>
> DHCP
> Avahi
> IPv6


Hello,

I don't like the idea to have a server that depends on a functioning
DHCP server

Bye
Andreas
Reply With Quote
  #4 (permalink)  
Old 06-30-2008, 12:51 PM
pk
 
Posts: n/a
Re: network init script for two machines ( image )

On Monday 30 June 2008 09:55, Andreas Moroder wrote:

> Hello,
>
> Before I start with the question I have to explain the situation:
>
> we have two identical machines ( except the mac address ) with RAID
> disks and SLES 10. To have them identical we move one of the raid disks
> from one machine to the second and recreate the raid. The hostname and
> the IP are the only things that have to be different.
>
> Now to the question:
>
> how can I create a network init script that sets two different hostnames
> and IP adresses starting from the mac address ?
> If it finds MAC 00:30:05:9B:3B:03 it should set hostname hosta and Ip
> 10.1.1.10, if it finds MAC 00:30:05:9B:3B:1B, then hostname should be
> hostb and IP 10.1.1.12


Find out the MAC address, eg something like

mac=$(ifconfig eth0 | sed -n 's/.*HWaddr \([^ ]*\).*/\1/p')

if [ "$mac" = "00:30:05:9B:3B:03" ]; then
ifconfig eth0 10.1.1.10 netmask 255.255.255.0 up
# rest of config...
else
ifconfig eth0 10.1.1.12 netmask 255.255.255.0 up
# rest of config...
fi

Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Linux > Linux Networking


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 11:46 AM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Personal Loans | Mortgage | Mobile Phone | Power Tools | Secured Loans



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114