Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Cannot disable dhcp for network interface

Linux Kernel, Network, and Services configuration.
Message
Author
reinob
Posts: 1198
Joined: 2014-06-30 11:42
Has thanked: 99 times
Been thanked: 47 times

Re: Cannot disable dhcp for network interface

#21 Post by reinob »

deadwax wrote: There are certainly workarounds, but I'd rather know what's going on.
You could run "journalctl -b" and review the log. Somewhere you should see what/who caused a DHCP client to get an address off your router.

If you have diffculty reading the log file, you could always copy it and paste it here (or at some pastebin-like service), and at least I would have a look.

Good luck.

User avatar
wizard10000
Global Moderator
Global Moderator
Posts: 622
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 81 times
Been thanked: 98 times

Re: Cannot disable dhcp for network interface

#22 Post by wizard10000 »

reinob wrote:You could run "journalctl -b" and review the log.
I'm becoming a big fan of cockpit for troubleshooting busted services. Click on the failed service and you get the relevant snippet of the log.
we see things not as they are, but as we are.
-- anais nin

trinidad
Posts: 299
Joined: 2016-08-04 14:58
Been thanked: 16 times

Re: Cannot disable dhcp for network interface

#23 Post by trinidad »

I'll add a couple more stupid questions: Is it an ISPs router or your own? Is there a Windows 10 build 18.09 or higher computer on the same network, and was it running on the network when you attempted assigning the static address to Debian?

TC
You can't believe your eyes if your imagination is out of focus.

reinob
Posts: 1198
Joined: 2014-06-30 11:42
Has thanked: 99 times
Been thanked: 47 times

Re: Cannot disable dhcp for network interface

#24 Post by reinob »

wizard10000 wrote:
reinob wrote:You could run "journalctl -b" and review the log.
I'm becoming a big fan of cockpit for troubleshooting busted services. Click on the failed service and you get the relevant snippet of the log.
Good to know (I use journalctl -u <unit>), in this case however, the very problem is that we don't know which service/unit/program/daemon/... decided to play with DHCP. So the whole log needs to be reviewed..

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Cannot disable dhcp for network interface

#25 Post by Head_on_a_Stick »

Check which services are enabled:

Code: Select all

systemctl list-unit-files --state=enabled
Or if you prefer hairy shirts:

Code: Select all

ls -lR /etc/systemd/system
deadbang

deadwax
Posts: 14
Joined: 2019-07-22 08:54

Re: Cannot disable dhcp for network interface

#26 Post by deadwax »

From the relevant part of journalctl -b

Code: Select all

