static ips and automation

Elizabeth.Brosch at thomson.com Elizabeth.Brosch at thomson.com
Wed Feb 15 19:57:34 UTC 2006



Liz Brosch
TSH System Services
Philadelphia, PA  19104
office:  (215) 386-0100 x1144
cell:     (267) 784-9166
I configure static IPs for each host as part of the post-install.  

Here is the simple script I use to change to static IP addressing:

#!/bin/sh
# replace /etc/sysconfig/network and
/etc/sysconfig/network-scripts/ifcfg-eth0
# to use static IP addressing, not DHCP
echo -n "Switching to static IP address allocation..."
(cat << EOF
NETWORKING=yes
HOSTNAME=xxxxxxx
GATEWAY=xx.xxx.xx.x
NISDOMAIN=xxxxx.com
EOF
) > /etc/sysconfig/network
/bin/chmod 644 /etc/sysconfig/network
(cat << EOF
DEVICE=eth0
BOOTPROTO=static
BROADCAST=xxx.xxx.xxx.xxx
IPADDR=xxx.xxx.xxx.xxx
NETMASK=xxx.xxx.xxx.xxx
NETWORK=xxx.xxx.xxx.xxx
ONBOOT=yes
EOF
) > /etc/sysconfig/network-scripts/ifcfg-eth0
/bin/chmod 644 /etc/sysconfig/network-scripts/ifcfg-eth0
echo " done"

Elizabeth Brosch





More information about the Kickstart-list mailing list