nano /etc/sysconfig/network-scripts/ifcfg-eth0
( if you also have a second uplink, the next interface will be eth1 )
the file will have to look like this:
DEVICE=eth0
BOOTPROTO=static
IPADDR=1.1.1.1
NETMASK=255.255.255.0
ONBOOT=yes
GATEWAY=1.1.1.254
You must also make sure the correct gateway is listed in the /etc/sysconfig/network file.
After that restart the network with:
service network restart
For Debian:
With Debian the networkconfig is saved in /etc/network/interfaces and can be adjusted by:
nano /etc/network/interfaces
The config will need to look like this when you are done, substitute the below numbers for your own numbers.
auto eth0
iface eth0 inet static
address 1.1.1.1
netmask 255.255.255.0
gateway 1.1.1.1
After that restart the network with:
/etc/init.d/networking restart