On 2021-05-06, Radek <r...@int.pl> wrote: > Hello, > I want to use dhcpd server to push Wireless Controller's IP address to the > APs. > > According to this: > http://systemnetworksecurity.blogspot.com/2013/02/adding-custom-options-in-isc-dhcpds.html > https://www.secuvera.de/blog/capwap-dhcp-option-138-auf-isc-dhcpd-server-einrichten/ > I need to add *option capwap* to /etc/dhcpd.conf > > option capwap code 138 = ip-address; #Custom Option capwap > option capwap 192.168.1.110; #WLAN-Controller-IP > > I can't find the capwap option in dhcp-options(5) i OpenBSD. > How can I do what I need using other options/configuration? > Thanks!
It's a proper RFC protocol so we could add it to dhcpd. Possible diff below, maybe it should be moved to the named part of dhcp_option_default_priority too but there are other named options which aren't listed so I've left that out for now. CAPWAP is RFC5415, the DHCP option is defined in RFC5417. Index: dhcp-options.5 =================================================================== RCS file: /cvs/src/usr.sbin/dhcpd/dhcp-options.5,v retrieving revision 1.31 diff -u -p -r1.31 dhcp-options.5 --- dhcp-options.5 8 May 2019 22:00:55 -0000 1.31 +++ dhcp-options.5 7 May 2021 08:38:48 -0000 @@ -169,6 +169,13 @@ Some DHCP clients will support it, and o This option specifies the broadcast address in use on the client's subnet. Legal values for broadcast addresses are specified in section 3.2.1.3 of RFC 1122. +.It Ic option capwap-ac Ar ip-address Oo , Ar ip-address ... Oc ; +The +.Ic capwap-ac +option specifies a list of IP addresses of Wireless Access Controllers. +These are used by Wireless Termination Points using the Control And +Provisioning of Wireless Access Points (CAPWAP) protocol, RFC 5415. +Addresses should be listed in order of preference. .It Ic option classless-static-routes Ar cidr ip-address Oo , Ar cidr ip-address ... Oc ; This option specifies a list of destination networks and the associated gateways. Index: dhcp.h =================================================================== RCS file: /cvs/src/usr.sbin/dhcpd/dhcp.h,v retrieving revision 1.11 diff -u -p -r1.11 dhcp.h --- dhcp.h 8 May 2019 22:00:55 -0000 1.11 +++ dhcp.h 7 May 2021 08:38:48 -0000 @@ -173,6 +173,7 @@ struct dhcp_packet { #define DHO_NDS_CONTEXT 87 #define DHO_DOMAIN_SEARCH 119 #define DHO_CLASSLESS_STATIC_ROUTES 121 +#define DHO_CAPWAP_AC 138 #define DHO_TFTP_CONFIG_FILE 144 #define DHO_VOIP_CONFIGURATION_SERVER 150 #define DHO_CLASSLESS_MS_STATIC_ROUTES 249 Index: tables.c =================================================================== RCS file: /cvs/src/usr.sbin/dhcpd/tables.c,v retrieving revision 1.14 diff -u -p -r1.14 tables.c --- tables.c 8 May 2019 22:00:55 -0000 1.14 +++ tables.c 7 May 2021 08:38:48 -0000 @@ -214,7 +214,7 @@ struct option dhcp_options[256] = { { "option-135", "X", &dhcp_universe, 135 }, { "option-136", "X", &dhcp_universe, 136 }, { "option-137", "X", &dhcp_universe, 137 }, - { "option-138", "X", &dhcp_universe, 138 }, + { "capwap-ac", "lA", &dhcp_universe, 138 }, { "option-139", "X", &dhcp_universe, 139 }, { "option-140", "X", &dhcp_universe, 140 }, { "option-141", "X", &dhcp_universe, 141 }, @@ -404,6 +404,8 @@ unsigned char dhcp_option_default_priori DHO_NETBIOS_SCOPE, DHO_FONT_SERVERS, DHO_X_DISPLAY_MANAGER, + DHO_CAPWAP_AC, + DHO_VOIP_CONFIGURATION_SERVER, DHO_DHCP_PARAMETER_REQUEST_LIST, DHO_DHCP_USER_CLASS_ID, DHO_RELAY_AGENT_INFORMATION, /* Should be the last option. */ @@ -417,9 +419,9 @@ unsigned char dhcp_option_default_priori 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 130, 131, 132, 133, 134, 135, 136, 137, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189,