Jul 23 06:44:30 Benod3 sh[332]: Error: Nexthop device is not up.
Jul 23 06:44:30 Benod3 sh[332]: ifup: failed to bring up enp2s0
Jul 23 06:44:30 Benod3 systemd[1]: ifup@enp2s0.service: Main process exited, code=exited, status=1/FAILURE
Jul 23 06:44:30 Benod3 systemd[1]: ifup@enp2s0.service: Failed with result 'exit-code'.
Jul 23 06:44:31 Benod3 avahi-daemon[375]: Joining mDNS multicast group on interface enp2s0.IPv4 with address 192.168.1.15.
Jul 23 06:44:31 Benod3 avahi-daemon[375]: New relevant interface enp2s0.IPv4 for mDNS.
Jul 23 06:44:31 Benod3 avahi-daemon[375]: Registering new address record for 192.168.1.15 on enp2s0.IPv4.
Jul 23 06:44:31 Benod3 kernel: IPv6: ADDRCONF(NETDEV_UP): enp2s0: link is not ready
Jul 23 06:44:31 Benod3 connmand[386]: Checking loopback interface settings
Jul 23 06:44:31 Benod3 connmand[386]: System hostname is Benod3
Jul 23 06:44:31 Benod3 connmand[386]: __connman_inet_get_pnp_nameservers: Cannot read /proc/net/pnp Failed to open file “/proc/net/pnp”: No such file or directory
Jul 23 06:44:31 Benod3 connmand[386]: lo {newlink} index 1 address 00:00:00:00:00:00 mtu 65536
Jul 23 06:44:31 Benod3 connmand[386]: lo {newlink} index 1 operstate 0 <UNKNOWN>
Jul 23 06:44:31 Benod3 connmand[386]: enp2s0 {create} index 2 type 1 <ETHER>
Jul 23 06:44:31 Benod3 connmand[386]: enp2s0 {update} flags 36867 <UP>
Jul 23 06:44:31 Benod3 connmand[386]: enp2s0 {newlink} index 2 address 3C:D9:2B:02:96:CC mtu 1500
Jul 23 06:44:31 Benod3 connmand[386]: enp2s0 {newlink} index 2 operstate 2 <DOWN>
Jul 23 06:44:31 Benod3 connmand[386]: Adding interface enp2s0 [ ethernet ]
Jul 23 06:44:31 Benod3 connmand[386]: enp2s0 {add} address 192.168.1.15/24 label enp2s0 family 2
Jul 23 06:44:31 Benod3 connmand[386]: enp2s0 {add} route 0.0.0.0 gw 192.168.1.1 scope 0 <UNIVERSE>
Jul 23 06:44:31 Benod3 connmand[386]: enp2s0 {add} route 192.168.1.0 gw 0.0.0.0 scope 253 <LINK>
Jul 23 06:44:31 Benod3 connmand[386]: The name net.connman.vpn was not provided by any .service files
Jul 23 06:44:31 Benod3 dbus-daemon[385]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' request
Jul 23 06:44:31 Benod3 systemd[1]: Starting Hostname Service...
Jul 23 06:44:31 Benod3 dbus-daemon[385]: [system] Successfully activated service 'org.freedesktop.hostname1'
Jul 23 06:44:31 Benod3 systemd[1]: Started Hostname Service.
Jul 23 06:44:32 Benod3 ModemManager[380]: <info>  Couldn't check support for device '/sys/devices/pci0000:00/0000:00:06.0/0000:02:00.0': not supported by any plugin
Jul 23 06:44:34 Benod3 kernel: tg3 0000:02:00.0 enp2s0: Link is up at 1000 Mbps, full duplex
Jul 23 06:44:34 Benod3 kernel: tg3 0000:02:00.0 enp2s0: Flow control is on for TX and on for RX
Jul 23 06:44:34 Benod3 kernel: IPv6: ADDRCONF(NETDEV_CHANGE): enp2s0: link becomes ready
Jul 23 06:44:34 Benod3 connmand[386]: enp2s0 {add} route fe80:: gw :: scope 0 <UNIVERSE>
Jul 23 06:44:34 Benod3 connmand[386]: enp2s0 {update} flags 102467 <UP,RUNNING,LOWER_UP>
Jul 23 06:44:34 Benod3 connmand[386]: enp2s0 {newlink} index 2 address 3C:D9:2B:02:96:CC mtu 1500
Jul 23 06:44:34 Benod3 connmand[386]: enp2s0 {newlink} index 2 operstate 6 <UP>
Jul 23 06:44:34 Benod3 kernel: 8021q: 802.1Q VLAN Support v1.8
Jul 23 06:44:35 Benod3 avahi-daemon[375]: Joining mDNS multicast group on interface enp2s0.IPv6 with address fe80::3ed9:2bff:fe02:96cc.
Jul 23 06:44:35 Benod3 avahi-daemon[375]: New relevant interface enp2s0.IPv6 for mDNS.
Jul 23 06:44:35 Benod3 avahi-daemon[375]: Registering new address record for fe80::3ed9:2bff:fe02:96cc on enp2s0.*.
Jul 23 06:44:39 Benod3 systemd[1]: Started Raise network interfaces.
Jul 23 06:44:39 Benod3 systemd[1]: Reached target Network.
Jul 23 06:44:39 Benod3 systemd[1]: Starting Permit User Sessions...

User avatar
wizard10000
Global Moderator
Global Moderator
Posts: 622
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 81 times
Been thanked: 98 times

Re: Cannot disable dhcp for network interface

#27 Post by wizard10000 »

