linux 网线直连(linux 网线)-编程之家

一台WINDOWS和一台LINUX两台电脑用网线连接,为什么PING不通?

先看看网卡是否已经连接正常(没有红叉),这说明电脑之间物理线路连接正常,然后在网卡ip地址里设置同一网段就可以互相ping通。注意需要关闭防火墙才能ping通。

linux判断网卡是否接了网线?

具体代码如下

1. 查看网卡是否连接网线

# mii-tool

2. 查看指定网卡是否连接网线

# mii-tool eth0

eth0: negotiated 100baseTx-FD, link ok

3. 给网卡配置ip地址,然后ping这个ip地址即可。

4. # ethtool eth1

Settings for eth1:

Supported ports:

Supported link modes:   10baseT/Half 10baseT/Full

100baseT/Half 100baseT/Full

1000baseT/Half 1000baseT/Full

Supports auto-negotiation: Yes

Advertised link modes:  10baseT/Half 10baseT/Full

Linux如何判断哪个网卡是否连接网线?

ifconfig查看现在使用的网卡ethtool命令查看网卡的具体信息,如eth0是连接状态,正常使用在ifconfig中可以看到有eth2这个网卡,但不知道是否连线,这时用ethtool就可以看到link是no,那么表示是没有连线的