Virtual Machine Linux system Internet access settings

Source: Internet
Author: User

Virtual Machine Linux system Internet access settings

After the Linux system is installed on the virtual machine, the system is in the bridging mode. The following steps are edited in the new system environment. If you have modified it before, it may not apply.

Ifconfig # view the NIC information first

1. dhclient # automatically obtains the IP address, which is obtained by the dhcp service.

2. Configure static IP addresses (the red part needs to be modified)

[Root @ Linux ~] # Vim/etc/sysconfig/network-scripts/ifcfg-eth0 # modify eth0 Nic;
DEVICE = eth0
HWADDR = 00: 0C: 29: 5B: 40: E0
TYPE = Ethernet
UUID = 9315dbdf-ae02-4814-af4c-00e29504e82d
ONBOOT = yes # enable Nic upon startup;
NM_CONTROLLED = yes
BOOTPROTO = static # Set it to static mode;
IPADDR = 192.168.15.11 # the IP address here is the IP address automatically generated by dhclient.

NETMASK = 255.255.255.0 # Set the subnet mask;
GATEWAY = 192.168.15.1 # Set the GATEWAY;
DNS1 = 114.114.114.114 # Set DNS;

3. Restart the NIC

Service network restart

I should be able to access the Internet now.

This article permanently updates the link address:

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.