Linux OS cannot find NIC solution

Source: Internet
Author: User
Tags bz2 ssh

Installing network adapters

The machine is too new to recognize the existing Linux version, such as the machine can not find a network card, this time what to do?

Don't worry, first you need to know what type of network card, take the new computer purchased in this lab as an example, its network card is integrated, the model is Realtek rtl8168/8111 pci-e Gigabit Ethernet NIC. Then we go to Realtek's official website to download the corresponding Linux driver r8168-8.005.00.tar.bz2 and follow the instructions to install it.

Unpack the Tarball:

# tar vjxf r8168-8.aaa.bb.tar.bz2

Change to the directory:

# CD R8168-8.AAA.BB

If you are are running the target kernel, then you should is able to do:

# Make clean modules (as root or with sudo)

# make Install

#/sbin/depmod-a

#/sbin/insmod./src/r8168.ko (or R8168.O in Linux kernel 2.4.x)

You can check whether the driver are loaded by using following commands.

#/sbin/lsmod | grep r8168 (see if the NIC driver is loaded)

#/sbin/ifconfig–a (see if there is information about the NIC being started)

If There is a device name, ETHX, shown on the monitor, the Linux

Driver is loaded. Then, can use the following command to activate

The ETHX.

# ifconfig Ethx up

, where x=0,1,2,...

Here also through the system → management → network to set IP address, etc., and finally activated.

1. Set Manually

A. Set the IP address of your machine.

# ifconfig Ethx "The IP address of your machine"

B. Set the IP address of DNS.

Insert the following configuration in/etc/resolv.conf.

NameServer "The IP address of DNS"

C. Set the IP address of Gateway.

# route Add default GW "The IP Address of Gateway"

2. Set by doing configurations in/etc/sysconfig/network-scripts

/ifcfg-ethx for Redhat and Fedora, or/etc/sysconfig/network

/ifcfg-ethx for SuSE. There are two examples to set network

Configurations.

A. Fix IP address:

Device=eth0

Bootproto=static

Onboot=yes

Type=ethernet

netmask=255.255.255.0

ipaddr=192.168.1.1

gateway=192.168.1.254

broadcast=192.168.1.255

2. Modify: #vi/etc/hosts, add two lines to the text:

127.0.0.1 localhost.localdomain localhost

192.168.4.101 Node3 (set according to the machine itself)

Modify: vi/etc/hosts.equiv, add one line: (if not the text, you can create a)

Node3

3. Start SSH Service

Most Linux versions should come with this program.

#ssh-keygen

#cd. SSH

#cp id_rsa.pub Authorized_keys

#ssh Node3 (If successful, displays the last login time, NODE3 is the host name)

Additional Information:

Ifup eth0 See if you can start eth0

Lsmod See if the NIC driver is loaded

DMESG to see if there is an error message when the NIC starts

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.