Home / Community / Blog / Gargoyle / OpenWRT change WPAD address - dhcp_option using UCI commands

Gargoyle / OpenWRT change WPAD address - dhcp_option using UCI commands

My router configuration was:

root@gargoyle:~# uci show dhcp.lan.dhcp_option
dhcp.lan.dhcp_option='252,http://wpad/wpad.dat' '6,192.168.1.28,192.168.1.4'

I would like to change WPAD address (option 252) to wpad.lan so I've to remove (del_list) old entry and add (add_list) new one:

root@gargoyle:~# uci del_list dhcp.lan.dhcp_option='252,http://wpad/wpad.dat'
root@gargoyle:~# uci add_list dhcp.lan.dhcp_option='252,http://wpad.lan/wpad.dat'

check, if everything is correct:

root@gargoyle:~# uci show dhcp.lan.dhcp_option
dhcp.lan.dhcp_option='6,192.168.1.28,192.168.1.4' '252,http://wpad.lan/wpad.dat'

now, You can commit changes (write to /etc/config/dhcp file) and restart dnsmasq daemon:

root@gargoyle:~# uci commit dhcp
root@gargoyle:~# /etc/init.d/dnsmasq restart

On client you can check again using nmap command:

[root@Optiplex745 ~]# nmap --script broadcast-dhcp-discover -e enp3s0
Starting Nmap 7.70 ( https://nmap.org ) at 2021-03-17 22:42 CET
Pre-scan script results:
| broadcast-dhcp-discover:
|   Response 1 of 1:
|     IP Offered: 192.168.1.249
|     DHCP Message Type: DHCPOFFER
|     Server Identifier: 192.168.1.4
|     IP Address Lease Time: 2m00s
|     Bootfile Name: undionly.kpxe\x00
|     Renewal Time Value: 1m00s
|     Rebinding Time Value: 1m45s
|     Subnet Mask: 255.255.255.0
|     Broadcast Address: 192.168.1.255
|     Router: 192.168.1.4
|     Domain Name: lan
|     WPAD: http://wpad.lan/wpad.dat
|_    Domain Name Server: 192.168.1.28, 192.168.1.4
WARNING: No targets were specified, so 0 hosts scanned.
Nmap done: 0 IP addresses (0 hosts up) scanned in 3.85 seconds

Comments

Log in or create a user account to comment.

Just my blog...

Mon Tue Wed Thu Fri Sat Sun
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31