A pirate once asked me why anyone would be foolish enough to run an operating system that hasn't been updated since 1999. As I strangled the life from him, I pondered this question and realized that the answer is irrelevant; if my clan leader instructs me to guide this feeble and vunerable install along the Path of Prosperity, what ninja am I to question him?
To do this, one must first plan the attack, for as any ninja knows a poorly conceived attack will fail and bring dishonor on his or her clan. Only pirates use the GUI to make any changes to a Unix system; therefore we will focus the incredible power of our will on the commandline. There are three files that must be updated:
- /etc/hosts
- /etc/sysconfig/network
- /etc/sysconfig/network-scripts/ifcfg-eth0 (this assumes your ethernet port is eth0)
First, add a line to the /etc/hosts file with your machine's host name and the static IP address like this:
192.168.0.2 ninjablade
but change the IP address and the server name to match whatever you're trying to do. Static IP addresses are arguably easier to add if the server name references ninjas, vengence, or killing in some way.
Next, open the /etc/sysconfig/network file. You'll need at least three lines in this file:
NETWORKING=yes
HOSTNAME=ninjablade.vengence.com
GATEWAY=192.168.0.1
NETWORKING may be set to dhcp; change it to yes. HOSTNAME is self-explanatory. The GATEWAY value is your default gateway and should be the IP address of your router or switch. In ninja terms, think of it like this: the gate at your dojo gives you access to the rest of the world; as such, your dojo's gate is a GATEWAY. Now, we know ninjas can leap twenty to forty feet in a single bound, as well as fly on occassion and throw bioslime but in a limited sense this analogy works.
Finally, you need to edit the /etc/sysconfig/network-scripts/ifcfg-eth0 script. Ensure the following four lines are in your script:
DEVICE="eth0"
BOOTPROTO="none"
IPADDR="192.168.0.2"
NETMASK="255.255.255.0"
ONBOOT="yes"
This tells Redhat to start the adapter during the boot process and to bind the IP address and subnet mask to the card. Once these three tasks are complete, reboot the server (ninjas don't use workstations), stab someone with a letter opener, and wait for the server to come up. When it does, you'll have a static IP address and can get back to designing throwing stars.