Ubuntu Network Environment Settings

Source: Internet
Author: User

In the previous network environment, DHCP or STATIC is basically set on ubuntu, or NAT or bridge connection is set in the virtual machine. However, through such settings, I found that there are still some shortcomings, but I do not know about Doha. Enter the subject below:

Run the following command in the ubuntu command window:

Ifconfig

You can see the network information of ubuntu:

We can see that there is only lo, but there is no common eth0 or eth1. In this case, enter the network directory:

Vi/etc/network/interfaces

The following information is displayed:

In auto eth1, we can see that the network card is eth1. Most of the information we see is eth0. The reason for this is that eth1 is because my ubuntu file was cloned from another computer.

If you need to change eth1 to eh0, do not forget that eth1 in iface eth1 inet dhcp also needs to be modified. In this case, we assume that eth1 is used. In the above information, the reason we did not see eth1 information may be that eth1 is not enabled. Of course, we do not rule out other possibilities. Run:

Ifconfig eth1 up

You can see the following information: eth1 is coming out, so you should be happy now, but don't be so happy too early. Soon you will find that eth1 has no IP address?

First, we need to go to the computer host to view, enter:

Control Panel \ network and Internet \ Network Connection

Right-click "Local Connection" and choose "property" sharing to go to the following page:

Select "allow other Network users..." in "internet Connection Sharing" and then select the Network connection to be shared, such as "VMware Network Adapter VMnet8 ".

Next, choose/edit/vitural network edit/From the VMware Station menu/

Here, we select VMnet8 and check the NAT connection and other options.

In VMnet1, The bredige bridging mode is selected, and bridged to Realtek PCIe GBE Family Controller (host Nic) is selected ).

Then you need to go to the menu/VM/Settings, select Network Adapter, select NAT connection, and click OK.

Then go to the ubuntu terminal and run the following command to restart the NIC:

/Etc/init. d/networking restart

The following prompt is displayed:

Execute again:

Ifconfig

In the preceding figure, we can see that TX and RX have sent and received data, indicating network connectivity. You can also directly ping www.baidu.com to test the network status.

Run cmd on the computer and run ipconfig/all to view the vmnet8 IP address. We use a NAT connection. So it is different from the IP address in ubuntu. We need to ping the IP address in ubuntu under the cmd command line.

Only the above two-way ping operation indicates that the network is fully connected.

If the modified network needs to take effect immediately, run the following command:

/Etc/init. d/networking restart

Or

Ifconfig eth1 down

Ifconfig eth1 up

There are many ways to set static IP addresses on the network, and there are also temporary settings. I will not go into detail here. Some people can connect to the Internet by selecting the network connection method in the virtual machine, but I won't be able to, so I checked everything involved in the network.

If you have any questions, please kindly advise. Thank you.

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.