Monday, March 19, 2012

To change IP address & hostname


# ifconfig [to show ip address]

# ifconfig eth0 ip_address [to change ip temporarily]

# vi /etc/sysconfig/network-scripts/ifcfg-eth0 [ LAN ip address]

# ping ip_address [to test connectivity]

# netconfig [to change ip permanently]

# service network restart

# ifconfig eth0:1 Ip_address [to set 2 Ip on same nic]

# PS1=’\h/\u/\w/\!/\$/\#’ or ‘Red Hat >’ [to change mode]

# hostname arif [to change hostname temporarily]

# vi /etc/sysconfig/network [to change hostname permanently]

# vi /etc/hosts [contains information about server & clients]

No comments:

Post a Comment