您尚未登录。

#1 2015-02-08 18:53:01

糊涂
本尊
注册时间: 2012-10-30
帖子: 203

[已解决]网卡不能自动启动

一台10年前的机器,网卡配置了开机自启(netctl enable enp4s0)却起不来,非得手工启动一下(netctl start enp4s0)。
1、可能什么原因?(当然不排除硬件兼容问题,其他可能呢?)
2、我想临时先加个命令到某个开机脚本里试试,放哪儿好呢?
---------
更新:已解决
方法:在网络路径中增加了一台交换机
分析:服务器到交换机的物理线路太长,中间的跳接节点太多,信号衰减大;网卡本身品质差(同一线路曾经连接另一台机器无此问题)

最近编辑记录 糊涂 (2015-02-11 10:57:32)


想装X,别装X

离线

#2 2015-02-08 18:55:35

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,953
个人网站

Re: [已解决]网卡不能自动启动

查查日志看看有没有说为什么没启动成功呗。

离线

#3 2015-02-08 18:57:06

cuihao
所在地: USTC, Hefei
注册时间: 2011-08-19
帖子: 1,223
个人网站

Re: [已解决]网卡不能自动启动

netctl enable 应该是创建了个 systemd service 吧。看看:

systemctl status netctl<TAB补全一下>

有啥信息。


Site: CVHC.CC   Twitter: @cuihaoleo   Org: LUG@USTC
AD:  ~欢迎参与志愿计算~

离线

#4 2015-02-08 19:59:22

糊涂
本尊
注册时间: 2012-10-30
帖子: 203

Re: [已解决]网卡不能自动启动

现在已经手工起来了,就这样

# systemctl status netctl@enp0s4.service
* netctl@enp0s4.service - A basic static ethernet connection
   Loaded: loaded (/etc/systemd/system/netctl@enp0s4.service; enabled; vendor preset: disabled)
   Active: active (exited) since Sun 2015-02-08 18:32:17 UTC; 1h 27min ago
     Docs: man:netctl.profile(5)
  Process: 255 ExecStart=/usr/lib/network/network start %I (code=exited, status=0/SUCCESS)
 Main PID: 255 (code=exited, status=0/SUCCESS)

Feb 08 18:32:17 ntp network[255]: Starting network profile 'enp0s4'...
Feb 08 18:32:17 ntp network[255]: Started network profile 'enp0s4'
Feb 08 18:32:17 ntp systemd[1]: Started A basic static ethernet connection.

想装X,别装X

离线

#5 2015-02-08 20:41:35

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,953
个人网站

Re: [已解决]网卡不能自动启动

journalctl -u netctl@enp0s4.service 可以看更多。

离线

#6 2015-02-08 20:42:17

糊涂
本尊
注册时间: 2012-10-30
帖子: 203

Re: [已解决]网卡不能自动启动

journal看过了,有网卡启动失败的信息,但看不出原因。

  1 Feb 08 20:17:42 ntp systemd[1]: Starting Reboot...
  2 Feb 08 20:17:42 ntp systemd[1]: Shutting down.
  3 Feb 08 20:17:42 ntp systemd-shutdown[1]: Sending SIGTERM to remaining processes...
  4 Feb 08 20:17:42 ntp systemd-journal[114]: Journal stopped
  5 -- Reboot --
  6 Feb 08 20:18:37 ntp systemd-journal[115]: Runtime journal is using 8.0M (max allowed 100.2M, trying to leave 150.4M free of 994.7M available → current limit 100.2M).
  7 Feb 08 20:18:37 ntp systemd-journal[115]: Permanent journal is using 16.0M (max allowed 806.3M, trying to leave 1.1G free of 6.5G available → current limit 806.3M).
  8 Feb 08 20:18:37 ntp systemd-journal[115]: Time spent on flushing to /var is 377ms for 2 entries.
  9 Feb 08 20:18:37 ntp kernel: Initializing cgroup subsys cpuset
