Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Linux virtual machine how to access the Internet in a virtual machine when using NAT mode     - Zabbix configuration external network mail alarm (Server)

- Nginx multi-domain certificate HTTPS (Server)

- CentOS 6.5 installation using a data recovery software extundelete (Linux)

- MongoDB version 3.2 WiredTiger storage engine performance tests (Database)

- A summary of Java multi-threaded programming - acquaintance multithreading (Programming)

- Extended use of the swap file swap space on Linux (Linux)

- GitLab Guide installation under Ubuntu 14.04 (Server)

- Chkconfig command Detailed service is added and shut down the system in two ways to start service under Linux (Linux)

- System Security: Build Linux with LIDS steel castle (Linux)

- Android development, may cause a memory leak problem (Programming)

- Python configuration tortuous road of third-party libraries Numpy and matplotlib (Programming)

- Linux, rename the file or folder (mv command and rename command) (Linux)

- On event processing browser compatibility notes (Programming)

- FreeRadius installation process record (Linux)

- WordPress plug-ins installed in Ubuntu, enter the subject of FTP and not create directory problem (Server)

- Creating and extracting archives 11 tar command examples in Linux (Linux)

- Linux System Tutorial: Fix ImportError: No module named wxversion error (Linux)

- SYN attack hacker attack and defense of the basic principles and prevention technology (Linux)

- C language binary tree (Programming)

- Nine trick to let you speed up the old machine running Ubuntu Linux (Linux)

 
         
  Linux virtual machine how to access the Internet in a virtual machine when using NAT mode
     
  Add Date : 2018-11-21      
         
         
         
  First, the problem:

1, if set to NAT mode defaults to DHCP dynamic IP address, the system will generate / etc / sysconfig / network-configs / ifcfg-ens33, this document reads as follows:
DEFROUTE = "yes"
IPV4_FAILURE_FATAL = "no"
IPV6INIT = "yes"
IPV6_AUTOCONF = "yes"
IPV6_DEFROUTE = "yes"
IPV6_FAILURE_FATAL = "no"
NAME = "ens33"
UUID = "ece1577e-e492-4d3c-84a2-ddccb3019424"
ONBOOT = "yes"
IEEE_8021X_EAP_METHODS = "MD5"
IEEE_8021X_IDENTITY = "renjia @ gameyunwei"
IEEE_8021X_PASSWORD_FLAGS = "user"
HWADDR = "00: 0c: 29: 44: 47: 5c"
PEERDNS = "yes"
PEERROUTES = "yes"
IPV6_PEERDNS = "yes"
IPV6_PEERROUTES = "yes"
BOOTPROTO = "dhcp"

2, will be changed to a static IP address dhcp

3, can not access the Internet
[Root @ slave1 network-scripts] # ping www.sohu.com
ping: unknown host www.sohu.com

Second, the solution:

1, the virtual machine's configuration environment NAT, Edit menu -> Virtual Network Editor:

Subnet IP is set to 192.168.130.0
Subnet mask of 255.255.255.0
Set in NAT Settings:

Set Gateway IP to 192.168.130.2
In the DHCP Settings to set:

Configure IP pool range: 192.168.130.50 ~ 192.168.130.254

2, the host configuration VMware Network adapter VMnet8:

note:
The default gateway must be 192.168.130.0, and Subnet virtual machine that is consistent
DNS not set

3, configure the virtual machine Fedora
The / etc / sysconfig / network-configs / ifcfg-ens33, cut part of the configuration, increasing the DNS configuration:

TYPE = "Ethernet"
DEFROUTE = "yes"
IPV4_FAILURE_FATAL = "no"
NAME = "ens33"
UUID = "707084bc-d3aa-483f-878b-c93e6abf4a07"
ONBOOT = "yes"
# HWADDR = "00: 0C: 29: 8B: 9A: F2"
HWADDR = "00: 0c: 29: 94: 8e: a2"
BOOTPROTO = "static"
NM_CONTROLLED = "yes"
IPADDR = "192.168.130.101"
NETMASK = "255.255.255.0"
GATEWAY = "192.168.130.2"
DNS1 = "192.168.1.1"
note:
DNS1 must be the same as the host of the DNS
Remove other configurations than the configuration described above (other configurations may affect the CI manual), otherwise it will still be unable to access the Internet
 
4, test your access to the Internet
     
         
         
         
  More:      
 
- Oracle ordinary users show parameter method (Database)
- Top command: the Task Manager under linux (Linux)
- How to install CentOS CentOS web page (Server)
- Deepin Tutorial: Depth Description Installer expert mode (Linux)
- Import and export myloader accelerate mydumper (Database)
- Linux installed Cisco Packet Tracer (Linux)
- Bitmap memory footprint of computing Android memory optimization (Linux)
- Disk storage structure and file recovery experiment (FAT file system) (Linux)
- Linux Demo dd IO test (Linux)
- CentOS / Debian configuration Gitlab 7.1x to build self Git repository (Linux)
- AppCode developed Mac OS X application or shared library experience summary (Programming)
- Compile and install Memcached can not find GCC (Programming)
- DB2 Version SQLJ to access Oracle Server (Database)
- RHEL7.0 log system (Linux)
- Hadoop namenode do NFS disaster recovery (Server)
- How to upgrade to Ubuntu 14.04 Linux Kernel 4.4.1 LTS (Linux)
- MYSQL root password for the database user passwords are weak attack analysis (Linux)
- VirtualBox modify the size of the virtual machine disk VDI (Linux)
- Quagga use authentication on strengthening BGP session security (Linux)
- Linux System Getting Started Learning: complete installation on Debian or Ubuntu kernel source (Linux)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.