在虛擬機中,給CentOS設置靜態IP地址

原文地址:https://lintut.com/how-to-configure-static-ip-address-on-centos-6-5-minimal/

How to configure static IP address on CentOS 6.5 minimal

By default CentOS minimal install does not come with pre-configure network. In this small tutorial i will explain how to set static ip address on CentOS 6.5 minimal.
First, need to edit the set up for the ethernet. Let’s start with editing this file:ide

# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=1c:65:9d:93:fc:e1
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=none
IPV6INIT=no
USERCTL=no
NM_CONTROLLED=yes
PEERDNS=yes
IPADDR=192.168.0.101
NETMASK=255.255.255.0

Now, configure default getaway:post

# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=centos6
GATEWAY=192.168.0.1
相關文章
相關標籤/搜索