Monday, February 13, 2012

How to switch dhcp to static ip and change hostname on Linux

Change Hostname
1. vi /etc/sysconfig/network
2. change  HOSTNAME=xxxxxx
3. save changes 
4.  restart the xinetd service. (ex: type service xinetd restart


Change DHCP to Static IP
1.  vi /etc/sysconfig/network-scripts/ifcfg-eth0
2.  do the below changes 
from


DEVICE=eth0 
BOOTPROTO=dhcp 
HWADDR=00:D0:B7:08:09:BB 
ONBOOT=yes


To



DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
HWADDR=00:16:3E:17:82:7C
IPADDR=192.168.1.146
NETMASK=255.255.255.0
GATEWAY=192.168.1.254
TYPE=Ethernet




No comments:

Post a Comment