opnsense / core

OPNsense GUI, API and systems backend
https://opnsense.org/
BSD 2-Clause "Simplified" License
3.31k stars 738 forks source link

dhcp: vendor-classes #4385

Closed knxuf closed 3 years ago

knxuf commented 4 years ago

Before you add a new report, we ask you kindly to acknowledge the following:

[X] I have read the contributing guide lines at https://github.com/opnsense/core/blob/master/CONTRIBUTING.md

[X] I have searched the existing issues and I'm convinced that mine is new.

Is your feature request related to a problem? Please describe. I want to migrate from sophos UTM which support this feature Needed for VoIP phones to get VLAN https://wiki.innovaphone.com/index.php?title=Reference:DHCP_client

Describe the solution you'd like Add vendor-classes to dhcpv4 Add menu to define vendor class and display them under Additional Options

Describe alternatives you've considered

Additional context

meisterjuergen commented 3 years ago

I realy need to add some Vendor Classes to my VoIP Net, to give the DLS Server and other Stuff to my phone-clients. The solution in a windows DHCP Server is described in the following URL: https://wiki.unify.com/wiki/Configuring_the_DHCP_Server_for_DLS To solute this on a linux Server it looks like that: VLAN 204 LAB_Switch subnet 10.204.204.0 netmask 255.255.255.0 { range 10.204.204.100 10.204.204.199; option domain-name "lab.flomain.local"; option broadcast-address 10.204.204.255; option subnet-mask 255.255.255.0; option routers 10.204.204.1; subclass "Vendor-Class" "HPE. HPE 1920-24G-PoE+ (370W) Switch" { option tftp-server-name "10.104.104.10"; option bootfile-name "comware_config.cfg"; } subclass "Vendor-Class" "Aruba JL259A 2930F-24G-4SFP Switch dslforum.org" { option tftp-server-name "10.104.104.10"; option bootfile-name "arubaos_config.cfg"; } } This core is from: https://www.flomain.de/2019/05/dhcp-vendor-class-identifier-dhcp-option-60/

marjohn56 commented 3 years ago

If this is for the dhcp server on your LAN side then go into Services -> DHCPv4->LAN->Additiona Options.

meisterjuergen commented 3 years ago

If this is for the dhcp server on your LAN side then go into Services -> DHCPv4->LAN->Additiona Options.

But there i can only add entrys like numerber and value, but i need to add something like subclass "Vendor-Class" "Aruba JL259A 2930F-24G-4SFP Switch dslforum.org" { option tftp-server-name "10.104.104.10"; option bootfile-name "arubaos_config.cfg"; } this is not possible in Additional Options

meisterjuergen commented 3 years ago

If this is for the dhcp server on your LAN side then go into Services -> DHCPv4->LAN->Additiona Options.

But there i can only add entrys like numerber and value, but i need to add something like subclass "Vendor-Class" "Aruba JL259A 2930F-24G-4SFP Switch dslforum.org" { option tftp-server-name "10.104.104.10"; option bootfile-name "arubaos_config.cfg"; } this is not possible in Additional Options

it would bee perfect if there is a Textfield which i can put my own code inside and this will be generated in the config file.

marjohn56 commented 3 years ago

The Vendor class is a number, you enter the nunber, vendor class is 60. Then the identifier which is your string "Aruba JL259A 2930F-24G-4SFP Switch dslforum.org" you enter into value. Leave the Type as Text.

Add a new option for the TFTP server, Option 66 is tftp server, so enter the server address in the value field.

Add a new option for the filename. Option 67 is bootfile. Enter the name of the bootfile.

Done.

meisterjuergen commented 3 years ago

The Vendor class is a number, you enter the nunber, vendor class is 60. Then the identifier which is your string "Aruba JL259A 2930F-24G-4SFP Switch dslforum.org" you enter into value. Leave the Type as Text.

Add a new option for the TFTP server, Option 66 is tftp server, so enter the server address in the value field.

Add a new option for the filename. Option 67 is bootfile. Enter the name of the bootfile.

Done.

Hi, thank you, but the configuration above was just an example. In my case i need to give some values to the ip voip clients from Siemens/Unify, and only to them.

In detail i need to give the values 03: "sdlp://10.103.210.200:18443" to the phones where the manufactor 01 is "Siemens"

The Siemens/Unify Documentation https://wiki.unify.com/images/4/4d/Deployment-Service_V7_de.pdf gives me on page 146 and 147 the solution for a Linux DHCP which looks like this with my entrys:

`class “OptiIpPhone” { option vendor-encapsulated-options 01:07:53:69:65:6D:65:6E:73: 03:1A:73:64:6C:70:3A:2F:2F:31:30:2E:31:30:33:2E:32:31:30:2E:32:30:30:3A:31:38:34:34:33; match if substring (option vendor-class-identifier, 0, 11) = “OptiIpPhone”;

}`

The description of the code as far as i understood:

line 1 the name here is choosable, i took it from the documentation line 2 which dhcp option is this? 43 or 60 oder? line 3 this is hex code, fist is dhcp option 01, second is the lenght of the hex (7), the 7 hex entris is the manufacor name "Siemens" in ASCII line 4 this is hex code, fist ist dhcp opton 03, second is the lenght oft the hex(26 decimal or 1A hex), the 26 hex entries is "sdlp://10.103.210.200:18443" in ASCII line 5 connects the the above values to the manufactor and the name is that from line 1, about 0, 11 im not sure, may is 11 the lenght of the name 'OptiIpPhone' and 0 the class number?

My problem is how to do this in opnsense, especially the options 01 (normally subnetmas) and 03 (normally router) wich ar only for the "Siemens" phones???

marjohn56 commented 3 years ago

if you just google vendor-encapsulated-options you'll see it's 43.

Github is for bug reporting, this is not a bug; Can you post this question on the forum please.

OPNsense-bot commented 3 years ago

This issue has been automatically timed-out (after 180 days of inactivity).

For more information about the policies for this repository, please read https://github.com/opnsense/core/blob/master/CONTRIBUTING.md for further details.

If someone wants to step up and work on this issue, just let us know, so we can reopen the issue and assign an owner to it.