Difference between revisions of "centos static IP config"
From thelinuxwiki
(Created page with "file structure / paths similar / same as redhat example /etc/sysconfig/ifcfg-eth0 file DEVICE=eth0 BOOTPROTO=none ONBOOT=yes NETWORK=10.0.1.0 NETMASK=255.255.255.0 ...") |
|||
(5 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
− | file structure / paths similar / same as redhat | + | file structure / paths similar / same as redhat. manual says to run system-config-network... but that utility wasn't installed on my centos. so, this method of configuring the network interfaces is done by manually editing the config files. it is good to know where they are anyway right? also included in this example is the default gateway config. |
example /etc/sysconfig/ifcfg-eth0 file | example /etc/sysconfig/ifcfg-eth0 file | ||
Line 9: | Line 9: | ||
IPADDR=10.0.1.27 | IPADDR=10.0.1.27 | ||
USERCTL=no | USERCTL=no | ||
+ | GATEWAY=10.0.1.254 | ||
then... | then... | ||
/etc/init.d/network restart | /etc/init.d/network restart | ||
+ | |||
+ | [[http://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-networkscripts-interfaces.html more info found here]] | ||
[[category:centos]] | [[category:centos]] |
Latest revision as of 20:52, 8 May 2013
file structure / paths similar / same as redhat. manual says to run system-config-network... but that utility wasn't installed on my centos. so, this method of configuring the network interfaces is done by manually editing the config files. it is good to know where they are anyway right? also included in this example is the default gateway config.
example /etc/sysconfig/ifcfg-eth0 file
DEVICE=eth0 BOOTPROTO=none ONBOOT=yes NETWORK=10.0.1.0 NETMASK=255.255.255.0 IPADDR=10.0.1.27 USERCTL=no GATEWAY=10.0.1.254
then...
/etc/init.d/network restart