My google-fu says to either disable dhcpd or add `denyinterfaces enp2s0` to /etc/dhcpd.conf
we see things not as they are, but as we are.
-- anais nin

reinob
Posts: 1198
Joined: 2014-06-30 11:42
Has thanked: 99 times
Been thanked: 47 times

Re: Cannot disable dhcp for network interface

#28 Post by reinob »

deadwax wrote:From the relevant part of journalctl -b
I see you're running connman, but is apparently respecting your static address (.15).
Other than that, there's no mention of dhcp anywhere... which makes me think that maybe you removed too much off the log as irrelevant..

All I can say is, try again (or post the full log from a fresh reboot).

Also, to double-check, could you post the output of "ifconfig" and "ip a". So we have an overview of interfaces and addresses assigned to them.

Good luck.

shep
Posts: 423
Joined: 2011-03-15 15:22

Re: Cannot disable dhcp for network interface

#29 Post by shep »

Systemd/udev are now the default for bringing up a connection. When Debian documentation is lagging, I usually find the answer in ArchLinux wiki's

https://wiki.archlinux.org/index.php/Sy ... _static_IP
Wired adapter using DHCP
/etc/systemd/network/20-wired.network

[Match]
Name=enp1s0

[Network]
DHCP=ipv4


Wired adapter using a static IP
/etc/systemd/network/20-wired.network

[Match]
Name=enp1s0

[Network]
Address=10.1.10.9/24
Gateway=10.1.10.1
DNS=10.1.10.1
#DNS=8.8.8.8

theblueplll
Posts: 154
Joined: 2019-04-29 01:17
Been thanked: 2 times

Re: Cannot disable dhcp for network interface

#30 Post by theblueplll »

Did anyone metnion removing anything that has to do with dhcp and any network managers?

This is what I had to do when I started using a static ip and custom dns for it all to be system wide and not have my resolv.conf messed with.

Should have been the first thougt instead of 2 pages of confusing the op and interrogation about the entire system.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Cannot disable dhcp for network interface

#31 Post by Head_on_a_Stick »

theblueplll wrote:Did anyone metnion removing anything that has to do with dhcp and any network managers?
That wouldn't tell us what caused the OP's problem.
theblueplll wrote:Should have been the first thougt instead of 2 pages of confusing the op and interrogation about the entire system.
No, we just need to see which unit files are enabled. I wonder how we would do that... *cough*
shep wrote:Systemd/udev are now the default for bringing up a connection.
Only in CoreOS ;)
deadbang

theblueplll
Posts: 154
Joined: 2019-04-29 01:17
Been thanked: 2 times

Re: Cannot disable dhcp for network interface

#32 Post by theblueplll »

Head_on_a_Stick
Alright try not to be too rough on me I misunderstood a few things and had a few drinks last night when I posted that. :lol:

deadwax
Posts: 14
Joined: 2019-07-22 08:54

Re: Cannot disable dhcp for network interface

#33 Post by deadwax »

Sorry for the delay, parenting and real work took priority.
Systemd/udev are now the default for bringing up a connection.
As I've noted there is nothing in /etc/systemd/network As in, really, really nothing.

Code: Select all

$ ls -laF
total 8
drwxr-xr-x 2 root root 4096 May 25 06:58 ./
drwxr-xr-x 5 root root 4096 Jul 22 09:09 ../
Check which services are enabled:

Code: Select all

#systemctl list-unit-files --state=enabled
UNIT FILE                                  STATE
anacron.service                            enabled
apparmor.service                           enabled
autovt@.service                            enabled
avahi-daemon.service                       enabled
bluetooth.service                          enabled
connman-wait-online.service                enabled
connman.service                            enabled
console-setup.service                      enabled
cron.service                               enabled
dbus-fi.w1.wpa_supplicant1.service         enabled
dbus-org.bluez.service                     enabled
dbus-org.freedesktop.Avahi.service         enabled
dbus-org.freedesktop.ModemManager1.service enabled
dbus-org.freedesktop.timesync1.service     enabled
dundee.service                             enabled
getty@.service                             enabled
haveged.service                            enabled
keyboard-setup.service                     enabled
ModemManager.service                       enabled
networking.service                         enabled
ofono.service                              enabled
rsyslog.service                            enabled
ssh.service                                enabled
sshd.service                               enabled
syslog.service                             enabled
systemd-timesyncd.service                  enabled
udisks2.service                            enabled
wpa_supplicant.service                     enabled
avahi-daemon.socket                        enabled
remote-fs.target                           enabled
anacron.timer                              enabled
apt-daily-upgrade.timer                    enabled
apt-daily.timer                            enabled
logrotate.timer                            enabled
man-db.timer                               enabled

