![]() |
|
|
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. |
|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
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 |
![]() |
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|