Friday, May 13, 2011

Change the IP address on RedHat.

Temporary Address

1)Open Terminal
2) ifconfig -a  
to list all network interface card on the current PC.
3) Type ifconfig eth0 [IP ADDRESS] netmask 255.255.255.0 up 
to configure IP Address on interface eth0.
4)route add default gw [Gateway Address]
to configure gateway

Permanemt Address

1) Open Terminal
2)# vi/etc/sysconfig/network-scripts/ifcfg-eth0
3)Modify the file by press ‘i’ to enter insert mode. Change BOOTPROTO to static and add IP Address and Net mask
             BOOTPROTO=static
             IPADDR=192.168.1.20
             NETMASK=255.255.255.0
Save the configuration file by press ESC + ‘:’ and type ‘wq’ to write and quit the editor.
4) Restart the network interface card. Type
# service network restart
#chkconfig on
5)Review the configuration. Type
#ifconfig

Assigning Multiple IP Address to a same NIC

Upto 256 IP Addrress can be assigned to the same NIC

# cd /etc/sysconfig/network-scripts
# vi ifcfg-eth0:0
DEVICE:eth0:0
BOOTPROTO=static
IPADDR=192.168.1.1
NETMASK=255.255.255.0
ONBOOT=yes

#service network restart

# ifconfig

Assigning Range of IP Addresses to the same NIC

# vi /etc/sysconfig/network-scripts/ifcfg-eth0-range0

IPADDR_START=192.168.1.2

IPADDR_END=192.168.1.31
CLONENUM_START=2

#service network restart

#ifconfig
#chkconfig network on





No comments:

Post a Comment