how can I set a static ip address on centos

i know i would have to edit a conf file or something , if i wanted to put a static ip . mask and gateway what file would i edit and what is the format ?
LVL 1
NAMEWITHELD12Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
PapertripConnect With a Mentor Commented:
[user@box ~]$ cd /etc/sysconfig/network-scripts/
[user@box network-scripts]$ cat ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
IPADDR=10.190.3.105
NETMASK=255.255.255.192
GATEWAY=10.190.3.111

Open in new window


You can put the gateway in there for a device specific gateway, or you can add that same line to /etc/sysconfig/network to make it the default gateway.

0
 
NAMEWITHELD12Author Commented:
thAnks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.