CentOS Configuration Nic

Source: Internet
Author: User
Tags nameserver

Virtual machines using Oracle Vitualbox

PS: Virtual machine network settings use "Bridge"

One, configure IP

#vi/etc/sysconfig/network-scripts/ifcfg-eth0

Device=eth0 #物理设备名
ipaddr=192.168.2.200 #IP地址
netmask=255.255.255.0 #掩码值
gateway=192.168.2.1 #网关地址
Onboot=yes # [Yes|no] (whether the device is activated at boot time)
Userctl=no #[yes|no] (whether the device can be controlled by a non-root user)
Bootproto=static #[none|static|bootp|dhcp] (non-use protocol at boot | static Assignment | BOOTP protocol | DHCP protocol)

Second, configure the gateway

Vi/etc/sysconfig/network

Networking=yes (Indicates whether the system uses a network and is generally set to Yes.) If set to no, the network cannot be used, and many system services programs will not start.

Hostname=localhost.localmain (Set the hostname of this machine, the host name set here should correspond to the hostname set in/etc/hosts)

gateway=192.168.2.1

Third, modify the DNS

#vi/etc/resolv.conf

NameServer 8.8.8.8 #google域名服务器
NameServer 8.8.4.4 #google域名服务器

At last

#service Network Restart

CentOS Configuration Nic

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.