CENTOS7 implementation of NAT static IP Internet in virtual machine

Source: Internet
Author: User
1. Set the virtual Machine network card VMnet8

As shown in the figure, I set the IP to 192.168.80.1, and save after setting. 2. Modify Virtual machine Parameters (1). Click the edit--> virtual network Editor, set the following figure

(2) The NAT settings are as follows



The main gateway IP set correctly, because I outside the IP set 192.168.80.1, this gateway for the outside IP network segment of any IP can, here set to 192.168.80.2, this is very important, because in the CentOS to set the relevant information. (3) DHCP settings

General point in the system is set up by default, this side should note that the DHCP mode of the random IP is in 192.168.80.128~192.168.80.254 such a range, and static IP range is 192.168.80.1~ 192.168.80.127 (cannot be duplicated with external IP and a gateway set by itself).

When the setting is complete, start CentOS and go in and set the parameter 3. Modify the CentOS parameter (1). vi/etc/sysconfig/network-scripts/ifcfg-eno16777736

Bootproto to be static, that is, statically IP mode

ipaddr is the IP address, select 192.168.80.1 to 192.168.80.127, note that you cannot repeat with the outside IP or gateway

netmask Subnet mask, for 255.255.255.0

Gateway for Gateways, 192.168.80.2, previously set

DNS1 with Virtual network Guan Lai as, also for 192.168.80.2 (2) Restart network

Systemctl Restart Network Restart service

Verify that you can access the Internet

View your IP now

IP addr



That's it.



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.