Implement communication between Linux and host hosts

Source: Internet
Author: User
Keywords Implementation nbsp; 8.1.1 viewing
Tags aliyun cat communication content directory etc files host

&http://www.aliyun.com/zixun/aggregation/37954.html ">NBSP; Implement communication between Linux and host hosts

1.cd/etc/sysconfig/network-scripts/

2.ls-a View all files in the current directory; and cat Ifcfg-eth0 view Ifcfg-eth0 content

3. My ifcfg-eth0 inside only a simple three lines, no IP-related information, so its content for editing, vi Ifcfg-eth0, press insert for editing, edited as follows (the first 3 lines are already there):

Device=eth0 onboot=yes bootproto=dhcp ipaddr=192.168.1.101 netmask=255.255.255.0 BR oadcast=192.168.1.255 gateway=192.168.1.1 #GATEWAYDEV =eth0

Then ESC exits the edit state, shift+: Enter Wq exit

4. Then use ifconfig to view IP or previous information, so you must restart the network card: CD/ETC/RC.D/INIT.D, input./network Restart Restart the network card The following error message appears:

"Pop-up interface eth0 is deciding eth0 IP information ... Failed: No link, check cable? ”

This problem, change the bootproto=dhcp to Bootproto=static, and then repeat the above steps.

5.ifconfig can see the modified IP information

6.ping 192.168.1.100 (host IP), ok!

7. Ping 192.168.1.101 (the IP of the VM) in the host, ok!

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.