Teaches you how to access the Internet in a virtual machine linux and set parameters
Source: Internet
Author: User
We will teach you how to access the Internet in a virtual machine linux. The parameter setting command-Linux general technology-Linux technology and application information is as follows. After installing linux on a virtual machine, many friends want to access the Internet on the virtual machine. In fact, they only need to install linux. The setting is simple. Let me talk about how to set it.
Let's talk about my Internet access method. My computer uses a vswitch to access the Internet and a campus network. For shared Internet access on a vswitch, set the IP address, gateway, mask, and DNS for each server. Therefore, the same parameters must be set for linux. I don't know about the router. I think it's generally similar to the host.
There are two ways for a virtual machine to access the Internet in linux. You can set it in the NIC settings of the virtual machine. I set a bridge instead of an external connection.
Enter a command in the linux terminal to execute some function settings.
For example, "ifconfig" is used to view the NIC settings.
"Ifconfig eth0 192.168.0.230 netmask 255.255.255.0" sets the IP address and mask of the NIC.
Nic setting steps:
1. Check the IP address and mask of the Local Machine to determine that the local machine is in the same subnet as the gateway;
2. ping the IP address of the Local Machine (not 127.0.0.1). If the IP address is successfully pinged, the NIC works properly;
3. Disable the firewall: iptables-F
4. If the IP address of the gateway is successfully pinged, the network is normal;
5. Check the default route: route-n to see if 0.0.0.0 is the IP address of the gateway;
6. ping An external IP address. If the IP address is successfully pinged, the gateway works normally;
7. Check DNS settings and try to resolve a domain name;
8. If all of the preceding operations are passed, they can be used normally.
Here is the simplest setting method. Enter the "netconfig-d eth0" command to bring up a box, which is similar to the setting on XP, that is, setting IP addresses and masks, gateway, DNS, and four parameters. However, this parameter is set on the keyboard and cannot be used with the mouse!
If you are interested in LINUX, I suggest you take a look at some linux tutorials. They are actually very simple. It is very difficult if you don't look at them. If you have too many commands, remember it!
I hope all of you can access the Internet on the VM.
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