When Linux is started, the eth0 IP address cannot be accessed after it fails.

Source: Internet
Author: User

1. CD/etc/sysconfig/network-scripts/
2. ls-a to view all files under the current directory; and CAT ifcfg-eth0 to view ifcfg-eth0 content
3. there are only three simple lines in my ifcfg-eth0, no IP-related information, so edit the content, VI ifcfg-eth0, edit by insert, the Edit content is as follows (the first three rows are originally available ):
Device = eth0 onboot = Yes bootproto = DHCP ipaddr = 192.168.1.101 netmask = 255.255.255.0 network = 192.168.1.0 broadcast = 192.168.1.255 gateway = 192.168.1.1 # gatewaydev = eth0
Then ESC exits the editing status, Shift +: Enter WQ to exit
4. in this case, you must restart the NIC: CD/etc/rc. d/init. d. Enter. /network restart:
"In the pop-up interface, eth0 is deciding the IP address of eth0... failed: no link. Check the cable ?"
In this case, you can change bootproto = DHCP to bootproto = static, and then repeat the above steps.
5. ifconfig: the modified IP address is displayed.
6. Ping 192.168.1.100 (host machine IP)
7. Ping 192.168.1.101 (Vm IP) on the host)

 

 

 

If you think it is useful, please reply to a 1024 suggestion. Respect others' labor achievements.

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.