Cannot disable dhcp for network interface

Kernels & Hardware, configuring network, installing services

Re: Cannot disable dhcp for network interface

Postby wizard10000 » 2019-07-22 10:47

Might be a stupid question, but if your router is handing out IP addresses why not just do a MAC reservation on the router to give the machine a static IP?
we see things not as they are, but as we are.
-- anais nin
User avatar
wizard10000
 
Posts: 51
Joined: 2019-04-16 23:15
Location: southeastern us

Re: Cannot disable dhcp for network interface

Postby L_V » 2019-07-22 10:50

This is not "stupid", but will not explain why static IP assignment does not work from Debian, at least for eadwax .
I manage static IP with systemd, and if works fine.
L_V
 
Posts: 1032
Joined: 2007-03-19 09:04

Re: Cannot disable dhcp for network interface

Postby deadwax » 2019-07-22 10:56

As you'd expect from the file in the first post
Code: Select all
# grep -v \# /etc/network/interfaces

source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

auto enp2s0
allow-hotplug enp2s0
iface enp2s0 inet static
        address 192.168.1.15/24
        gateway 192.168.1.1
        dns-nameservers 192.168.1.1
        dns-search mylocalhome
deadwax
 
Posts: 14
Joined: 2019-07-22 08:54

Re: Cannot disable dhcp for network interface

Postby deadwax » 2019-07-22 10:59

Might be a stupid question, but if your router is handing out IP addresses why not just do a MAC reservation on the router to give the machine a static IP?


I could, everything would work (though the interface for that in this router is appalling). But at this point it is mostly:

but will not explain why static IP assignment does not work from Debian


There are certainly workarounds, but I'd rather know what's going on.
deadwax
 
Posts: 14
Joined: 2019-07-22 08:54

Re: Cannot disable dhcp for network interface

Postby L_V » 2019-07-22 11:02

Some DHCP stuff installed ?

Code: Select all
apt-get remove dhcpcd5 isc-dhcp-client isc-dhcp-common
+
Code: Select all
ip a
lsinitramfs /initrd.img | grep network/
L_V
 
Posts: 1032
Joined: 2007-03-19 09:04

Re: Cannot disable dhcp for network interface

Postby reinob » 2019-07-22 12:04

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.
reinob
 
Posts: 699
Joined: 2014-06-30 11:42

Re: Cannot disable dhcp for network interface

Postby wizard10000 » 2019-07-22 13:32

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
User avatar
wizard10000
 
Posts: 51
Joined: 2019-04-16 23:15
Location: southeastern us

Re: Cannot disable dhcp for network interface

Postby trinidad » 2019-07-22 13:48

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.
trinidad
 
Posts: 49
Joined: 2016-08-04 14:58

Re: Cannot disable dhcp for network interface

Postby reinob » 2019-07-22 14:20

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..
reinob
 
Posts: 699
Joined: 2014-06-30 11:42

Re: Cannot disable dhcp for network interface

Postby Head_on_a_Stick » 2019-07-22 17:51

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
User avatar
Head_on_a_Stick
 
Posts: 10321
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Cannot disable dhcp for network interface

Postby deadwax » 2019-07-22 21:55

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...
deadwax
 
Posts: 14
Joined: 2019-07-22 08:54

Re: Cannot disable dhcp for network interface

Postby wizard10000 » 2019-07-23 09:36

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
User avatar
wizard10000
 
Posts: 51
Joined: 2019-04-16 23:15
Location: southeastern us

Re: Cannot disable dhcp for network interface

Postby reinob » 2019-07-23 09:43

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.
reinob
 
Posts: 699
Joined: 2014-06-30 11:42

Re: Cannot disable dhcp for network interface

Postby shep » 2019-07-23 19:24

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/Systemd-networkd#Wired_adapter_using_a_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
shep
 
Posts: 305
Joined: 2011-03-15 15:22

Re: Cannot disable dhcp for network interface

Postby theblueplll » 2019-07-24 01:21

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.
theblueplll
 
Posts: 154
Joined: 2019-04-29 01:17

PreviousNext

Return to System configuration

Who is online

Users browsing this forum: No registered users and 13 guests

fashionable