zoukankan      html  css  js  c++  java
  • 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

     

  • 相关阅读:
    NSInvocation 回调使用
    C#控制台源程序分享
    HTML 表单控件的汇总
    学习笔记(2):HTML 常用标签的归纳
    学习笔记(4):C#中的正则简单总结
    学习笔记(5):DIV+CSS 经典盒子模型 积累
    学习笔记(3):sql语句的总结
    毕业一年小结
    头文件方法问题
    百度被黑事件
  • 原文地址:https://www.cnblogs.com/feichan/p/2701475.html
Copyright © 2011-2022 走看看