RE: static ips and automation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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



[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux