Kat*_*ett 25 networking linux ubuntu wired-networking
我的 Ubuntu 10.04 机器 (Sony Vaio VGN-SR490) 通过直接连接到路由器的以太网电缆连接到 Internet 时遇到问题。
我可以使用 Windows 机器使用相同的电缆连接到 Internet,因此 Linux 的配置方式有问题。
我如何弄清楚问题是什么并解决它?
这是我在 Linux 上的网络设置:
$ ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
vmnet1 Link encap:Ethernet HWaddr 00:50:56:c0:00:01
inet addr:192.168.79.1 Bcast:192.168.79.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fec0:1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
vmnet8 Link encap:Ethernet HWaddr 00:50:56:c0:00:08
inet addr:192.168.192.1 Bcast:192.168.192.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fec0:8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Run Code Online (Sandbox Code Playgroud)
这是我在 Windows (Vista) 上的网络设置:
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . : [removed by me].
Link-local IPv6 Address . . . . . : [removed by me]
IPv4 Address. . . . . . . . . . . : 192.168.1.103
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1
Run Code Online (Sandbox Code Playgroud)
我从这些结果中审查了我的 IP 地址。如果需要这些信息,请告诉我。
以下是内容/etc/network/interfaces:
auto lo
iface lo inet loopback
Run Code Online (Sandbox Code Playgroud)
添加后auto eth0,这里是最新的结果:
$ sudo ifup eth0
Internet Systems Consortium DHCP Client V3.1.3
Copyright 2004-2009 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
SIOCSIFADDR: No such device
eth0: ERROR while getting interface flags: No such device
eth0: ERROR while getting interface flags: No such device
Bind socket to interface: No such device
Failed to bring up eth0.
Run Code Online (Sandbox Code Playgroud)
以下是运行 modprobe 的结果:
$ sudo modprobe msk
FATAL: Module msk not found.
$ dmesg | grep eth
Run Code Online (Sandbox Code Playgroud)
应一些评论此问题的人的要求,我从计算机中删除了 Linux 并安装了 Windows XP。我安装了一个运行程序来查找有关网卡的详细信息。这是信息:
Network
You are not connected to the internet
Computer Name
NetBIOS Name JOE-LAPTOP
DNS Name joe-laptop
Domain Name joe-laptop
Remote Desktop
Console
State Active
Domain joe-laptop
RDP-Tcp
State Listen
WinInet Info
An internal error occurred.
Wi-Fi Info
Wi-Fi not enabled
WinHTTPInfo
WinHTTPSessionProxyType No proxy
Session Proxy
Session Proxy Bypass
Connect Retries 5
Connect Timeout 60000
HTTP Version HTTP 1.1
Max Connects Per 1.0 Servers INFINITE
Max Connects Per Servers INFINITE
Max HTTP automatic redirects 10
Max HTTP status continue 10
Send Timeout 30000
IEProxy Auto Detect No
IEProxy Auto Config
IEProxy
IEProxy Bypass
Default Proxy Config Access Type No proxy
Default Config Proxy
Default Config Proxy Bypass
Adapters List
Network Shares
No network shares
Run Code Online (Sandbox Code Playgroud)
看起来网络适配器列表是空的。我现在将安装 Windows XP 和 Ubuntu Linux 双引导。我仍然无法访问互联网,即使通过 Windows。我想知道这可能是计算机的硬件问题还是路由器本身的问题。其他计算机可以连接到同一个路由器,并且工作正常。(毕竟我就是这样发帖的!)
ata*_*mir 19
首先,您的以太网不是由 Ubuntu 管理的。尝试ifconfig -a而不仅仅是ifconfig,这样您就可以查看您的所有网络设备,无论是否受管理。如果您确实在ifconfig -a列表中看到了 ethX ,那么解决方案应该很简单,而且您似乎已经解决了一半。以下内容需要进入您的/etc/network/interfaces文件:
auto ethX
iface ethX inet dhcp
Run Code Online (Sandbox Code Playgroud)
第一行“激活”接口管理,第二行将其设置为 DHCP 和 IP。
但是,如果您这样做时甚至看不到任何 ethX 接口ifconfig -a,则是驱动程序问题(Ubuntu 甚至看不到该接口)。要解决此问题,请从 Windows 的设备管理器中检查以太网卡的 PCI 供应商 ID 和设备 ID,您可以在此处交叉参考,看看是否可以找到驱动程序(供应商 ID 是制造商,设备 ID是以太网卡的实际模型)。另一种在 linux 中执行此操作的方法是通过lspci.
在 Windows 7 中,通过设备管理器获取供应商/设备 ID - 打开网络接口节点,双击您的网卡,单击“详细信息”,然后从下拉列表中选择“硬件 ID”。供应商 ID 是VEN_前缀后的 4 个十六进制数字,设备 ID 是&DEV_紧跟供应商之后的 4 个十六进制数字。
小智 9
我有一个类似的问题。通过运行ifconfig -a,我确定我的计算机上唯一的网络设备是p4p1和lo。没有eth0。
所以我编辑/etc/network/interfaces,替换的所有实例eth0用p4p1。该文件的内容现在是:
auto lo
iface lo inet loopback
auto p4p1
iface p4p1 inet dhcp
Run Code Online (Sandbox Code Playgroud)
重新启动后,网络工作正常。
如果重要的话,我使用的是 Ubuntu 12.04.5 服务器版。
小智 6
我在评论中没有看到任何建议您查看 udev 及其应该安装 eth0 的规则。在我的系统上,在 /etc/udev/rules.d/75-network-devices.rules 中,我有以下内容;
# Local network rules to name your network cards.
#
# These rules were generated by nethelper.sh, but you can
# customize them.
#
# You may edit them as needed.
# (If, for example, your machine has more than one network
# card and you need to be sure they will always be given
# the same name, like eth0, based on the MAC address)
#
# If you delete this file, /lib/udev/nethelper.sh will try to
# generate it again the next time udev is started.
KERNEL=="eth?", ATTR{address}=="original has my MAC address here", NAME="eth0"
Run Code Online (Sandbox Code Playgroud)
另外,请确保您正在运行 udevd。这就是在基于 Slackware 的系统上创建 ethx 的原因。
| 归档时间: |
|
| 查看次数: |
203909 次 |
| 最近记录: |