Networking Forums

Networking Forums > Computer Networking > Linux Networking > network init script for two machines ( image )

Reply
Thread Tools Display Modes

network init script for two machines ( image )

 
 
Andreas Moroder
Guest
Posts: n/a

 
      06-30-2008, 07:55 AM
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
 
 
 
 
Bill Marcum
Guest
Posts: n/a

 
      06-30-2008, 10:05 AM
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
 
Andreas Moroder
Guest
Posts: n/a

 
      06-30-2008, 11:33 AM
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
 
pk
Guest
Posts: n/a

 
      06-30-2008, 11:51 AM
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

Thread Tools
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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
sending init file / firmware to a network driver via kernel Benzy Gabay Linux Networking 2 01-09-2007 11:27 AM
RIS install for XP VL image from Server2003 : lost network driver nick brandwood Windows Networking 0 10-18-2005 04:00 PM
Configure htb.init or cbq.init cudjoe Linux Networking 0 12-01-2003 08:31 PM
nfs slow init diego sollier Linux Networking 0 10-30-2003 02:53 PM
Cannot get /sbin/init to run. Edward Grace Linux Networking 0 09-03-2003 07:59 PM



1 2 3 4 5 6 7 8 9 10 11