CentOS - IP Setting - Static IP- Command Line

Commands required to set a static IP in CentOS  are

. In Terminal , turn into root user and type as

vi /etc/sysconfig/network-scripts/ifcfg-eth0
There Place the content as





There as you can see the parameter. Set similar in your PC.Then save & close it with <Shift> + <:> +<w> + <q> .

Then In terminal type as

vi /etc/sysconfig/network

There give your Gateway as shown






You can disable/Enable network from there.

Then check your Gateway updated or not with

route -n

Then after that restart your network with

service network restart


Thats it. Now you can connect to your CentOS to Internet.
Points to remember : Nothing much !! all you have to execute the commands as root user.



Comments

Popular posts from this blog

grep: unknown device method

Uploading files to FTP/SFTP using CURL

How to find outgoing IP in Linux ?