Linux Virtual Machine Network preparation method and problem solving method

Source: Internet
Author: User

Linux Virtual Machine Network issues
Just installed a VMware virtual machine. and installed a Redhat Linux operating system on it.
After installation, the network was prepared.


First look at the network configuration on Windows.
ip:192.168.1.109
nemask:255.255.255.0
gateway:192.168.1.1
Through these things can be seen that the virtual machine should also be in the same network segment (192.168.1.0), the same gateway (192.168.1.1)
The subnet mask, of course, should be 255.255.255.0.

The formulation method is divided into two kinds:
First, the temporary preparation:
Configure IP, subnet mask
Ifconfig 192.168.1.110 netmast 255.255.255.0
Configure the default gateway
Route add default GW 192.168.1.1

Second, permanent preparation:
Edit the configuration file, pay attention to Chinese as staring, real editing when the Chinese removed.
Vim/etc/sysconfig/network-scripts/ifcfg-eth0
Device= "eth0" Device name
Hwaddr= "00:24:1D:8A:3D:F7" Physical Address
Onboot= "Yes" is started
bootproto= "Static" IP can select DHCP
networy= "192.168.1..0" network Segment--! Make the same network segment as Windows
Ipaddr= "192.168.1.110" IP address
netmask= "255.255.255.0" subnet
Gateway= "192.168.1.1" gateways-need to be consistent with Windows

Restart the NIC after the configuration is complete
Service Network restart
Note After you run the above command, the network configuration is made according to the configuration file.

Third, the network configuration may appear problems:
When you are finished, you find that when you restart the NIC to run service network restart
Failed to close eth0 NIC
Shutting down interface Eth0:device eth0 have MAC address 00:0c:29:ad:57:66 instead of configured address 00:24:1d:8a:3d:f 7.
ignoring [FAILED]
It means that the eth0 Nic has a physical address 00:0c:29:ad:57:66, not a prepared physical
Address: 00:24:1d:8a:3d:f7. Ignore.
That is to tell us that there is already a physical address, the preparation of the file should not be arbitrarily prepared.
So the above is formulated hwaddr= "00:24:1d:8a:3d:f7"
Change to Hwaddr= "00:0c:29:ad:57:66" through Ifconfig can also find
And then restart the NIC, everything OK

Now the network should pass, so test it.


Discover the ability to ping Linux virtual machines on Windows 7. However, the Linux virtual machine cannot ping windows.
Very strange, what's going on. In general, it is possible that the firewall on Windows 7 has blocked the account.


The workaround is to turn off the firewall on Windows 7 and try again.
The shutdown firewall method can be: Execute firewall.cpl on Run to set the shutdown.

And then the ping can ping the pass.

The call ~ ~ finally conquered.
But to let and virtual machines to each other through the network.

Shut down the firewall directly. Is that reasonable?
Is it safe?

==================================
In fact, I do a series of work on the above, in order to be able to access through putty on Windows
Linux on a virtual machine.
Then you need to open an SSH service on Linux.
Command Service sshd Start
And do not want to run this command every time, so in the root of the ~/.bash_profile configuration
File to be prepared.
Just add a line: Service sshd start is available.


Finally putty a smooth interview, the next time you open the virtual machine will not need to configure the network. No need to manually open the SSH service, very convenient.

Connect directly with Putty on Windows,:)

Linux Virtual Machine Network preparation method and problem solving method

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.