Linux CentOS Connection Network

Source: Internet
Author: User

1, in the installation process do not select the network adapter, other normal execution

2. Editing

[Email protected] ~]# Vi/etc/sysconfig/network-scripts/ifcfg-eth0

Usually after installing the software, open eth0 have some records as follows:

Device= "Eth0"

Bootproto= "DHCP"

Hwaddr= "00:0c:29:a3:c0:8e"-----everyone is different.

Mm_controlled= "Yes"

Onboot= "No"

Type= "Ethernet"

uuid= "73869271-edc7-45a1-bbc7-1691af066ae2 "

Vi/etc/sysconfig/network-scripts/ifcfg-eth0 #编辑配置文件, add modify the following content

Bootproto=static #启用静态IP地址

Onboot=yes #开启自动启用网络连接

ipaddr=192.168.21.129 #设置IP地址----This IP is VMnet8 IP

netmask=255.255.255.0 #设置子网掩码

gateway=192.168.21.2 #设置网关-----This is a local IP

dns1=8.8.8.8 #设置主DNS

dns2=8.8.4.4 #设置备DNS

Ipv6init=no #禁止IPV6

: wq! #保存退出

Service Network Restart #重启网络连接

At this point, there is a mistake: network is unreachable

Solve:

1. Use chkconfig iptables off to shut down the Linux system firewall and make sure Windows Firewall shuts down as well.

2. Change the default NAT link mode in the network option to "Bridge link".

3.root User Login, modify the network configuration file, the command is as follows

[Email protected] ~]# Vi/etc/sysconfig/network-scripts/ifcfg-eth0

Then, you can see the "Ethernet Adapter VMware Network Adapter VMnet8:" IP Address "192.168.139.1" in window via cmd > ipconfig

Modify the configuration file according to the IP address, and the red part is the modified content.

完整的是:

4, after the completion of the modification, we must remember, there is a step, restart the service!

[Email protected] ~]# service network restart

After a successful reboot, the test effect

Test results, using Ifconfig view, as shown in the successful display of the Internet address:

All done, congratulations!

Reference from: http://www.osyunwei.com/archives/8398.html

Http://www.linuxidc.com/Linux/2015-02/113119.htm

Linux CentOS Connection Network

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.