Re: Wait for DHCP client on interface activation



I set may-fail to no for IPv4 and IPv6. And try to do up again.

Same result. Command end successfully and no ip in interface.

I have 2 interfaces and NetworkManager v. 1.0.6-27.el7 on CentOS7.


Here system log:


Jun 16 09:25:26 dhcp-10-30-28-67.sw.ru NetworkManager[3037]: <info>  (eth0): device state change: ip-config -> ip-check (reason 'none') [70 80 0]
Jun 16 09:25:26 dhcp-10-30-28-67.sw.ru NetworkManager[3037]: <info>  (eth0): device state change: ip-check -> secondaries (reason 'none') [80 90 0]
Jun 16 09:25:26 dhcp-10-30-28-67.sw.ru NetworkManager[3037]: <info>  (eth0): device state change: secondaries -> activated (reason 'none') [90 100 0]
Jun 16 09:25:26 dhcp-10-30-28-67.sw.ru NetworkManager[3037]: <info>  (eth0): Activation: successful, device activated.
Jun 16 09:25:26 dhcp-10-30-28-67.sw.ru nm-dispatcher[5554]: Dispatching action 'up' for eth0
Jun 16 09:25:29 dhcp-10-30-28-67.sw.ru dhclient[5553]: DHCPNAK from 10.30.24.72 (xid=0x6c2a1444)
Jun 16 09:25:29 dhcp-10-30-28-67.sw.ru NetworkManager[3037]: <info>  (eth0): DHCPv4 state changed unknown -> expire
Jun 16 09:25:29 dhcp-10-30-28-67.sw.ru NetworkManager[3037]: <info>  (eth0): DHCPv4 state changed expire -> unknown
Jun 16 09:25:29 dhcp-10-30-28-67.sw.ru dhclient[5553]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7 (xid=0x6da66476)
Jun 16 09:25:34 dhcp-10-30-28-67.sw.ru dhclient[5553]: DHCPREQUEST on eth0 to 255.255.255.255 port 67 (xid=0x6da66476)
Jun 16 09:25:34 dhcp-10-30-28-67.sw.ru dhclient[5553]: DHCPOFFER from 10.30.0.25
Jun 16 09:25:39 dhcp-10-30-28-67.sw.ru dhclient[5553]: DHCPACK from 10.30.0.24 (xid=0x6da66476)
Jun 16 09:25:39 dhcp-10-30-28-67.sw.ru NetworkManager[3037]: <info>    address 10.30.24.181
Jun 16 09:25:39 dhcp-10-30-28-67.sw.ru NetworkManager[3037]: <info>    plen 16 (255.255.0.0)
Jun 16 09:25:39 dhcp-10-30-28-67.sw.ru NetworkManager[3037]: <info>    gateway 10.30.0.1
Jun 16 09:25:39 dhcp-10-30-28-67.sw.ru NetworkManager[3037]: <info>    server identifier 10.30.0.24
Jun 16 09:25:39 dhcp-10-30-28-67.sw.ru NetworkManager[3037]: <info>    lease time 86400
Jun 16 09:25:39 dhcp-10-30-28-67.sw.ru NetworkManager[3037]: <info>    nameserver '10.30.0.27'
Jun 16 09:25:39 dhcp-10-30-28-67.sw.ru NetworkManager[3037]: <info>    nameserver '10.30.0.28'
Jun 16 09:25:39 dhcp-10-30-28-67.sw.ru NetworkManager[3037]: <info>    domain name 'sw.ru'
Jun 16 09:25:39 dhcp-10-30-28-67.sw.ru NetworkManager[3037]: <info>    domain search 'sw.ru.'
Jun 16 09:25:39 dhcp-10-30-28-67.sw.ru NetworkManager[3037]: <info>    domain search 'sw.swsoft.com.'
Jun 16 09:25:39 dhcp-10-30-28-67.sw.ru NetworkManager[3037]: <info>  (eth0): DHCPv4 state changed unknown -> bound
Jun 16 09:25:39 dhcp-10-30-28-67.sw.ru NetworkManager[3037]: <info>  NetworkManager state is now CONNECTED_LOCAL
Jun 16 09:25:39 dhcp-10-30-28-67.sw.ru NetworkManager[3037]: <info>  NetworkManager state is now CONNECTED_GLOBAL
Jun 16 09:25:39 dhcp-10-30-28-67.sw.ru NetworkManager[3037]: <info>  Policy set 'prl_nettool-nm-eth0' (eth0) as default for IPv4 routing and DNS.
Jun 16 09:25:39 dhcp-10-30-28-67.sw.ru dbus[663]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
Jun 16 09:25:39 dhcp-10-30-28-67.sw.ru dbus-daemon[663]: dbus[663]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
Jun 16 09:25:40 dhcp-10-30-28-67.sw.ru dhclient[5553]: bound to 10.30.24.181 -- renewal in 38986 seconds.
Jun 16 09:25:40 dhcp-10-30-28-67.sw.ru systemd[1]: Starting Network Manager Script Dispatcher Service...
Jun 16 09:25:40 dhcp-10-30-28-67.sw.ru dbus[663]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Jun 16 09:25:40 dhcp-10-30-28-67.sw.ru dbus-daemon[663]: dbus[663]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Jun 16 09:25:40 dhcp-10-30-28-67.sw.ru systemd[1]: Started Network Manager Script Dispatcher Service.
Jun 16 09:25:40 dhcp-10-30-28-67.sw.ru nm-dispatcher[5589]: Dispatching action 'dhcp4-change' for eth0

What can I do wrong? Help, please.



From: Beniamino Galvani <bgalvani redhat com>
Sent: Tuesday, June 14, 2016 5:48:31 PM
To: Alexander Pisarev
Cc: networkmanager-list gnome org
Subject: Re: Wait for DHCP client on interface activation
 
On Tue, Jun 14, 2016 at 01:32:42PM +0000, Alexander Pisarev wrote:
> Hello everyone,
>
> I want to ask is it ok that n-m didn't waiting for DHCP client?
> Cause when I try to up connection by nmcli, it waiting for something, but not dhclient.
> Maybe be it's possible to add some option or configuration field to say n-m to wait for receive IP? Or it's didn't fit n-m?

Hi,

check the output of 'nmcli connection show <con-name>':

 [...]
 ipv4.may-fail:                          yes|no
 [...]
 ipv6.may-fail:                          yes|no

If the 'ipv4.may-fail' property is set to 'yes', NM considers IPv4 not
necessary for the connection activation success and will return as
soon as IPv6 completes.

Probably you just have to set it to 'no':

 $ nmcli connection modify <con-name> ipv4.may-fail no

so that NM will wait for IPv4 to complete, and fail if it doesn't.

Beniamino


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]