Linux NAT network connection authority Guide

Source: Internet
Author: User

Linux NAT network connection authority Guide
[1] preparations, written in the previous section 1.1) Check the Service (cmd> services. msc, I am using VM) 1.2) Make sure that the Vmnet8 connection is in the starting state + get the ipv4 (ipv6) address (for reference when the network connection is incorrect) 1.3) virtual Machine choose VMnet8 (NAT mode) [2] After Linux Distribution is installed, SET network connection 2.1) vim/etc/sysconfig/network-scripts/ifcfg-eth0, for example, (this is a lite version of the network configuration file, you can use it, I personally think) Attention: A1) DEVICE is my Nic information, through cat/etc/udev/rules. d/70-persistent-net.rules can view A2) BOOTPROTO = static, indicating that I manually set the network IP address; A3) HWADDR = 00: 0C: 29: 05: 4F: 17 (see the last and third lines in the "ATTR (address)" section. It is the MAC address (physical address) of the network adapter. Each host has a different sub-host. do not modify the MAC address because when the virtual network adapter is created, the ipv4 address is already available by default; A4) IPADDR = 192.168.186.100 is an ipv4 address. You only need to ensure that the ipv4 address of the first three fields and the ipv4 address of the last figure in [1.2] are in the same CIDR block, but it must be greater than the GATEWAY address and less than 255; A4) NETMASK = 255.255.255.0 is the subnet mask, and 255.255.255.0; A5) TYPE = Ethernet indicates that the lan type is Ethernet; A6) ONBOOT = yes indicates the connection is established when the instance is started; A7) GATEWAY = 192.168.186.2 GATEWAY address, see the ipv4 address in the last figure in [1.2, the GATEWAY must be larger 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 configuring the network connection and dns domain name server, we restart the network service (service network restart). After restarting the network service, resolv. conf will be reset, making it impossible to ping www.baidu.com. Solution: Solution (two types): S1. resolv is edited. 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


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.