DHCP server configuration & option to disable it

I would like to ask how to disable DHCP server from Openwrt, edit some settings, such as range of IPs in Luci. Also, where is the option to completely disable DHCP server in Luci, please?

Network-> Interfaces -> Edit the interface -> DHCP Server Tab
Start is the first IP it will allocate
Limit is the number of IPs it will allocate.
Start 100 and limit 9 means it will start giving .100 and will give until .108

Network-> Interfaces -> Edit the interface -> DHCP Server Tab-> General Setup tab -> Ignore interface
Network-> Interfaces -> Edit the interface -> DHCP Server Tab-> IPv6 Settings -> Select Disabled at the drop down list for Router Advertisements, DHCPv6 and NDP

2 Likes

even though i checked the flag to ignore the interface, it keeps advertising IPs


As it can be seen the NIC of Windows is on DHCP and the OpenWRT has the ignore interface flag enabled. Am i doing something wrong?

So this thread is not solved. How do i remove the solution flag, please?

1 Like

Is there a way to disable it manually from the CLI, if Luci fails, please?

Are you sure that this lease was not active before you turned off dhcp?
If yes, then use ssh to connect to the device.
Then run the following commands (copy-paste the whole block) and paste the output here, using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have

ubus call system board; \
uci export network; uci export dhcp; \
ip -4 addr ; ip -6 addr; netstat -anp | grep 67
1 Like
root@OpenWrt:~# ubus call system board; \
> uci export network; uci export dhcp; \
> ip -4 addr ; ip -6 addr; netstat -anp | grep 67
{
        "kernel": "4.14.221",
        "hostname": "OpenWrt",
        "system": "Geode(TM) Integrated Processor by AMD PCS",
        "release": {
                "distribution": "OpenWrt",
                "version": "19.07.7",
                "revision": "r11306-c4a6851c72",
                "target": "x86/geode",
                "description": "OpenWrt 19.07.7 r11306-c4a6851c72"
        }
}
package network

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd33:fdgsdf:sdfsdv::/48'

config interface 'lan'
        option type 'bridge'
        option ifname 'eth0'
        option proto 'static'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option ipaddr '192.168.164.3'

config interface 'wan'
        option ifname 'eth1'
        option proto 'pppoe'
        option password 'xdsl'
        option ipv6 'auto'
        option username 'isp@xdsl.com'

config interface 'Wan2'
        option ifname 'eth2'
        option proto 'dhcp'

package dhcp

config dnsmasq
        option domainneeded '1'
        option boguspriv '1'
        option filterwin2k '0'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option nonegcache '0'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.auto'
        option nonwildcard '1'
        option localservice '1'

config dhcp 'lan'
        option interface 'lan'
        option ignore '1'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'
        option loglevel '4'

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP qlen 1000
    inet 192.168.177.140/24 brd 192.168.177.255 scope global eth2
       valid_lft forever preferred_lft forever
6: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    inet 192.168.164.3/24 brd 192.168.164.255 scope global br-lan
       valid_lft forever preferred_lft forever
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 state UNKNOWN qlen 1000
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
    inet6 fe80::20d:b9ff:fe2a:3ffa/64 scope link
       valid_lft forever preferred_lft forever
6: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
    inet6 fd33:99bc:127a::1/60 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::20d:b9ff:fe2a:3ff8/64 scope link
       valid_lft forever preferred_lft forever
unix  2      [ ]         DGRAM                      1011 1167/netifd
unix  3      [ ]         STREAM     CONNECTED       1013 1167/netifd
unix  2      [ ]         DGRAM                      1259 1167/netifd
root@OpenWrt:~#



After a couple of reboots it does not send IPs any more. Seems to work now

These were leases already allocated before configuring to ignore an interface.

1 Like

I had the laptop rebooted and the router as well, after turning dhcp off. How come stayed available? Also it was solved after two reboots.
Anyhow, now it is solved

Reboot is one thing, power off and wait 30s is another. Power off is a big problem solver and probably the quickest in these cases.

Do power off EVERYTHING at the same time and not one by one.

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.