......
385 Feb 08 20:18:37 ntp kernel: pnp: PnP ACPI: found 7 devices
386 Feb 08 20:18:37 ntp kernel: Switched to clocksource acpi_pm
387 Feb 08 20:18:37 ntp kernel: pci 0000:01:0d.0: PCI bridge to [bus 02]
388 Feb 08 20:18:37 ntp kernel: pci 0000:00:01.0: PCI bridge to [bus 01-02]
389 Feb 08 20:18:37 ntp kernel: pci 0000:00:01.0:   bridge window [io  0xb000-0xcfff]
390 Feb 08 20:18:37 ntp kernel: pci 0000:00:01.0:   bridge window [mem 0xff300000-0xff3fffff]
391 Feb 08 20:18:37 ntp kernel: pci_bus 0000:00: resource 4 [io  0x0000-0xffff]
392 Feb 08 20:18:37 ntp kernel: pci_bus 0000:00: resource 5 [mem 0x000a0000-0x000bffff]
393 Feb 08 20:18:37 ntp kernel: pci_bus 0000:00: resource 6 [mem 0x80000000-0xfcffffffff]
394 Feb 08 20:18:37 ntp kernel: pci_bus 0000:01: resource 0 [io  0xb000-0xcfff]
395 Feb 08 20:18:37 ntp kernel: pci_bus 0000:01: resource 1 [mem 0xff300000-0xff3fffff]
396 Feb 08 20:18:37 ntp kernel: NET: Registered protocol family 2
397 Feb 08 20:18:37 ntp kernel: TCP established hash table entries: 16384 (order: 5, 131072 bytes)
398 Feb 08 20:18:37 ntp kernel: TCP bind hash table entries: 16384 (order: 6, 262144 bytes)
399 Feb 08 20:18:37 ntp kernel: TCP: Hash tables configured (established 16384 bind 16384)
400 Feb 08 20:18:37 ntp kernel: TCP: reno registered
401 Feb 08 20:18:37 ntp kernel: UDP hash table entries: 1024 (order: 3, 32768 bytes)
402 Feb 08 20:18:37 ntp kernel: UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes)
403 Feb 08 20:18:37 ntp kernel: NET: Registered protocol family 1
404 Feb 08 20:18:37 ntp kernel: pci 0000:00:02.0: disabled boot interrupts on device [1166:0205]
405 Feb 08 20:18:37 ntp kernel: pci 0000:00:06.0: Video device with shadowed ROM
......
435 Feb 08 20:18:37 ntp kernel: TCP: cubic registered
436 Feb 08 20:18:37 ntp kernel: IPv6: Loaded, but administratively disabled, reboot required to enable
437 Feb 08 20:18:37 ntp kernel: NET: Registered protocol family 17
......
624 Feb 08 20:18:38 ntp kernel: e1000: Intel(R) PRO/1000 Network Driver - version 7.3.21-k8-NAPI
625 Feb 08 20:18:38 ntp kernel: e1000: Copyright (c) 1999-2006 Intel Corporation.
626 Feb 08 20:18:38 ntp kernel: xgifb: module is from the staging directory, the quality is unknown, you have been warned.
627 Feb 08 20:18:38 ntp kernel: e1000 0000:00:04.0 eth0: (PCI:33MHz:32-bit) ### 此处MAC地址隐去
628 Feb 08 20:18:38 ntp kernel: e1000 0000:00:04.0 eth0: Intel(R) PRO/1000 Network Connection
......
663 Feb 08 20:18:39 ntp kernel: e1000 0000:00:05.0 eth1: (PCI:33MHz:32-bit) ### 此处MAC地址隐去
664 Feb 08 20:18:39 ntp kernel: e1000 0000:00:05.0 eth1: Intel(R) PRO/1000 Network Connection
......
671 Feb 08 20:18:39 ntp kernel: e1000 0000:00:04.0 enp0s4: renamed from eth0
672 Feb 08 20:18:39 ntp kernel: e1000 0000:00:05.0 enp0s5: renamed from eth1
......
689 Feb 08 20:18:39 ntp systemd[1]: Found device 82541GI Gigabit Ethernet Controller.
690 Feb 08 20:18:39 ntp systemd[1]: Starting A basic static ethernet connection...
......
700 Feb 08 20:18:39 ntp systemd[1]: Started Login Service.
701 Feb 08 20:18:40 ntp network[174]: Starting network profile 'enp0s4'...
702 Feb 08 20:18:41 ntp kernel: floppy0: no floppy controllers found
703 Feb 08 20:18:41 ntp kernel: work still pending
704 Feb 08 20:18:45 ntp network[174]: No connection found on interface 'enp0s4' (timeout)
705 Feb 08 20:18:45 ntp network[174]: Failed to bring the network up for profile 'enp0s4'
706 Feb 08 20:18:45 ntp systemd[1]: netctl@enp0s4.service: main process exited, code=exited, status=1/FAILURE
707 Feb 08 20:18:45 ntp systemd[1]: Failed to start A basic static ethernet connection.
708 Feb 08 20:18:45 ntp systemd[1]: Unit netctl@enp0s4.service entered failed state.
709 Feb 08 20:18:45 ntp systemd[1]: netctl@enp0s4.service failed.
710 Feb 08 20:18:45 ntp systemd[1]: Starting Network.
711 Feb 08 20:18:45 ntp systemd[1]: Reached target Network.
712 Feb 08 20:18:45 ntp systemd[1]: Starting OpenSSH Daemon...
713 Feb 08 20:18:45 ntp systemd[1]: Started OpenSSH Daemon.
......
741 Feb 08 20:27:07 ntp login[176]: ROOT LOGIN ON tty1
742 Feb 08 20:27:45 ntp systemd[1]: Starting A basic static ethernet connection...
743 Feb 08 20:27:45 ntp network[257]: Starting network profile 'enp0s4'...
744 Feb 08 20:27:45 ntp kernel: e1000: enp0s4 NIC Link is Up 100 Mbps Full Duplex, Flow Control: RX
745 Feb 08 20:27:45 ntp network[257]: Started network profile 'enp0s4'
746 Feb 08 20:27:45 ntp systemd[1]: Started A basic static ethernet connection.
### 日志到此结束

