![完全禁用 NetworkManager 使用 DHCP 客户端吗?](https://linux22.com/image/205104/%E5%AE%8C%E5%85%A8%E7%A6%81%E7%94%A8%20NetworkManager%20%E4%BD%BF%E7%94%A8%20DHCP%20%E5%AE%A2%E6%88%B7%E7%AB%AF%E5%90%97%EF%BC%9F.png)
我使用的是 RHEL 7.9。我使用这个版本的 RHELnmcli
来nmtui
配置网络连接。
问题:
NetworkManager 服务似乎正在使用以下输出填充 Journalctl 日志
Apr 24 02:16:03 taxmd-trex-02 NetworkManager[1431]: <info> [1650780963.7165] device (p2p3_2): Activation: starting connection 'p2p3_2' (49fb6e36-468f-4a5b-8015-4d6e7728f82c)
Apr 24 02:16:03 taxmd-trex-02 NetworkManager[1431]: <info> [1650780963.7167] device (p2p3_4): Activation: starting connection 'p2p3_4' (673b8472-90f0-4e7d-ace2-91f912c94b1d)
Apr 24 02:16:03 taxmd-trex-02 NetworkManager[1431]: <info> [1650780963.7168] device (p2p3_2): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Apr 24 02:16:03 taxmd-trex-02 NetworkManager[1431]: <info> [1650780963.7172] device (p2p3_4): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Apr 24 02:16:03 taxmd-trex-02 NetworkManager[1431]: <info> [1650780963.7176] device (p2p3_2): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Apr 24 02:16:03 taxmd-trex-02 NetworkManager[1431]: <info> [1650780963.7194] device (p2p3_4): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Apr 24 02:16:03 taxmd-trex-02 NetworkManager[1431]: <info> [1650780963.7212] device (p2p3_2): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
Apr 24 02:16:03 taxmd-trex-02 NetworkManager[1431]: <info> [1650780963.7221] device (p2p3_4): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
Apr 24 02:16:06 taxmd-trex-02 NetworkManager[1431]: <warn> [1650780966.7132] dhcp4 (p2p3): request timed out
Apr 24 02:16:06 taxmd-trex-02 NetworkManager[1431]: <info> [1650780966.7132] dhcp4 (p2p3): state changed unknown -> timeout
Apr 24 02:16:06 taxmd-trex-02 NetworkManager[1431]: <info> [1650780966.7214] dhcp4 (p2p3): canceled DHCP transaction, DHCP client pid 78427
Apr 24 02:16:06 taxmd-trex-02 NetworkManager[1431]: <info> [1650780966.7214] dhcp4 (p2p3): state changed timeout -> done
Apr 24 02:16:06 taxmd-trex-02 NetworkManager[1431]: <info> [1650780966.7217] device (p2p3): state change: ip-config -> failed (reason 'ip-config-unavailable', sys-iface-state: 'managed')
Apr 24 02:16:06 taxmd-trex-02 NetworkManager[1431]: <warn> [1650780966.7222] device (p2p3): Activation: failed for connection 'p2p3'
Apr 24 02:16:06 taxmd-trex-02 NetworkManager[1431]: <info> [1650780966.7224] device (p2p3): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')
Apr 24 02:16:06 taxmd-trex-02 NetworkManager[1431]: <info> [1650780966.7329] policy: auto-activating connection 'p2p3' (0af065ee-a8a0-997a-c03a-b737387d1a9f)
Apr 24 02:16:06 taxmd-trex-02 NetworkManager[1431]: <info> [1650780966.7333] device (p2p3): Activation: starting connection 'p2p3' (0af065ee-a8a0-997a-c03a-b737387d1a9f)
Apr 24 02:16:06 taxmd-trex-02 NetworkManager[1431]: <info> [1650780966.7333] device (p2p3): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Apr 24 02:16:06 taxmd-trex-02 NetworkManager[1431]: <info> [1650780966.7337] device (p2p3): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Apr 24 02:16:06 taxmd-trex-02 NetworkManager[1431]: <info> [1650780966.7434] device (p2p3): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
Apr 24 02:16:06 taxmd-trex-02 NetworkManager[1431]: <info> [1650780966.7437] dhcp4 (p2p3): activation: beginning transaction (timeout in 45 seconds)
Apr 24 02:16:06 taxmd-trex-02 NetworkManager[1431]: <info> [1650780966.7448] dhcp4 (p2p3): dhclient started with pid 78439
Apr 24 02:16:07 taxmd-trex-02 NetworkManager[1431]: <warn> [1650780967.7124] dhcp4 (p2p4): request timed out
Apr 24 02:16:07 taxmd-trex-02 NetworkManager[1431]: <info> [1650780967.7124] dhcp4 (p2p4): state changed unknown -> timeout
Apr 24 02:16:07 taxmd-trex-02 NetworkManager[1431]: <info> [1650780967.7206] dhcp4 (p2p4): canceled DHCP transaction, DHCP client pid 78433
Apr 24 02:16:07 taxmd-trex-02 NetworkManager[1431]: <info> [1650780967.7206] dhcp4 (p2p4): state changed timeout -> done
Apr 24 02:16:07 taxmd-trex-02 NetworkManager[1431]: <info> [1650780967.7207] device (p2p4): state change: ip-config -> failed (reason 'ip-config-unavailable', sys-iface-state: 'managed')
Apr 24 02:16:07 taxmd-trex-02 NetworkManager[1431]: <warn> [1650780967.7211] device (p2p4): Activation: failed for connection 'p2p4'
Apr 24 02:16:07 taxmd-trex-02 NetworkManager[1431]: <info> [1650780967.7213] device (p2p4): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')
Apr 24 02:16:07 taxmd-trex-02 NetworkManager[1431]: <info> [1650780967.7319] policy: auto-activating connection 'p2p4' (8cd96d38-f953-c130-f247-05b56972a953)
Apr 24 02:16:07 taxmd-trex-02 NetworkManager[1431]: <info> [1650780967.7321] device (p2p4): Activation: starting connection 'p2p4' (8cd96d38-f953-c130-f247-05b56972a953)
Apr 24 02:16:07 taxmd-trex-02 NetworkManager[1431]: <info> [1650780967.7322] device (p2p4): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Apr 24 02:16:07 taxmd-trex-02 NetworkManager[1431]: <info> [1650780967.7325] device (p2p4): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Apr 24 02:16:07 taxmd-trex-02 NetworkManager[1431]: <info> [1650780967.7422] device (p2p4): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
Apr 24 02:16:07 taxmd-trex-02 NetworkManager[1431]: <info> [1650780967.7424] dhcp4 (p2p4): activation: beginning transaction (timeout in 45 seconds)
Apr 24 02:16:07 taxmd-trex-02 NetworkManager[1431]: <info> [1650780967.7435] dhcp4 (p2p4): dhclient started with pid 78445
Apr 24 02:16:08 taxmd-trex-02 NetworkManager[1431]: <info> [1650780968.7125] policy: auto-activating connection 'p2p4_1' (ff70a4ab-0b4b-4558-bf07-e24aa8319e72)
Apr 24 02:16:08 taxmd-trex-02 NetworkManager[1431]: <info> [1650780968.7129] device (p2p4_1): Activation: starting connection 'p2p4_1' (ff70a4ab-0b4b-4558-bf07-e24aa8319e72)
Apr 24 02:16:08 taxmd-trex-02 NetworkManager[1431]: <info> [1650780968.7130] device (p2p4_1): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Apr 24 02:16:08 taxmd-trex-02 NetworkManager[1431]: <info> [1650780968.7134] device (p2p4_1): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Apr 24 02:16:08 taxmd-trex-02 NetworkManager[1431]: <info> [1650780968.7154] device (p2p4_1): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
Apr 24 02:16:13 taxmd-trex-02 NetworkManager[1431]: <info> [1650780973.7115] device (p2p3_5): state change: ip-config -> failed (reason 'ip-config-unavailable', sys-iface-state: 'managed')
Apr 24 02:16:13 taxmd-trex-02 NetworkManager[1431]: <warn> [1650780973.7119] device (p2p3_5): Activation: failed for connection 'p2p3_5'
Apr 24 02:16:13 taxmd-trex-02 NetworkManager[1431]: <info> [1650780973.7122] device (p2p3_5): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')
Apr 24 02:16:13 taxmd-trex-02 NetworkManager[1431]: <info> [1650780973.7150] policy: auto-activating connection 'p2p3_5' (a70daadb-15be-4233-807e-3a09e94fdd3e)
对所有未分配 IP 地址的接口重复此操作。
我认为这与 dhcp 有关。我不希望任何 dhcp 客户端在任何接口上运行。其中一些接口将具有静态地址,其他接口则不会。似乎没有 IP 地址的接口,NetworkManager 默认情况下使用自动配置并尝试获取 DHCP。我可以分配链接本地,它会获取 APIPA 地址,我也不想要这样。
是否可以只启用一个没有 IP 地址的接口。并使 NetworkManager 停止尝试获取 IP?