I am having issues with assigning static DHCP address on a couple of routers, specifically GLiNet MT6000.
The DHCP address get saved but the hostnames are not displayed in the dhcp client list.
Please where can i find a guideline on the allowed parameters and formating of the config/dhcp file responsible for this.
Answer is no, nothing about visualising is in /etc/config/dhcp. Luci would use client-supplied hostname, or one form /etc/ethers.
Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </>
" button:
Remember to redact passwords, MAC addresses and any public IP addresses you may have:
ubus call system board
cat /etc/config/network
cat /etc/config/wireless
cat /etc/config/dhcp
cat /etc/config/firewall
root@GL-MT6000:~# ubus call system board
{
"kernel": "5.4.238",
"hostname": "GL-MT6000",
"system": "ARMv8 Processor rev 4",
"model": "GL.iNet GL-MT6000",
"board_name": "glinet,gl-mt6000",
"release": {
"distribution": "OpenWrt",
"version": "21.02-SNAPSHOT",
"revision": "r15812+1075-46b6ee7ffc",
"target": "mediatek/mt7986",
"description": "OpenWrt 21.02-SNAPSHOT r15812+1075-46b6ee7ffc"
> "kernel": "5.4.238",
> "hostname": "GL-MT6000",
> "system": "ARMv8 Processor rev 4",
> "model": "GL.iNet GL-MT6000",
> "board_name": "glinet,gl-mt6000",
> "release": {
> "distribution": "OpenWrt",
> "version": "21.02-SNAPSHOT",
> "revision": "r15812+1075-46b6ee7ffc",
> "target": "mediatek/mt7986",
> "description": "OpenWrt 21.02-SNAPSHOT r15812+1075-46b6ee7ffc"
root@GL-MT6000:~# cat /etc/config/network
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fdbb:7372:2af6::/48'
option packet_steering '1'
config device
option name 'br-lan'
option type 'bridge'
list ports 'lan1'
list ports 'lan2'
list ports 'lan3'
list ports 'lan4'
list ports 'lan5'
option macaddr '************'
config device
option name 'lan1'
option macaddr '94:********'
config device
option name 'lan2'
option macaddr '94:*********'
config device
option name 'lan3'
option macaddr '94:************'
config device
option name 'lan4'
option macaddr '************'
config device
option name 'lan5'
option macaddr '94:*********'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.30.1'
option netmask '255.255.255.0'
option ip6assign '60'
option isolate '0'
config device
option name 'eth1'
option macaddr '94:*************'
config interface 'wan'
option device 'eth1'
option proto 'dhcp'
option force_link '0'
option ipv6 '0'
option metric '10'
option classlessroute '0'
config interface 'wan6'
option proto 'dhcpv6'
option disabled '1'
option device '@wan'
config interface 'tethering6'
option proto 'dhcpv6'
option disabled '1'
option device '@tethering'
config interface 'wwan6'
option proto 'dhcpv6'
option disabled '1'
option device '@wwan'
config interface 'guest'
option force_link '1'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.9.1'
option netmask '255.255.255.0'
option ip6assign '60'
option multicast_querier '1'
option igmp_snooping '0'
option isolate '0'
option bridge_empty '1'
option disabled '1'
config interface 'wwan'
option proto 'dhcp'
option metric '20'
option classlessroute '0'
config interface 'secondwan'
option ipv6 '0'
option proto 'dhcp'
option metric '15'
option force_link '0'
option classlessroute '0'
config interface 'secondwan6'
option proto 'dhcpv6'
option disabled '1'
option metric '15'
option device '@secondwan'
config interface 'modem_1_1_2_6'
option proto 'dhcpv6'
option disabled '1'
option device '@modem_1_1_2'
config rule 'policy_direct_rt'
option lookup 'main'
option suppress_prefixlength '0'
option priority '1100'
config rule 'policy_default_rt_vpn'
option mark '0x8000/0xc000'
option lookup '8000'
option priority '1101'
option invert '1'
config rule6 'policy_direct_rt6'
option lookup 'main'
option suppress_prefixlength '0'
option priority '1100'
config rule6 'policy_default_rt_vpn6'
option mark '0x8000/0xc000'
option lookup '8000'
option priority '1101'
option invert '1'
config rule 'policy_default_rt_vpn_ts'
option lookup 'main'
option priority '1099'
option mark '0x80000/0xc0000'
option invert '0'
root@GL-MT6000:~#
config wifi-device 'mt798611'
option channel 'auto'
option band '2g'
option htmode 'HE40'
option disabled '0'
option country 'US'
option legacy_rates '1'
option hwmode '11g'
option type 'mtk'
option txpower '100'
option random_bssid '1'
config wifi-iface 'wifi2g'
option device 'mt798611'
option network 'lan'
option mode 'ap'
option encryption 'psk-mixed'
option key '*****************'
option wds '1'
option isolate '0'
option hidden '0'
option ifname 'ra0'
option ssid 'E****************'
option macaddr '******************'
config wifi-device 'mt798612'
option channel 'auto'
option band '5g'
option htmode 'HE80'
option disabled '0'
option country 'US'
option legacy_rates '0'
option hwmode '11a'
option type 'mtk'
option txpower '100'
option random_bssid '1'
config wifi-iface 'wifi5g'
option device 'mt798612'
option network 'lan'
option mode 'ap'
option encryption 'psk-mixed'
option key '*******************'
option wds '1'
option isolate '0'
option hidden '0'
option ifname 'rax0'
option ssid '*********************'
option macaddr '*************'
config wifi-iface 'guest2g'
option device 'mt798611'
option network 'guest'
option mode 'ap'
option encryption 'psk2'
option key '++++++++++++'
option ssid 'G-Guest'
option guest '1'
option disabled '1'
option wds '1'
option isolate '1'
option ifname 'ra1'
option macaddr '******************'
config wifi-iface 'guest5g'
option device 'mt798612'
option network 'guest'
option mode 'ap'
option encryption 'psk2'
option key '++++++++++'
option ssid '++++++++++++++++++'
option guest '1'
option disabled '1'
option wds '1'
option isolate '1'
option ifname 'rax1'
option macaddr '+++++++++++++++'
You are using glinet firmware and should call them.
root@GL-MT6000:~# cat /etc/config/dhcp
config dnsmasq
option domainneeded '1'
option localise_queries '1'
option rebind_protection '0'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
option cachesize '1000'
option authoritative '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
option localservice '1'
option ednspacket_max '1232'
option filter_aaaa '0'
option filter_a '0'
config dhcp 'lan'
option interface 'lan'
option start '225'
option limit '30'
option dhcpv4 'server'
option dhcpv6 'disabled'
option ra 'disabled'
option ra_slaac '1'
option force '1'
option ignore '0'
option leasetime '2m'
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'
config domain
option name '+++++++++++++++.com'
option ip '192.++++++.1'
config domain
option name '+++++++++t.com'
option ip '::ffff:192.++++++.1'
config dhcp 'guest'
option interface 'guest'
option start '100'
option limit '150'
option leasetime '12h'
option dhcpv6 'disabled'
option ra 'disabled'
config dhcp 'secondwan'
option interface 'secondwan'
option ignore '1'
config host
option mac '+++'
option ip '192.168.++++'
option tag '101SR8162065'
config host
option mac '0++++++'
option ip '192.168.30.91'
option tag '104KC8162071'
config host
option mac '00:0B:82:83:FE:E1'
option ip '192.++++2'
option tag '102SR28309547'
config host
option mac '++++++++++++'
option ip '192.++++++++++'
option dns '1'
option tag '103GXV3M'
config host
option mac '9++++++++'
option ip '192.+++++'
option tag 'CanonG6040LAN'
config host
option mac '+++++++++++++'
option ip '192.+++++++++'
option tag 'CanonG6040WirelessDirect'
config host
option mac '+++++++++++++'
option ip '192.++++++++++++'
option tag 'ZBTWE13264GRouter24G'
It appears you are using firmware that is not from the official OpenWrt project.
When using forks/offshoots/vendor-specific builds that are "based on OpenWrt", there may be many differences compared to the official versions (hosted by OpenWrt.org). Some of these customizations may fundamentally change the way that OpenWrt works. You might need help from people with specific/specialized knowledge about the firmware you are using, so it is possible that advice you get here may not be useful.
You may find that the best options are:
- Install an official version of OpenWrt, if your device is supported (see https://firmware-selector.openwrt.org).
- Ask for help from the maintainer(s) or user community of the specific firmware that you are using.
- Provide the source code for the firmware so that users on this forum can understand how your firmware works (OpenWrt forum users are volunteers, so somebody might look at the code if they have time and are interested in your issue).
If you believe that this specific issue is common to generic/official OpenWrt and/or the maintainers of your build have indicated as such, please feel free to clarify.
The desired hostnames belong in the "name" option (the topmost "Hostname" field in LuCI), not in the "tag" option.
Thanks,Ii've realised this, i needed a list of parameters that dhcp accepts so i can better understand.
my router strips off the name option at some point, i dont know why or how, im investigating that as well.
summary, refering specificaly to the config host option, I've seen the parameters: mac, ip, name, tag
what are the other parameters available and what do they do?
thanks,
just looking to understand the parameters required by dhcp protocol/servers
https://openwrt.org/docs/guide-user/base-system/dhcp
and more specifically for static leases
https://openwrt.org/docs/guide-user/base-system/dhcp#static_leases
Much appreciated.
the "tag" and "name" options seems similar to me, pls what is the difference and which takes priority when a router displays the dhcp client list
They are not related at all.
"name", as the name names, names the host. It's the host's name, the hostname.
"tag" is a marker that can apply to multiple hosts, allowing you to set dhcp options for a subset of hosts by tagging them:
config host
option name 'j500'
option mac '01:22:64:76:bb:18'
option ip '10.11.12.15'
option tag 'vpn' # assign tag "vpn" to this host
config tag 'vpn' # match tag "vpn"
list dhcp_option '6,8.8.8.8,8.8.4.4' # assign arbitrary extra dhcp options to this tag
thank you again,
how can i bulk add static ip addresses to a router?
presently I use sftp to edit the dhcp file, replacing the host sections with pre-populated data.
is there a better way of doing this?
Not that I'm aware of. Which is as many caveats as you can fit into six words.
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.