You know the world is going crazy when the best rapper is a white guy, the best golfer is a black guy, the tallest guy in the NBA is Chinese, the Swiss hold the America's Cup, France is accusing the U.S. of arrogance, Germany doesn't want to go to war, and the three most powerful men in America are named 'Bush', 'Dick', and 'Colon'. But the Romanians is good to all. l Centutz

How to change CentOS IP Address

12November 2008

To change centOS IP Address, you must know what network interface used with your linux installation, to check network interface, you can use this command :

root@server [/]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:E0:4D:7D:DE:D9
          inet addr:172.17.17.10  Bcast:172.17.17.15  Mask:255.255.255.248
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:12317238 errors:0 dropped:0 overruns:0 frame:0
          TX packets:13264360 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3501403361 (3.2 GiB)  TX bytes:1239051254 (1.1 GiB)
          Interrupt:21 Base address:0xd000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:269263 errors:0 dropped:0 overruns:0 frame:0
          TX packets:269263 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:166075105 (158.3 MiB)  TX bytes:166075105 (158.3 MiB)

at this example, the machine have interface eth0 that interface configured with IP 172.17.17.10.

To change IP for interface eth0, the simplest way is using ifconfig command itself, for example :

root@server [/home]# ifconfig eth0 172.17.17.9 netmask 255.255.255.248

After run that command, you can check your ip using ifconfig command again.

ifconfig command create temporary IP address change, if you reboot your server, you will see that your IP still not change. If you want make permanent ip change, you must edit files under /etc/sysconfig/network-scripts/

root@server [/]# cd /etc/sysconfig/network-scripts/
root@server [/etc/sysconfig/network-scripts]# ls
./          ifdown-bnep*   ifdown-isdn@    ifdown-sl*      ifup-eth*    ifup-isdn@   ifup-routes*    init.ipv6-global*
../         ifdown-eth*    ifdown-post*    ifdown-tunnel*  ifup-ippp*   ifup-plip*   ifup-sit*       net.hotplug*
ifcfg-eth0  ifdown-ippp*   ifdown-ppp*     ifup@           ifup-ipsec*  ifup-plusb*  ifup-sl*        network-functions
ifcfg-lo    ifdown-ipsec*  ifdown-routes*  ifup-aliases*   ifup-ipv6*   ifup-post*   ifup-tunnel*    network-functions-ipv6
ifdown@     ifdown-ipv6*   ifdown-sit*     ifup-bnep*      ifup-ipx*    ifup-ppp*    ifup-wireless*
root@server [/etc/sysconfig/network-scripts]# cat ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
IPADDR=172.17.17.10
NETMASK=255.255.255.248
ONBOOT=yes

on that example, you see that ifcfg-eth0 configure with IP 172.17.17.10, use can use text editor to change that IP, after make change you must restart your network to make your new IP active.

root@server [/]# /etc/init.d/network restart

or

root@green [/]# service network restart



ClickLink.ro http://www.adaugasite.info Blog Resources Blogs - BlogCatalog Blog Directory Yahoo! Messenger Spy Director web Adauga-site.eu add-url Director web Director Web adirector Business Portal Boxlinks - Linkuri utile CEVAceCAUTI.ro 2AddLink Web Link Directory AAAWebDirectory.com A Big Dir All Direct Links AllURLs Link Directory Anaximander Directory Listed in Web Design Directory from Apexoo AZ Links Directory Click2Directory - A FREE Website Listing Directory Service Click my Brick Directory Anaximander Directory Web Directory Directory 4U Free East Web Directory Findsome.info Directory Technorati Profile Add to Technorati Favorites Free links Directory Free Website Directory Good Directory Helpful.ws - Web Search HyperLiNK - SEO Friendly Directory Review Centutz - The Official WebSite Junglefinder Directory King of the web Link On Up Nice Directory LinkDirectory izZy Music elitescriptz.com MuRomania