以下dmesg信息:

......
[    7.066033] systemd-journald[115]: Received request to flush runtime journal from PID 1
[    7.586069] e1000: Intel(R) PRO/1000 Network Driver - version 7.3.21-k8-NAPI
[    7.586075] e1000: Copyright (c) 1999-2006 Intel Corporation.
......
[    7.816341] e1000 0000:00:04.0 eth0: (PCI:33MHz:32-bit) ### 此处MAC地址隐去
[    7.816352] e1000 0000:00:04.0 eth0: Intel(R) PRO/1000 Network Connection
......
[    8.132764] e1000 0000:00:05.0 eth1: (PCI:33MHz:32-bit) ### 此处MAC地址隐去
[    8.132774] e1000 0000:00:05.0 eth1: Intel(R) PRO/1000 Network Connection
......
[    8.218848] powernow_k8: Found 1 AMD Opteron(tm) Processor 246 (1 cpu cores) (version 2.20.00)
[    8.237898] e1000 0000:00:04.0 enp0s4: renamed from eth0
[    8.263183] e1000 0000:00:05.0 enp0s5: renamed from eth1
[    8.342973] input: PC Speaker as /devices/platform/pcspkr/input/input7
......
[  554.664060] e1000: enp0s4 NIC Link is Up 100 Mbps Full Duplex, Flow Control: RX
### 信息到此结束

最近编辑记录 糊涂 (2015-02-08 21:22:43)


想装X,别装X

离线

#7 2015-02-08 21:29:12

糊涂
本尊
注册时间: 2012-10-30
帖子: 203

Re: [已解决]网卡不能自动启动

启动失败应该是超时。但为什么超时呢?为什么手工就能起来就不超时了呢?静态地址啊,又不是DHCP

最近编辑记录 糊涂 (2015-02-08 21:32:18)


想装X,别装X

离线

#8 2015-02-08 22:39:11

atmouse
会员
注册时间: 2011-08-24
帖子: 701

Re: [已解决]网卡不能自动启动

用 systemd-network吧

离线

#9 2015-02-08 22:45:19

atmouse
会员
注册时间: 2011-08-24
帖子: 701

Re: [已解决]网卡不能自动启动

你这应该要去确认下网线两端是不是有连接问题,导致开机网卡等了很久才自动适配到100 全双工模式。你是不是拿了交叉线来用?

你贴一下mii-tool -v enp0s4

离线

#10 2015-02-08 22:46:34

atmouse
会员
注册时间: 2011-08-24
帖子: 701

Re: [已解决]网卡不能自动启动

再笨的办法也可以到livecd里面看看是不是操作系统问题,还是硬件问题

离线

#11 2015-02-08 23:15:42

糊涂
本尊
注册时间: 2012-10-30
帖子: 203

Re: [已解决]网卡不能自动启动

同样一根网线,原本接另一台机器完全正常,交换机端口都没变。接这台就有这个问题。
如果是两端连接的问题,只可能是这台机器的这个口有问题。交叉线已经N年不用了。不可能。我用的这条是成品跳线,用了大半年了。mii-tool不在base包里,没装。
我比较怀疑是硬件太老造成的兼容性问题。


想装X,别装X

离线

#12 2015-02-11 10:58:03

糊涂
本尊
注册时间: 2012-10-30
帖子: 203

Re: [已解决]网卡不能自动启动

问题解决,顶楼已更新


想装X,别装X

离线

页脚