OpenWrt/LEDE DHCP IP issue

Dear,
All experts I am facing issue with OpenWRT/LEDE DHCP IP issue, I am unable to get DHCP IP, if I set static IP its worked fine but when I try to use DHCP it's not working I followed below solution but not working, please help me if anyone knows, T.I.A

It would be useful to know more information about your setup. Is this a stock configuration or have you made any significant changes to the setup? Are you able to simply reset the router to the defaults to see if that solves the problem? Otherwise, please post the contents of the following files:
/etc/config/network
/etc/config/dhcp
/etc/config/firewall

EDIT: Also, information about your network in general could be useful if this is anything more than a relatively simple/basic network. Finally, you mention LEDE -- if you're still using LEDE, you should consider upgrading to the newest stable OpenWRT release (18.06.1), assuming your device is supported.

And also what kind of devices you have tried to connect. I think there's a problem with Xbox and DHCP.

cat /etc/config/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 'fd9c:3eb1:9c82::/48'

config interface 'lan'
        option type 'bridge'
        option ifname 'eth1'
        option proto 'static'
        option ipaddr '192.168.102.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config interface 'wan'
        option ifname 'eth0'
        option proto 'dhcp'
        option type 'bridge'

config interface 'vpn'
        option ifname 'tun0'
        option defaultroute '0'
        option peerdns '0'
        option proto 'none'

config interface 'wan6'
        option ifname 'eth0'
        option proto 'dhcpv6'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '0 1 2 3 4'

config interface 'ArminWifi'
        option proto 'dhcp'

config interface 'OviJatree'
        option proto 'dhcp'

cat /etc/config/dhcp

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

cat /etc/config/firewall

config defaults
        option syn_flood '1'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'REJECT'

config zone
        option name 'lan'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'
        option network 'lan'

config zone
        option name 'wan'
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option masq '1'
        option mtu_fix '1'
        option network 'wan wan6 ArminWifi OviJatree'

config zone
        option name 'vpn'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'
        option masq '1'
        option network 'vpn'

config forwarding
        option src 'lan'
        option dest 'wan'

config rule
        option name 'Allow-DHCP-Renew'
        option src 'wan'
        option proto 'udp'
        option dest_port '68'
        option target 'ACCEPT'
        option family 'ipv4'

config rule
        option name 'Allow-Ping'
        option src 'wan'
        option proto 'icmp'
        option icmp_type 'echo-request'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-IGMP'
        option src 'wan'
        option proto 'igmp'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-DHCPv6'
        option src 'wan'
        option proto 'udp'
        option src_ip 'fc00::/6'
        option dest_ip 'fc00::/6'
        option dest_port '546'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-MLD'
        option src 'wan'
        option proto 'icmp'
        option src_ip 'fe80::/10'
        list icmp_type '130/0'
        list icmp_type '131/0'
        list icmp_type '132/0'
        list icmp_type '143/0'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Input'
        option src 'wan'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        list icmp_type 'router-solicitation'
        list icmp_type 'neighbour-solicitation'
        list icmp_type 'router-advertisement'
        list icmp_type 'neighbour-advertisement'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Forward'
        option src 'wan'
        option dest '*'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-IPSec-ESP'
        option src 'wan'
        option dest 'lan'
        option proto 'esp'
        option target 'ACCEPT'

config rule
        option name 'Allow-ISAKMP'
        option src 'wan'
        option dest 'lan'
        option dest_port '500'
        option proto 'udp'
        option target 'ACCEPT'

config include
        option path '/etc/firewall.user'

Your DHCP config file is almost empty... how did it end like that?

by default is like that I haven't touch it... & then I try by following link but no luck

This might be a better guide

https://openwrt.org/docs/guide-user/base-system/dhcp_configuration

Which version of OpenWrt are you using, and how did you obtain it? What kind of device are you using? It seems like something must have gone wrong for your dhcp file to contain only those lines.

I agree with all of the other people on this thread that things don't look right. I would highly recommend a fresh flash, or at the very least a factory reset. As previously asked -- what is the device and how did you obtain it? Did you flash OpenWRT onto this device yourself, or did it arrive with OpenWRT installed? If you did it yourself, did you install an official release of OpenWRT or did you find another build somewhere (keep in mind that random builds from other sources could have customized settings that don't meet your needs)? If the device came with it pre-installed, did you at least perform a full reset to defaults?

Aside from the fact that wireless is disabled by default (and there is no admin password set) on a fresh install/reset of OpenWRT, the default configuration of the system is such that it will work as a fully functioning router for most devices and user environments. I would recommend that you make sure you're running the latest possible official OpenWRT version (or LEDE if you have a device not supported by the newest version). Get the system up and running and make sure it generally functions. Then, if you need to make custom changes to things like the DHCP server or other parts of the system, do those systematically so you can find where things go wrong. You can, of course, ask for specific help here -- we just need to know what you're running and what you goals are.

BTW, the true default files (the ones that would be restored when you reset to defaults) can be found in /rom/ - these are the default files for whatever build you have installed.

So in this case, take a look at the /rom/etc/config/dhcp file and see if it matches what you posted earlier. If not, your DHCP is most certainly not the default, either because it was previously edited or something went wrong when you were making changes.

But like I said earlier, your best bet would be to start completely fresh if it is at all possible (flash the latest version and be sure not to keep the previous settings).

I followed your guide & succeed thanks a lot & sorry for late replay....

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