Just change the variables at the top to your own.
Code:
#!/bin/bash
# Static Networking Setup for Ubuntu Web Server
# by Zach Browne - http://zachbrowne.com
# Replace these variables with your own
HOSTNAME=zeus # Ex. server, dev or zeus
HOSTNAME_FQDN=zeus.browne.cm # Ex. server.domain.com, dev.domain.com or zeus.domain.com
TIMEZONE=Central # Central, Eastern, Pacific or Mountain
LINODE_PUBLIC_IP=96.126.124.64
LINODE_SERVER_GATEWAY_IP=96.126.124.1
LINODE_PRIVATE_IP=192.168.147.82
LINODE_DNS_RESOLVER1=72.14.188.5
LINODE_DNS_RESOLVER2=72.14.179.5
# Set time & update server
ln -sf /usr/share/zoneinfo/US/$TIMEZONE /etc/localtime
aptitude update && aptitude -y safe-upgrade
# Setup hosts file
rm /etc/hosts
touch /etc/hosts
cat > /etc/hosts <<EOF
127.0.0.1 localhost.localdomain localhost
$LINODE_PUBLIC_IP $HOSTNAME_FQDN $HOSTNAME
EOF
# Setup static IP
rm /etc/network/interfaces
touch /etc/network/interfaces
cat > /etc/network/interfaces <<EOF
auto lo
iface lo inet loopback
auto eth0 eth0:1
iface eth0 inet static
address $LINODE_PUBLIC_IP
netmask 255.255.255.0
gateway $LINODE_SERVER_GATEWAY_IP
iface eth0:1 inet static
address $LINODE_PRIVATE_IP
netmask 255.255.128.0
EOF
# Remove DHCP
aptitude -y remove dhcpcd
# Add options rotate
rm /etc/resolv.conf
touch /etc/resolv.conf
cat > /etc/resolv.conf <<EOF
search members.linode.com
nameserver $LINODE_DNS_RESOLVER1
nameserver $LINODE_DNS_RESOLVER2
options rotate
EOF
# Install Bind9 to cache Linode's DNS servers.
aptitude -y install bind9
rm /etc/bind/named.conf.options
touch /etc/bind/named.conf.options
cat > /etc/bind/named.conf.options <<EOF
{
directory "/var/cache/bind";
auth-nxdomain no;
forwarders {69.93.127.10;65.19.178.10;75.127.96.10;207.192.70.10;109.74.194.10;};
listen-on-v6 {any;};
};
EOF
# Restart networking
/etc/init.d/networking restart