Re: dhclient adding second address to desktop with static IP



On Thu, 2019-08-08 at 11:41 +0100, Mike Fleetwood wrote:
On Wed, 7 Aug 2019 at 12:29, Thomas Haller <thaller redhat com>
wrote:
On Wed, 2019-08-07 at 12:19 +0100, Mike Fleetwood via
networkmanager-
list wrote:
Hi,

On my CentOS 7 / XFCE desktop, I've setup a static IP address
using
NM.
However dhclient is using DHCP and adding a second IP
address.  How
do
I troubleshoot this and turn it off?

Thanks,
Mike

Hi,

Don't enable DHCP (ipv4.method=auto):

nmcli connection modify "$PROFILE" \
  ipv4.method manual \
  ipv4.addresses $ADDRESSES


best,
Thomas

NM was already set for manual IPv4 addresses, but I reset it anyway
[1].
This didn't remove the second DHCP assigned address from the NIC, so
I
removed it manually [2].  Later in the day dhclient re-added a second
DHCP obtained address again[3].

How do I stop dhclient doing this?

Mike


[1] NM already set for manual IPv4 addresses.
# nmcli connection show enp5s0 | egrep 'ipv4.method|ipv4.addresses'
ipv4.method:                            manual
ipv4.addresses:                         192.168.1.2/24

# nmcli connection modify enp5s0 ipv4.method manual ipv4.addresses
192.168.1.2/24

# nmcli connection show enp5s0 | egrep 'ipv4.method|ipv4.addresses'
ipv4.method:                            manual
ipv4.addresses:                         192.168.1.2/24

Hi,

after modifying the connection profile to set ipv4.method=manual, did
you re-activate the profile?

E.g. `nmcli connection up enp5s0`

(Or did you reboot the machine since? Reboot is of course not
necessary, you can just re-activate the profile, but it would do as
well).


Otherwise, show the full level=TRACE log. See 
https://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/contrib/fedora/rpm/NetworkManager.conf#n28
for how to enable debug logging, and note the comments about private
data and and journald's ratelimiting.


Thanks,
Thomas



[2] Manually remove second address.
# ip address list enp5s0
2: enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc
pfifo_fast
state UP group default qlen 1000
    link/ether 48:5b:39:75:42:bc brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.191/24 brd 192.168.1.255 scope global
noprefixroute
dynamic enp5s0
       valid_lft 29514sec preferred_lft 29514sec
    inet 192.168.1.2/24 brd 192.168.1.255 scope global secondary
noprefixroute enp5s0
       valid_lft forever preferred_lft forever
    inet6 fe80::39a1:ab53:fa00:828c/64 scope link noprefixroute
       valid_lft forever preferred_lft forever

# ip address del 192.168.1.191/24 dev enp5s0

# ip address list enp5s0
2: enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc
pfifo_fast
state UP group default qlen 1000
    link/ether 48:5b:39:75:42:bc brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.2/24 brd 192.168.1.255 scope global noprefixroute
enp5s0
       valid_lft forever preferred_lft forever
    inet6 fe80::39a1:ab53:fa00:828c/64 scope link noprefixroute
       valid_lft forever preferred_lft forever


[3] dhclient re-adding DHCP obtained address.
# egrep 'dhclient|nm|NetworkManager|Network Manager'
/var/log/messages
Aug  7 21:24:47 rockover NetworkManager[1216]: <info>
[1565209487.1797] dhcp4 (enp5s0): state changed bound -> expire
Aug  7 21:24:47 rockover NetworkManager[1216]: <info>
[1565209487.1875] dhcp4 (enp5s0): state changed expire -> unknown
Aug  7 21:24:47 rockover dhclient[20511]: DHCPDISCOVER on enp5s0 to
255.255.255.255 port 67 interval 7 (xid=0x7d0b1de4)
Aug  7 21:24:47 rockover dhclient[20511]: DHCPREQUEST on enp5s0 to
255.255.255.255 port 67 (xid=0x7d0b1de4)
Aug  7 21:24:47 rockover dhclient[20511]: DHCPOFFER from 192.168.1.1
Aug  7 21:24:47 rockover dhclient[20511]: DHCPACK from 192.168.1.1
(xid=0x7d0b1de4)
Aug  7 21:24:47 rockover NetworkManager[1216]: <info>
[1565209487.1991] dhcp4 (enp5s0):   address 192.168.1.191
Aug  7 21:24:47 rockover NetworkManager[1216]: <info>
[1565209487.1991] dhcp4 (enp5s0):   plen 24 (255.255.255.0)
Aug  7 21:24:47 rockover NetworkManager[1216]: <info>
[1565209487.1991] dhcp4 (enp5s0):   gateway 192.168.1.1
Aug  7 21:24:47 rockover NetworkManager[1216]: <info>
[1565209487.1991] dhcp4 (enp5s0):   lease time 43200
Aug  7 21:24:47 rockover NetworkManager[1216]: <info>
[1565209487.1992] dhcp4 (enp5s0):   nameserver '192.168.1.1'
Aug  7 21:24:47 rockover NetworkManager[1216]: <info>
[1565209487.1992] dhcp4 (enp5s0):   domain name 'lan'
Aug  7 21:24:47 rockover NetworkManager[1216]: <info>
[1565209487.1992] dhcp4 (enp5s0): state changed unknown -> bound
Aug  7 21:24:47 rockover NetworkManager[1216]: <info>
[1565209487.2011] policy: set-hostname: current hostname was changed
outside NetworkManager: 'rockover'
Aug  7 21:24:47 rockover NetworkManager[1216]: <info>
[1565209487.2019] policy: set-hostname: current hostname was changed
outside NetworkManager: 'rockover'
Aug  7 21:24:47 rockover dbus[1169]: [system] Activating via systemd:
service name='org.freedesktop.nm_dispatcher'
unit='dbus-org.freedesktop.nm-dispatcher.service'
Aug  7 21:24:47 rockover systemd: Starting Network Manager Script
Dispatcher Service...
Aug  7 21:24:47 rockover dhclient[20511]: bound to 192.168.1.191 --
renewal in 20506 seconds.
Aug  7 21:24:47 rockover dbus[1169]: [system] Successfully activated
service 'org.freedesktop.nm_dispatcher'
Aug  7 21:24:47 rockover systemd: Started Network Manager Script
Dispatcher Service.
Aug  7 21:24:47 rockover nm-dispatcher: req:1 'dhcp4-change'
[enp5s0]:
new request (4 scripts)
Aug  7 21:24:47 rockover nm-dispatcher: req:1 'dhcp4-change'
[enp5s0]:
start running ordered scripts...

# ip address list enp5s0
2: enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc
pfifo_fast
state UP group default qlen 1000
    link/ether 48:5b:39:75:42:bc brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.191/24 brd 192.168.1.255 scope global
noprefixroute
dynamic enp5s0
       valid_lft 28029sec preferred_lft 28029sec
    inet 192.168.1.2/24 brd 192.168.1.255 scope global secondary
noprefixroute enp5s0
       valid_lft forever preferred_lft forever
    inet6 fe80::39a1:ab53:fa00:828c/64 scope link noprefixroute
       valid_lft forever preferred_lft forever

Attachment: signature.asc
Description: This is a digitally signed message part



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