Error Summary: Virtual Machine static IP login + wireless Internet access, static IP

Source: Internet
Author: User

Error Summary: Virtual Machine static IP login + wireless Internet access, static IP

Environment: notebook + home WIFI + company WIFI + VMware + CentOS6.8 + Xshell

Problem description: When I was a beginner in Linux, I installed a Virtual Machine (single Nic) in my notebook. I wanted to connect linux to the company through wireless connection at home, however, you do not want to manually enter an IP address to log on to Xshell after the location changes.

Solution: Add a NIC (eth1) and set eth1 to VMnet1 (host-only in host mode) for Xshell logon. The original Nic eth0 is VMnet8 (NAT Mode)

Implementation Method:

Open the virtual network editor of the VM, view the VMnet1 subnet address, and manually change it to 11.11.11.0

Start Linux and log on as the root user.

Modify the eth0 configuration file

# Vim/etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE = eth0HWADDR = 00: 0C: 29: 97: 06: BCTYPE = EthernetUUID = 24e72ebf-5682-4a8f-87a4-6b53b39a5e0bONBOOT = yes # enable the NIC NM_CONTROLLED = yesBOOTPROTO = dhcp # ensure that the DHCP service is enabled to automatically obtain IP addresses

 


Modify the eth1 configuration file

# Vim/etc/sysconfig/network-scripts/ifcfg-eth1DEVICE = eth1 # Note HWADDR (MAC address) and UUID (universal Unique Identifier Universally Unique Identifier) cannot repeat with other NICs TYPE = EthernetONBOOT = yesNM_CONTROLLED = yesBOOTPROTO = static # static IP used for xshell remote logon IPADDR = 11.11.11.68 # VMnet1 subnet is 30 Segment NETMASK = 255.255.255.0 # GATEWAY = 11.11.11.1 my error: network Adapter eth1 cannot add Gateway


After the configuration is complete, restart the network service and check the network connection status.

#service network restart#ping www.qq.com

Ping indicates that the Internet can be connected. This solution is feasible.

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.