35 unit files listed.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Cannot disable dhcp for network interface

#34 Post by Head_on_a_Stick »

OK, so conman is enabled as well as networking.service and it seems to be controlling the interface (as reinob noted earlier). Not sure why wpa_supplicant.service is enabled though, that might cause conflicts for a wireless connection.

So if we could see the outputs requested by reinob in their last post that would clarify exactly which addresses are assigned to which devices.
deadbang

deadwax
Posts: 14
Joined: 2019-07-22 08:54

Re: Cannot disable dhcp for network interface

#35 Post by deadwax »

Ok, during the last two boots it has not brought up the static address. I don't know why, I shutdown immediately after checking the enabled services this morning at which point the static address had come up normally.

So at the moment

Code: Select all

~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp2s0: <BROADCAST,MULTICAST,DYNAMIC,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 3c:d9:2b:02:96:cc brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.108/24 brd 192.168.1.255 scope global enp2s0
       valid_lft forever preferred_lft forever
    inet6 fe80::3ed9:2bff:fe02:96cc/64 scope link
       valid_lft forever preferred_lft forever
ifconfig not installed.

And https://pastebin.com/Dndsvpz5 for journalctl

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Cannot disable dhcp for network interface

#36 Post by Head_on_a_Stick »

Try this

Code: Select all

# systemctl stop conman
# systemctl restart networking
# ifdown enp2s0
# ifup enp2s0
Then post any error messages and also the output of

Code: Select all

ip a
ip r
Thanks!
deadbang

reinob
Posts: 1198
Joined: 2014-06-30 11:42
Has thanked: 99 times
Been thanked: 47 times

Re: Cannot disable dhcp for network interface

#37 Post by reinob »

@deadwax,

Thanks for the log. Apparently you get your static (.15) address at the beginning, and then later connman assigns the dynamic one (.108).

Unfortunately connman doens't seem to log to the journal. In any case, if you only want a static address you don't need any connection manager, so after testing what @Head_on_a_Stick has recommended, you should

Code: Select all

# systemctl disable connman
Good luck.

deadwax
Posts: 14
Joined: 2019-07-22 08:54

Re: Cannot disable dhcp for network interface

#38 Post by deadwax »

The last two posts from Head_on_a_Stick and reinob result in more sensible behaviour, with the dynamic address disappearing.

I am not certain why connman was running or why it ignores the interfaces config. Only thing I can think of for the former is that it is brought in by the LXQT desktop packages (selected at installation by tasksel). The default beahviour doesn't seem ideal or very clear, I'm not certain anyone would be happy to accept this as a bug report though. Happy to be corrected on that.

reinob
Posts: 1198
Joined: 2014-06-30 11:42
Has thanked: 99 times
Been thanked: 47 times

Re: Cannot disable dhcp for network interface

#39 Post by reinob »

deadwax wrote:The last two posts from Head_on_a_Stick and reinob result in more sensible behaviour, with the dynamic address disappearing.

I am not certain why connman was running or why it ignores the interfaces config. Only thing I can think of for the former is that it is brought in by the LXQT desktop packages (selected at installation by tasksel). The default beahviour doesn't seem ideal or very clear, I'm not certain anyone would be happy to accept this as a bug report though. Happy to be corrected on that.
I imagine that most people will install either gnome or kde, which would automatically install the network manager, while those installing lxqt automatically get connman, and expect it to work out of the box, i.e. with DHCP.

I guess one could file a bug agaist connman, which should respect /etc/network/interfaces. I think NM does that.

Anyway, happy that your issue is solved :)

Post Reply