Win7 centos 6.0 cannot access the network. ifconfig is used to find that the eth0 Nic does not have IP address and other related configurations.

Source: Internet
Author: User

1. assign a static IP Address

# Ifconfig eth0 192.168.1.11 netmask 255.255.255.0

2. Modify the Gateway

Ping 192.168.1.1 first to check whether the IP address above can be accessed.

# Route add default GW 192.168.1.1

3. Restart the NIC

# Ifconfig eth0 down

# Ifconfig eth0 up

Then you can use ifconfig to view eth0 information.

Commands such as route add can only be valid in the current environment. After the virtual machine is restarted, these configurations will be lost, so you need to save them to the configuration file:

1. Write to/etc/rc. Local. This is a link file and actually points to/etc/rc. d/rc. Local.

# Route add default GW 192.168.1.1

2. Write to the NIC configuration file

# Vi/etc/sysconfig/network-scripts/ifcfg-eth0

Add this sentence:

Gatway = 192.168.1.1

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.