Send dhcp-users mailing list submissions to dhcp-users@lists.isc.org
To subscribe or unsubscribe via the World Wide Web, visit https://lists.isc.org/mailman/listinfo/dhcp-users or, via email, send a message with subject or body 'help' to dhcp-users-requ...@lists.isc.org You can reach the person managing the list at dhcp-users-ow...@lists.isc.org When replying, please edit your Subject line so it is more specific than "Re: Contents of dhcp-users digest..." Today's Topics: 1. Re: Option 82 Sub-option 5 (glenn.satch...@uniq.com.au) ---------------------------------------------------------------------- Message: 1 Date: Sun, 20 Jun 2021 17:16:06 +1000 From: glenn.satch...@uniq.com.au To: Users of ISC DHCP <dhcp-users@lists.isc.org> Subject: Re: Option 82 Sub-option 5 Message-ID: <9907363cae6fb22b972910d86c35a...@uniq.com.au> Content-Type: text/plain; charset=UTF-8; format=flowed On 2021-06-18 20:37, Simon Hobson wrote: > Kraishak Mahtha <kraishak....@gmail.com> wrote: >> >> Hi All, >> >> I have been trying to understand the option 82 sub option 5 >> (agent.link-selection) working prototype, I have been searching in the >> forums and many of them suggest as below >> >> class "BD-1Net" { match if(binary-to-ascii(10, 8, ".", option >> agent.link-selection) = "192.168.1.0"); } >> >> shared-network BD-1Net >> { >> subnet 192.168.1.0 netmask 255.255.255.0 >> { >> option routers 192.168.1.1; >> option subnet-mask 255.255.255.0; >> pool { >> allow members of "BD-1Net"; >> range 192.168.1.101 192.168.1.110; >> } >> } >> } >> I have a doubt of why to add a shared-network line statement in the >> config though it has only one subnet, Is it mandatory to add that >> shared-network statement? >> I tried testing without adding the shared-network statement line and >> it works fine, but before I use in my prod I want to know full >> details, > > Yes, if there is only one subnet then the shared-network is optional. > AFAIK in this situation it will provide no additional features. > > BTW - it's not necessary to use binary-to-ascii, you can (I think) > compare the raw data : > match if( option agent.link-selection = 0xc0a80100 ); > which is less processing though less readable. > > Simon According to the dhcp-eval man page, string representation can be one of two forms: string A string, enclosed in quotes, may be specified as a data expression, and returns the text between the quotes, encoded in ASCII. The backslash ('\') character is treated specially, as in C pro? gramming: '\t' means TAB, '\r' means carriage return, '\n' means newline, and '\b' means bell. Any octal value can be specified with '\nnn', where nnn is any positive octal number less than 0400. Any hexadecimal value can be specified with '\xnn', where nn is any positive hexadecimal number less than or equal to 0xff. colon-separated hexadecimal list A list of hexadecimal octet values, separated by colons, may be specified as a data expression. In this case you could use this format to compare the raw data: match if ( option agent.link-selection = c0:a8:01:00 ); Although I also think "\xc0\xa8\x01\x00" would work but this is definitely harder to read :) Personally,unless you have thousands of things trying to match the string, the binary-to-ascii() method you're using seems the easiest to read. regards, Glenn ------------------------------ Subject: Digest Footer _______________________________________________ ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information. dhcp-users mailing list dhcp-users@lists.isc.org https://lists.isc.org/mailman/listinfo/dhcp-users ------------------------------ End of dhcp-users Digest, Vol 152, Issue 9 ******************************************