The use of Linux certainly needs to connect the network, here I summarize the Linux configuration network method,
Here we use virtual machines to emulate the server, let's first meet the VMware workstation three ways to get online (note that there is no direct relationship with the server in the production environment)
1. Bridge Connection:
Simple can be understood as, directly through the physical network card, virtual machine and physical machine in the same network segment, the equivalent of simulating a real host. This requires a router environment and requires the LAN DCHP service to assign addresses.
2. NAT
NAT (Network Adress translation), net address translation. In simple terms, the Internet and the exchange of data via a host (physical computer).
Nat mode is connected to the Internet via the VMNET8 network card, at this time the VMware NAT Servixe is equivalent to the router, responsible for sending the virtual machine to the VMNET8 packet for address translation to the actual network, and then the actual network returned packets sent to the virtual machine after the address conversion VMnet8. VMWare DCHP Servie is responsible for assigning IP addresses to virtual machines.
NAT network is suitable for home computer direct Connection network cable, of course, office LAN can also be used.
3. Host only
In host-only mode, the network card of the virtual machine is connected to the host's VMnet1, but the system does not provide any routing services for the virtual machine, so the virtual machine can only communicate with the host and cannot connect to the actual network, that is, the Internet is not available.
Nat mode is used as the configuration tutorial here.
1, first we modify the information in the configuration file
[Email protected] ~]# Vim/etc/sysconfig/network-scripts/ifcfg-eth0 device=eth0hwaddr=00:0c:29:3a:80:6ftype= ethernetuuid=88ead49d-5dac-4344-9d64-85044521aa20onboot=nonm_controlled=yesbootproto=dhcpdns1= 192.168.67.2userctl=nopeerdns=yesipv6init=no
change onboot=no This column to Onboot=yes otherwise, when restarting the server again, the NIC will not boot itself .
1, because the choice is the NAT mode, by the host as a router for the virtual machine to assign IP, so through the DCHP service can, and then only need to configure DNS to be able. We can modify the configuration file directly, or we can manage the configuration through the Setup tool. If you use the configuration file modification, modify your profile to be the same as above, note: Configure DNS to use your computer's DNS, the information above me on this computer, I configure a LAN segment on the network can be.
2. Configure the network through the Setup tool
1, [[email protected] ~]# Setup
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/9D/CB/wKioL1mGh_bQABrpAAA27-uOMwQ256.png "title=" QQ picture 20170806105854.png "alt=" Wkiol1mgh_bqabrpaaa27-uomwq256.png "/>
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/9D/CB/wKioL1mGiFDCc6GgAAAooH_wLdw708.png "title=" QQ picture 20170806105956.png "alt=" Wkiol1mgifdcc6ggaaaooh_wldw708.png "/>
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/9D/CB/wKiom1mGh_fRjgq8AAA2qiyo9vg743.png "title=" QQ picture 20170806110030.png "alt=" Wkiom1mgh_frjgq8aaa2qiyo9vg743.png "/>
2, whether by modifying the configuration file or through the Setup tool configuration, and finally need to restart the network card is configured to take effect, here are several commands to restart the network card:
1, [[email protected] ~]# service Network restart 2, [[email protected] ~]#/etc/init.d/network restart 3, [[Email Prot Ected] ~]# ifup eth0
All of the above three ways can, after restarting the network card, you can socialize the local IP via the ifconfig command, you can connect remotely via the host.
[Email protected] ~]# ifconfig
Once the IP address has been queried, it can be connected remotely.
This article is from the "12162969" blog, please be sure to keep this source http://12172969.blog.51cto.com/12162969/1953955
Centos6.6--linux Network Configuration