Stop the network with the command:
/etc/rc.d/init.d/network stop or
service network stop
Then use the -a option in ifconfig
For example:
/sbin/ifconfig -a eth0 192.168.1.2 netmask 255.255.255.0
Verify the settings with /sbin/ifconfig eth0
Add the default gatway:
/sbin/route add default gw 192.168.1.1
Verify the gateway setting: /sbin/route.
The line beginning with default should have your gateway under the gateway column.
You can edit / check the settings in the files
Code:
/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
USERCTL=no
ONBOOT=yes
BOOTPROTO=none
BROADCAST=192.168.1.255
NETWORK=192.168.1.0
NETMASK=255.255.255.0
IPADDR=192.168.1.2
and /etc/sysconfig/network.
NETWORKING=yes
HOSTNAME=comp1.mydomain.com
FORWARD_IPV4=yes
GATEWAYDEV=
GATEWAY=192.168.1.1
Don't forget to restart the network with the command:
/etc/rc.d/init.d/network start or
service network start