Dhcp

DHCP IP 租用嘗試在乙太網和使用 netctl 的 DHCP 上失敗

  • November 10, 2018

我的 DHCP 乙太網在 Windows 中執行良好,但在帶有netctldhcpcd. 我究竟做錯了什麼?

的輸出ip link

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default 
   link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: wlp2s0: [...]
3:  eno1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
   link/ether [my mac adress] brd ff:ff:ff:ff:ff:ff

我的netctl個人資料

$ cat /etc/netctl/dhcp
Description='ethernet dhcp'
Interface=eno1
Connection=ethernet
IP=dhcp
#IP6=dhcp
#IP6=stateless

之後的錯誤資訊sudo netctl start dhcp

$ sudo journalctl -xn
-- Logs begin at Fr 2013-12-27 13:25:36 CET, end at Mo 2014-01-13 12:45:22 CET. --
Jan 13 12:44:50 laptop2 network[697]: DHCP IP lease attempt failed on interface 'eno1'
Jan 13 12:44:50 laptop2 network[697]: Failed to bring the network up for profile 'dhcp'
Jan 13 12:44:50 laptop2 systemd[1]: netctl@dhcp.service: main process exited, code=exited, status=1/FAILURE
Jan 13 12:44:50
laptop2 systemd[1]: Failed to start Networking for netctl profile dhcp.

好的,所以它在建立網路時遇到問題,我自己做……

$ sudo ip link set eno1 up
$ sudo netctl start dhcp
Job for netctl@dhcp.service failed. See 'systemctl status netctl@dhcp.service' and 'journalctl -xn' for details.
$ sudo journalctl -xn
[...]
Jan 13 12:47:20 laptop2 network[1304]: Starting network profile 'dhcp'...
Jan 13 12:47:20 laptop2 network[1304]: The interface of network profile 'dhcp' is already up
Jan 13 12:47:20 laptop2 systemd[1]: netctl@dhcp.service: main process exited, code=exited, status=1/FAILURE
Jan 13 12:47:20 laptop2 systemd[1]: Failed to start Networking for netctl profile dhcp.

這也無濟於事,再次將其放下。

$ sudo ip link set eno1 down

嘗試dhcpcd

$ sudo systemctl start dhcpcd
$ ping www.google.de
connect: Network is unreachable
$ ip link
[...]
3: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
[...]
$ sudo systemctl stop dhcpcd

$ sudo netctl start dhcp
Job for netctl@dhcp.service failed. See 'systemctl status netctl@dhcp.service' and 'journalctl -xn' for details.

$ sudo journalctl -xn
-- Logs begin at Fr 2013-12-27 13:25:36 CET, end at Mo 2014-01-13 12:53:06 CET. --
Jan 13 12:52:36 laptop2 dhcpcd[1753]: version 6.1.0 starting
Jan 13 12:52:36 laptop2 dhcpcd[1753]: eno1: soliciting a DHCP lease
Jan 13 12:53:06 laptop2 dhcpcd[1753]: timed out
Jan 13 12:53:06 laptop2 dhcpcd[1753]: exited
Jan 13 12:53:06 laptop2 network[1707]: DHCP IP lease attempt failed on interface 'eno1'
Jan 13 12:53:06 laptop2 network[1707]: Failed to bring the network up for profile 'dhcp'
Jan 13 12:53:06 laptop2 systemd[1]: netctl@dhcp.service: main process exited, code=exited, status=1/FAILURE
Jan 13 12:53:06 laptop2 systemd[1]: Failed to start Networking for netctl profile dhcp.

在刪除租約並重/var/lib/dhcpcd/dhcpcd-eno1.lease6試後,我仍然收到相同的錯誤消息。寫入TimeoutDHCP=40/etc/netctl/hooks/timeout使其可執行也不會改變任何內容。

OP ( Konrad Höffner ) 於 2014年 10 月 21 日 7:22在他的問題中發布了這個答案:

解決了

網路電纜有故障。我把它關掉了,它又可以工作了。

引用自:https://unix.stackexchange.com/questions/109132