How to Configure Static IP Address on CentOS 6.3 Linux Server

    This post will covers the steps to configure static ip address, default gateway, netmask, dns server and make a network auto start at boot on linux CentOS 6.3. Server normally configured with static ip address, so that easier to maintain the configuration on it’s client and DNS server will always able to resolve it.

DEVICE="eth0"
BOOTPROTO="dhcp"
HWADDR="xx:xx:xx:xx:xx:xx"
NM_CONTROLLED="yes"
ONBOOT="no"
TYPE="Ethernet"
UUID="xxxxxxxx-05a0-4adf-84fd-850aca6521c7"

1. Configure eth0:

[root@centos63 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="static"
HWADDR="xx:xx:xx:xx:xx:xx"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"
UUID="xxxxxxxx-05a0-4adf-84fd-850aca6521c7"
IPADDR=192.168.1.54
NETMASK=255.255.255.0

2. Configure Default gateway:

[root@centos63 ~]# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=centos63.ehowstuff.local
GATEWAY=192.168.1.1

3. Restart Network interface:

[root@centos63 ~]# service network restart
Shutting down interface eth0:                              [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:                                [  OK  ]

4. Configure DNS server :

[root@centos63 ~]# vi /etc/resolv.conf
nameserver 8.8.8.8

 

 

转载于:https://www.cnblogs.com/feichan/archive/2012/09/25/2701475.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值