我在Debian上。我使用静态 IP (192.168.1.56) 配置我的 NIC。
当我尝试连接到网络时,最初ifconfig eth2
我得到(正确):
eth2 inet addr:192.168.1.56 ....
inet6 addr: fe80:221:ff:fe96:4598/64
但几秒钟后192.168.1.56
消失了,几秒钟后 inet6 地址也消失了。当我按下它时,nm-applet
它需要密码,但同时它会尝试连接。
在我的大学,连接是 DHCP 连接。它在前几秒钟有效,但之后就不起作用了。我该如何解决这个问题?
这是系统日志的相关部分:(静态IP配置)
Jan 5 16:38:29 patina dhcdbd: message_handler: message handler not found under /com/redhat/dhcp/eth2 for sub-path eth2.dbus.get.reason
Jan 5 16:38:29 patina NetworkManager: <debug> [1294245509.629163] nm_device_802_11_wireless_get_activation_ap(): Forcing AP 'Cagei2'
Jan 5 16:38:29 patina NetworkManager: <info> User Switch: /org/freedesktop/NetworkManager/Devices/eth2 / Cagei2
Jan 5 16:38:29 patina NetworkManager: <info> Deactivating device eth2.
Jan 5 16:38:29 patina NetworkManager: <WARN> nm_device_802_11_wireless_set_wep_enc_key(): error setting key for device eth2: Invalid argument
Jan 5 16:38:29 patina NetworkManager: <info> Device eth2 activation scheduled...
Jan 5 16:38:29 patina NetworkManager: <info> Activation (eth2) started...
Jan 5 16:38:29 patina NetworkManager: <info> Activation (eth2) Stage 1 of 5 (Device Prepare) scheduled...
Jan 5 16:38:29 patina NetworkManager: <info> Activation (eth2) Stage 1 of 5 (Device Prepare) started...
Jan 5 16:38:29 patina NetworkManager: <info> Activation (eth2) Stage 2 of 5 (Device Configure) scheduled...
Jan 5 16:38:29 patina NetworkManager: <info> Activation (eth2) Stage 1 of 5 (Device Prepare) complete.
Jan 5 16:38:29 patina NetworkManager: <info> Activation (eth2) Stage 2 of 5 (Device Configure) starting...
Jan 5 16:38:29 patina NetworkManager: <info> Activation (eth2/wireless): access point 'Cagei2' is encrypted, but NO valid key exists. New key needed.
Jan 5 16:38:29 patina NetworkManager: <info> Activation (eth2) New wireless user key requested for network 'Cagei2'.
Jan 5 16:38:29 patina NetworkManager: <info> Activation (eth2) Stage 2 of 5 (Device Configure) complete.
Jan 5 16:40:15 patina dhclient: There is already a pid file /var/run/dhclient.eth0.pid with pid 2304
Jan 5 16:40:15 patina dhclient: killed old client process, removed PID file
Jan 5 16:40:15 patina dhclient: Internet Systems Consortium DHCP Client V3.1.1
Jan 5 16:40:15 patina dhclient: Copyright 2004-2008 Internet Systems Consortium.
Jan 5 16:40:15 patina dhclient: All rights reserved.
Jan 5 16:40:15 patina dhclient: For info, please visit http://www.isc.org/sw/dhcp/
Jan 5 16:40:15 patina dhclient:
Jan 5 16:40:15 patina dhclient: Listening on LPF/eth0/00:23:8b:54:96:5d
Jan 5 16:40:15 patina dhclient: Sending on LPF/eth0/00:23:8b:54:96:5d
Jan 5 16:40:15 patina dhclient: Sending on Socket/fallback
Jan 5 16:40:15 patina dhclient: DHCPRELEASE on eth0 to 192.168.1.1 port 67
Jan 5 16:40:15 patina avahi-autoipd(eth0)[2133]: Got SIGTERM, quitting.
Jan 5 16:40:15 patina avahi-autoipd(eth0)[2133]: Callout STOP, address 169.254.6.95 on interface eth0
Jan 5 16:40:48 patina dhcdbd: message_handler: message handler not found under /com/redhat/dhcp/eth2 for sub-path eth2.dbus.get.reason
Jan 5 16:40:48 patina NetworkManager: <debug> [1294245648.742672] nm_device_802_11_wireless_get_activation_ap(): Forcing AP 'Cagei2'
Jan 5 16:40:48 patina NetworkManager: <info> User Switch: /org/freedesktop/NetworkManager/Devices/eth2 / Cagei2
Jan 5 16:40:48 patina NetworkManager: <info> Deactivating device eth2.
Jan 5 16:40:48 patina NetworkManager: <info> Activation (eth2): cancelling...
Jan 5 16:40:48 patina NetworkManager: <info> Activation (eth2) cancellation handler scheduled...
Jan 5 16:40:48 patina NetworkManager: <info> Activation (eth2): waiting for device to cancel activation.
Jan 5 16:40:48 patina NetworkManager: <info> Activation (eth2) cancellation handled.
Jan 5 16:40:48 patina NetworkManager: <info> Activation (eth2): cancelled.
Jan 5 16:40:48 patina NetworkManager: <WARN> nm_device_802_11_wireless_set_wep_enc_key(): error setting key for device eth2: Invalid argument
Jan 5 16:40:48 patina NetworkManager: <info> Device eth2 activation scheduled...
Jan 5 16:40:48 patina NetworkManager: <info> Activation (eth2) started...
Jan 5 16:40:48 patina NetworkManager: <info> Activation (eth2) Stage 1 of 5 (Device Prepare) scheduled...
Jan 5 16:40:48 patina NetworkManager: <info> Activation (eth2) Stage 1 of 5 (Device Prepare) started...
Jan 5 16:40:48 patina NetworkManager: <info> Activation (eth2) Stage 2 of 5 (Device Configure) scheduled...
Jan 5 16:40:48 patina NetworkManager: <info> Activation (eth2) Stage 1 of 5 (Device Prepare) complete.
Jan 5 16:40:48 patina NetworkManager: <info> Activation (eth2) Stage 2 of 5 (Device Configure) starting...
Jan 5 16:40:48 patina NetworkManager: <info> Activation (eth2/wireless): access point 'Cagei2' is encrypted, but NO valid key exists. New key needed.
Jan 5 16:40:48 patina NetworkManager: <info> Activation (eth2) New wireless user key requested for network 'Cagei2'.
Jan 5 16:40:48 patina NetworkManager: <info> Activation (eth2) Stage 2 of 5 (Device Configure) complete.
Jan 5 16:40:54 patina kernel: [ 1397.945334] lo: Disabled Privacy Extensions
Jan 5 16:41:06 patina NetworkManager: <info> Activation (eth2) New wireless user key for network 'Cagei2' received.
Jan 5 16:41:06 patina NetworkManager: <info> Activation (eth2) Stage 1 of 5 (Device Prepare) scheduled...
Jan 5 16:41:06 patina NetworkManager: <info> Activation (eth2) Stage 1 of 5 (Device Prepare) started...
Jan 5 16:41:06 patina NetworkManager: <info> Activation (eth2) Stage 2 of 5 (Device Configure) scheduled...
Jan 5 16:41:06 patina NetworkManager: <info> Activation (eth2) Stage 1 of 5 (Device Prepare) complete.
Jan 5 16:41:06 patina NetworkManager: <info> Activation (eth2) Stage 2 of 5 (Device Configure) starting...
Jan 5 16:41:06 patina NetworkManager: <info> Activation (eth2/wireless): access point 'Cagei2' is encrypted, and a key exists. No new key needed.
Jan 5 16:41:08 patina NetworkManager: <info> SUP: sending command 'INTERFACE_ADD eth2#011#011wext#011/var/run/wpa_supplicant#011'
Jan 5 16:41:08 patina kernel: [ 1411.596736] ADDRCONF(NETDEV_CHANGE): eth2: link becomes ready
Jan 5 16:41:08 patina NetworkManager: <info> SUP: response was 'OK'
Jan 5 16:41:08 patina NetworkManager: <info> SUP: sending command 'AP_SCAN 1'
Jan 5 16:41:08 patina NetworkManager: <info> SUP: response was 'OK'
Jan 5 16:41:08 patina NetworkManager: <info> SUP: sending command 'ADD_NETWORK'
Jan 5 16:41:08 patina NetworkManager: <info> SUP: response was '0'
Jan 5 16:41:08 patina NetworkManager: <info> SUP: sending command 'SET_NETWORK 0 ssid 436167656932'
Jan 5 16:41:08 patina NetworkManager: <info> SUP: response was 'OK'
Jan 5 16:41:08 patina NetworkManager: <info> SUP: sending command 'SET_NETWORK 0 proto WPA2'
Jan 5 16:41:08 patina NetworkManager: <info> SUP: response was 'OK'
Jan 5 16:41:08 patina NetworkManager: <info> SUP: sending command 'SET_NETWORK 0 key_mgmt WPA-PSK'
Jan 5 16:41:08 patina NetworkManager: <info> SUP: response was 'OK'
Jan 5 16:41:08 patina NetworkManager: <info> SUP: sending command 'SET_NETWORK 0 psk <key>'
Jan 5 16:41:08 patina NetworkManager: <info> SUP: response was 'OK'
Jan 5 16:41:08 patina NetworkManager: <info> SUP: sending command 'ENABLE_NETWORK 0'
Jan 5 16:41:08 patina NetworkManager: <info> SUP: response was 'OK'
Jan 5 16:41:08 patina NetworkManager: <info> Activation (eth2) Stage 2 of 5 (Device Configure) complete.
Jan 5 16:41:08 patina NetworkManager: <info> Supplicant state changed: 1
Jan 5 16:41:08 patina NetworkManager: <info> Activation (eth2/wireless) Stage 2 of 5 (Device Configure) successful. Connected to access point 'Cagei2'.
Jan 5 16:41:08 patina NetworkManager: <info> Activation (eth2) Stage 3 of 5 (IP Configure Start) scheduled.
Jan 5 16:41:08 patina NetworkManager: <info> Activation (eth2) Stage 3 of 5 (IP Configure Start) started...
Jan 5 16:41:09 patina NetworkManager: <info> Activation (eth2) Beginning DHCP transaction.
Jan 5 16:41:09 patina NetworkManager: <info> Activation (eth2) Stage 3 of 5 (IP Configure Start) complete.
Jan 5 16:41:09 patina NetworkManager: <info> DHCP daemon state is now 12 (successfully started) for interface eth2
Jan 5 16:41:09 patina dhclient: Internet Systems Consortium DHCP Client 4.1.1-P1
Jan 5 16:41:09 patina dhclient: Copyright 2004-2010 Internet Systems Consortium.
Jan 5 16:41:09 patina dhclient: All rights reserved.
Jan 5 16:41:09 patina dhclient: For info, please visit https://www.isc.org/software/dhcp/
Jan 5 16:41:09 patina dhclient:
Jan 5 16:41:09 patina dhclient: Listening on LPF/eth2/00:21:00:96:45:98
Jan 5 16:41:09 patina dhclient: Sending on LPF/eth2/00:21:00:96:45:98
Jan 5 16:41:09 patina dhclient: Sending on Socket/fallback
Jan 5 16:41:10 patina dhclient: DHCPDISCOVER on eth2 to 255.255.255.255 port 67 interval 7
Jan 5 16:41:17 patina dhclient: DHCPDISCOVER on eth2 to 255.255.255.255 port 67 interval 12
Jan 5 16:41:18 patina kernel: [ 1421.604521] eth2: no IPv6 routers present
Jan 5 16:41:29 patina dhclient: DHCPDISCOVER on eth2 to 255.255.255.255 port 67 interval 19
Jan 5 16:41:48 patina dhclient: DHCPDISCOVER on eth2 to 255.255.255.255 port 67 interval 14
Jan 5 16:41:54 patina NetworkManager: <info> Device 'eth2' DHCP transaction took too long (>45s), stopping it.
Jan 5 16:41:54 patina dhclient: Internet Systems Consortium DHCP Client 4.1.1-P1
Jan 5 16:41:54 patina dhclient: Copyright 2004-2010 Internet Systems Consortium.
Jan 5 16:41:54 patina dhclient: All rights reserved.
Jan 5 16:41:54 patina dhclient: For info, please visit https://www.isc.org/software/dhcp/
Jan 5 16:41:54 patina dhclient:
Jan 5 16:41:54 patina dhclient: Listening on LPF/eth2/00:21:00:96:45:98
Jan 5 16:41:54 patina dhclient: Sending on LPF/eth2/00:21:00:96:45:98
Jan 5 16:41:54 patina dhclient: Sending on Socket/fallback
Jan 5 16:41:54 patina dhclient: DHCPRELEASE on eth2 to 137.222.253.66 port 67
Jan 5 16:41:54 patina dhclient: send_packet: Network is unreachable
Jan 5 16:41:54 patina dhclient: send_packet: please consult README file regarding broadcast address.
Jan 5 16:41:55 patina NetworkManager: <info> Activation (eth2) Stage 4 of 5 (IP Configure Timeout) scheduled...
Jan 5 16:41:55 patina NetworkManager: <info> DHCP daemon state is now 14 (normal exit) for interface eth2
Jan 5 16:41:55 patina NetworkManager: <info> DHCP daemon state is now 14 (normal exit) for interface eth2
Jan 5 16:41:55 patina NetworkManager: <info> Activation (eth2) Stage 4 of 5 (IP Configure Timeout) started...
Jan 5 16:41:55 patina NetworkManager: <info> Activation (eth2) failure scheduled...
Jan 5 16:41:55 patina NetworkManager: <info> Activation (eth2) Stage 4 of 5 (IP Configure Timeout) complete.
Jan 5 16:41:55 patina NetworkManager: <info> Activation (eth2) failed for access point (Cagei2)
Jan 5 16:41:55 patina NetworkManager: <info> Activation (eth2) failed.
Jan 5 16:41:55 patina NetworkManager: <info> Deactivating device eth2.
Jan 5 16:41:55 patina NetworkManager: <WARN> nm_device_802_11_wireless_set_wep_enc_key(): error setting key for device eth2: Invalid argument
Jan 5 16:41:56 patina kernel: [ 1460.455299] ADDRCONF(NETDEV_CHANGE): eth2: link becomes ready
Jan 5 16:42:07 patina kernel: [ 1471.332129] eth2: no IPv6 routers present
Jan 5 16:46:00 patina kernel: [ 1703.976186] usb 1-3: new high speed USB device using ehci_hcd and address 2
Jan 5 16:46:00 patina kernel: [ 1704.120840] usb 1-3: New USB device found, idVendor=13fe, idProduct=1e00
Jan 5 16:46:00 patina kernel: [ 1704.120851] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Jan 5 16:46:00 patina kernel: [ 1704.120858] usb 1-3: Product: USB DISK 2.0
Jan 5 16:46:00 patina kernel: [ 1704.120863] usb 1-3: Manufacturer:
Jan 5 16:46:00 patina kernel: [ 1704.120868] usb 1-3: SerialNumber: 078203000F3C
Jan 5 16:46:00 patina kernel: [ 1704.121082] usb 1-3: configuration #1 chosen from 1 choice
Jan 5 16:46:00 patina NetworkManager: <debug> [1294245960.538897] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_13fe_1e00_078203000F3C').
Jan 5 16:46:00 patina kernel: [ 1704.328698] Initializing USB Mass Storage driver...
Jan 5 16:46:00 patina kernel: [ 1704.328913] scsi6 : SCSI emulation for USB Mass Storage devices
Jan 5 16:46:00 patina kernel: [ 1704.329254] usbcore: registered new interface driver usb-storage
Jan 5 16:46:00 patina kernel: [ 1704.329263] USB Mass Storage support registered.
Jan 5 16:46:00 patina kernel: [ 1704.331074] usb-storage: device found at 2
Jan 5 16:46:00 patina kernel: [ 1704.331080] usb-storage: waiting for device to settle before scanning
Jan 5 16:46:00 patina NetworkManager: <debug> [1294245960.740962] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_13fe_1e00_078203000F3C_if0').
Jan 5 16:46:00 patina NetworkManager: <debug> [1294245960.742373] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_13fe_1e00_078203000F3C_if0_scsi_host').
Jan 5 16:46:05 patina kernel: [ 1709.329094] usb-storage: device scan complete
Jan 5 16:46:05 patina kernel: [ 1709.379165] scsi 6:0:0:0: Direct-Access USB DISK 2.0 PMAP PQ: 0 ANSI: 0 CCS
Jan 5 16:46:05 patina kernel: [ 1709.380922] sd 6:0:0:0: Attached scsi generic sg2 type 0
Jan 5 16:46:05 patina NetworkManager: <debug> [1294245965.792242] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_13fe_1e00_078203000F3C_if0_scsi_host_0').
Jan 5 16:46:05 patina NetworkManager: <debug> [1294245965.795336] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_13fe_1e00_078203000F3C_if0_scsi_host_0_scsi_device_lun0').
Jan 5 16:46:05 patina NetworkManager: <debug> [1294245965.799318] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_13fe_1e00_078203000F3C_if0_scsi_host_0_scsi_device_lun0_scsi_generic').
Jan 5 16:46:06 patina kernel: [ 1710.042152] sd 6:0:0:0: [sdb] 8060928 512-byte logical blocks: (4.12 GB/3.84 GiB)
Jan 5 16:46:06 patina kernel: [ 1710.043009] sd 6:0:0:0: [sdb] Write Protect is off
Jan 5 16:46:06 patina kernel: [ 1710.043020] sd 6:0:0:0: [sdb] Mode Sense: 23 00 00 00
Jan 5 16:46:06 patina kernel: [ 1710.043026] sd 6:0:0:0: [sdb] Assuming drive cache: write through
Jan 5 16:46:06 patina kernel: [ 1710.047632] sd 6:0:0:0: [sdb] Assuming drive cache: write through
Jan 5 16:46:06 patina kernel: [ 1710.047643] sdb: sdb1
Jan 5 16:46:06 patina kernel: [ 1710.113494] sd 6:0:0:0: [sdb] Assuming drive cache: write through
Jan 5 16:46:06 patina kernel: [ 1710.113504] sd 6:0:0:0: [sdb] Attached SCSI removable disk
Jan 5 16:46:06 patina NetworkManager: <debug> [1294245966.835564] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/storage_serial__USB_DISK_2_0_078203000F3C_0_0').
Jan 5 16:46:07 patina NetworkManager: <debug> [1294245967.016379] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/volume_uuid_BCD8_97AF').
Jan 5 16:46:07 patina kernel: [ 1710.696802] FAT: utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!
答案1
此类问题通常是由于 IP 地址冲突而导致的,即使您在 LAN 中设置了 DHCP。尝试设置一个空闲IP,然后尝试ping 另一台机器。您还可以检查服务器上的 DHCP 日志文件。
答案2
问题出在网络管理器上。正如基思评论的那样,摆脱它。
您可以在系统日志输出的第一行中清楚地看到问题:
Jan 5 16:38:29 patina dhcdbd: message_handler: message handler not found under /com/redhat/dhcp/eth2 for sub-path eth2.dbus.get.reason
您说它是静态配置,但您的系统在您手动配置后尝试通过 dhcp 配置接口,从而删除您的手动配置。
答案3
我在 Ubuntu 上也有类似的症状。这个答案(虽然它是一个黑客)解决了我的问题: https://askubuntu.com/a/736589/194156
解决方案是:转到网络管理器,并将 MTU 大小设置为 8192 字节。
答案4
在以下文件中更改mode=infrastructure
为:mode=ap
sudo -e /etc/NetworkManager/system-connections/your_connection
来源:https://forums.linuxmint.com/viewtopic.php?p=1138919&sid=8e592bf15722f7981612d742befd6ba9#p1138919