LinuxNAT network connection authority Guide

Source: Internet
Author: User
Tags domain name server

LinuxNAT network connection authority Guide
[1] Preparation, written in front1.1) Check the Service (cmd> services. msc, I use VM)

1.2) Make sure that the Vmnet8 connection is in the starting status + get the ipv4 (ipv6) Address


(For reference when the network connection is incorrect)

1.3) Select VMnet8 for the VM (NAT Mode)

[2] After Linux Distribution is installed, set the network connection 2.1) vim/etc/sysconfig/network-scripts/ifcfg-eth0, such

(This is a lite version of the network configuration file. You can use it)

Attention: A1)DEVICE is my Nic information, which can be viewed through cat/etc/udev/rules. d/70-persistent-net.rules

A2)BOOTPROTO = static, indicating that I manually set the network IP address; A3)HWADDR = 00: 0C: 29: 05: 4F: 17, do not modify it because it is already available by default when the virtual network card is created; A4)IPADDR = 192.168.186.100 this is an ipv4 address. You only need to ensure that the ipv4 address of the first three fields and the last figure in [1.2] are in the same network segment, but it must be greater than the GATEWAY address and less than 255; A4)NETMASK = 255.255.255.255.0 is the subnet mask. The default value is 255.255.255.0; A5)TYPE = Ethernet indicates that the lan type is Ethernet; A6)ONBOOT = yes indicates that the connection is established at startup; A7)GATEWAY = 192.168.186.2 GATEWAY address. For more information, see the ipv4 address in the last figure in [1.2]. This GATEWAY must be greater than the ipv4 address in the last figure of [1.2; 2.2) configure the DNS domain name server (vim/etc/resolv. conf)

Attention Problems:After the network connection and dns domain name server are configured, we restart the network service (service network restart). After the network service is restarted, resolv. conf will be reset, making it impossible to ping www.baidu.com;

 

Solution ): S1)Resolv. run chattr + I/etc/resolv. conf prohibits the file from being modified. If you need to modify the file, chattr-I/etc/resolv. conf;

S2)Of course, you can also write DNS configuration information to/etc/sysconfig/network-scripts/ifcfg-eth0


Bingo!

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.