Community discussions

MikroTik App
 
blazej222
just joined
Topic Author
Posts: 1
Joined: Tue May 25, 2021 4:37 pm

Vendor-class-id replaced with generic option matcher - How to PXE boot?

Tue Aug 09, 2022 2:50 pm

Hello. I want to run PXE server in my local network and setup the router's DHCP server to serve different files according to client's PXE architecture string (example: EFI32 receives boot.e32, EFI64 receives boot.e64, legacy bios receives boot.bios).
Until 7.4 it was possible by creating vendor-class-id rule with custom option set.
# [admin@v7] /ip/dhcp-server/vendor-class-id> add 
Creates new item with specified property values.

address-pool -- pool used for this vendor-class-id
copy-from -- Item number
disabled -- Defines whether item is ignored or used
name -- 
option-set -- 
vid -- contents of vendor-class-id as string or hex with 0x prefix
In changelog for version 7.4 we can read
dhcp-server - change "vendor-class-id" matcher to generic option matcher;
Is it possible to replicate this exact behavior on versions 7.4+? I don't really understand how to use this new option matcher, because what I think it does is it simply allows to select a dhcp server/address pool according to dhcp client option 93 (or other option), but doesn't allow specifying dhcp option sets to be sent back to the client.
 
deramirez
just joined
Posts: 3
Joined: Sat Sep 10, 2022 5:47 pm

Re: Vendor-class-id replaced with generic option matcher - How to PXE boot?

Sat Sep 10, 2022 6:00 pm

same problem. can't find any documentation for new matcher.

looks like option matcher works with limited range dhcp options.
in dhcp debug, option 93 displayed as "Unknown(93)":
default received request id 3471760989 from 0.0.0.0 ''
    flags = broadcast
    ciaddr = 0.0.0.0
    chaddr = 08:00:27:2B:77:C2	
    Address-Request = 192.168.88.174
    Msg-Type = request
    Server-Id = 192.168.88.1
	Parameter-List = Subnet-Mask,Unknown(2),Router,Unknown(4),Unknown(5),Domain-Server,Host-Name,Unknown(13),Domain-Name,Unknown(17),Unknown(18),Unknown(22),Unknown(23),Broadcast-Address,Unknown(40),Unknown(41),NTP-Server,Vendor-Specific,Address-Request,Address-Time,Server-Id,Renewal-Time,Rebinding-Time,Class-Id,Unknown(66),Unknown(67),Unknown(97),Unknown(128),Unknown(129),Unknown(130),Unknown(131),Unknown(132),Unknown(133),Unknown(134),Unknown(135)
	Max-DHCP-Message-Size = 65280
    Class-Id = "PXEClient:Arch:00007:UNDI:003000"
    Unknown(93) = 00-07
    Unknown(94) = 01-03-00
    Unknown(97) = 00-25-E8-E7-ED-FD-93-2A-4D-B4-94-E1-78-81-1F-C1-06
If i use matcher with option 60 (Class-Id) it works as expected
But with option 93 (Unknown) matcher wont work.
 
deramirez
just joined
Posts: 3
Joined: Sat Sep 10, 2022 5:47 pm

Re: Vendor-class-id replaced with generic option matcher - How to PXE boot?

Sun Sep 11, 2022 12:32 am

matcher with option 93 works if value is HEX
to catch arch uefi64: value = 0x0007

for example, i can assign specific pool to uefi64 clients (with option 93 = 0x0007) and its works as expected.
but assigning specific option set to this matcher (with specific bootfile name) has no effect.
[admin@MikroTik] /ip/dhcp-server/matcher> print detail 
 1   name="arch-uefi64" address-pool=uefi option-set=arch-uefi64-default code=93 value="0x0007" 
 2   name="arch-uefi32" address-pool=dhcp option-set=arch-uefi32-default code=93 value="0x0006" 
 
 [admin@MikroTik] /ip/dhcp-server/option/sets> print detail
 0 name="arch-uefi64-default" options=boot-uefi64
 1 name="arch-uefi32-default" options=boot-uefi32
 2 name="arch-bios-default" options=boot-bios

[admin@MikroTik] /ip/dhcp-server/option> print detail
 4 name="boot-bios" code=67 value="'ipxe.pxe'" raw-value="697078652e707865" 
 5 name="boot-uefi32" code=67 value="'ipxe.efi'" raw-value="697078652e656669" 
 6 name="boot-uefi64" code=67 value="'ipxe64.efi'" raw-value="6970786536342e656669" 

 
Fritti
just joined
Posts: 3
Joined: Tue Jul 27, 2021 9:58 pm

Re: Vendor-class-id replaced with generic option matcher - How to PXE boot?

Sat Sep 24, 2022 12:29 pm

It seems something in the matcher is going to be fixed in 7.6, see viewtopic.php?t=188907#p958429 .
 
ormandj
just joined
Posts: 18
Joined: Tue Jun 15, 2021 12:25 am

Re: Vendor-class-id replaced with generic option matcher - How to PXE boot?

Wed Oct 12, 2022 5:29 am

matcher with option 93 works if value is HEX
to catch arch uefi64: value = 0x0007

for example, i can assign specific pool to uefi64 clients (with option 93 = 0x0007) and its works as expected.
but assigning specific option set to this matcher (with specific bootfile name) has no effect.
[admin@MikroTik] /ip/dhcp-server/matcher> print detail 
 1   name="arch-uefi64" address-pool=uefi option-set=arch-uefi64-default code=93 value="0x0007" 
 2   name="arch-uefi32" address-pool=dhcp option-set=arch-uefi32-default code=93 value="0x0006" 
 
 [admin@MikroTik] /ip/dhcp-server/option/sets> print detail
 0 name="arch-uefi64-default" options=boot-uefi64
 1 name="arch-uefi32-default" options=boot-uefi32
 2 name="arch-bios-default" options=boot-bios

[admin@MikroTik] /ip/dhcp-server/option> print detail
 4 name="boot-bios" code=67 value="'ipxe.pxe'" raw-value="697078652e707865" 
 5 name="boot-uefi32" code=67 value="'ipxe.efi'" raw-value="697078652e656669" 
 6 name="boot-uefi64" code=67 value="'ipxe64.efi'" raw-value="6970786536342e656669" 

I've run into the same problem, the matcher doesn't appear to be using the option set I have specified. I'm matching the class id, and the debug dhcp logs show the value I'm expecting from the client, but the option set isn't being applied as expected (boot filename in my case, based on class id/option 60). I'm running 7.5, so I hope 7.6 does actually fix this.
 
deramirez
just joined
Posts: 3
Joined: Sat Sep 10, 2022 5:47 pm

Re: Vendor-class-id replaced with generic option matcher - How to PXE boot?

Sat Oct 22, 2022 1:17 pm

just tested on 7.6 and looks like problem fixed.
matcher works as expected with option sets and boot options!
 
bassist
just joined
Posts: 12
Joined: Fri Jun 29, 2012 4:33 pm

Re: Vendor-class-id replaced with generic option matcher - How to PXE boot?

Sun Oct 23, 2022 2:16 am

just tested on 7.6 and looks like problem fixed.
matcher works as expected with option sets and boot options!
Very nice! Are you able to post some snippets/examples? I'm just about to start testing this out and having something to go off would be awesome!
 
trnubo
just joined
Posts: 2
Joined: Thu Apr 23, 2020 1:17 pm

Re: Vendor-class-id replaced with generic option matcher - How to PXE boot?

Thu Jan 19, 2023 1:12 am

I just got this working with RouterOS 7.7 (never tried on 7.6).
[admin@MikroTik] > /ip/dhcp-server/option print detail 
 0 name="ipxe-uefi64" code=67 value="'ipxe-x86_64.efi'" raw-value="697078652d7838365f36342e656669" 
 1 name="ipxe-uefi32" code=67 value="'ipxe-i386.efi'" raw-value="697078652d693338362e656669" 
 2 name="ipxe-bios" code=67 value="'undionly.kpxe'" raw-value="756e64696f6e6c792e6b707865" 
 3 name="next-server" code=66 value="'192.168.100.1'" raw-value="c0a86401" 
 4 name="ipxe-menu" code=67 value="'menu.ipxe'" raw-value="6d656e752e69707865" 

[admin@MikroTik] > /ip/dhcp-server/option/sets print detail 
 0 name="arch-uefi64" options=ipxe-uefi64,next-server 
 1 name="arch-uefi32" options=ipxe-uefi32,next-server 
 2 name="arch-bios" options=ipxe-bios,next-server 
 3 name="ipxe-menu" options=next-server,ipxe-menu 

[admin@MikroTik] > /ip/dhcp-server/matcher print detail 
 0   name="arch-uefi64" server=vlan100 address-pool=pool-vlan100 option-set=arch-uefi64 code=93 value="0x0007" 
 1   name="arch-uefi32" server=vlan100 address-pool=pool-vlan100 option-set=arch-uefi32 code=93 value="0x0006" 
 2   name="arch-bios" server=vlan100 address-pool=pool-vlan100 option-set=arch-bios code=93 value="0x0000" 
 3   name="ipxe-menu" server=vlan100 address-pool=pool-vlan100 option-set=ipxe-menu code=77 value="iPXE" 
This will boot either bios or efi iPXE based on the Client system architecture (code 93). Then when iPXE runs it will be given "menu.ipxe" based on the User class (code 77). This is based off the examples in this thread (thanks deramirez) and on the iPXE docs iPXE Wiki: PXE chainloading for ICS dhcpd.

It is great to finally have this working in RouterOS.
 
mrboombasticdk
just joined
Posts: 1
Joined: Thu Jan 26, 2023 6:35 pm

Re: Vendor-class-id replaced with generic option matcher - How to PXE boot?

Thu Jan 26, 2023 6:52 pm

Hello. I have issues making my setup work.

I have a netboot.xyz server running with iPXE, when i use the matcher feature, my PXE client, cannot recieve the boot file or the ip to my tftp server.

If i type in the next server ip, and boot file name, directly in the "dhcp server/networks" section, the is no problems, but i want to be able to boot, both bios and uefi devices.

I use the file "netboot.xyz.kpxe" for bios devices, and "netboot.xyz.efi" for uefi devices.
[xxxxxxx@MikroTik] > ip/dhcp-server/option print detail
 0 name="ipxe-uefi64" code=67 value="'netboot.xyz.efi'" raw-value="6e6574626f6f742e78797a2e656669"
 1 name="ipxe-uefi32" code=67 value="'netboot.xyz.efi'" raw-value="6e6574626f6f742e78797a2e656669"
 2 name="ipxe-bios" code=67 value="'netboot.xyz-undionly.kpxe'" raw-value="6e6574626f6f742e78797a2d756e64696f6e6c792e6b707865" 
 3 name="next-server" code=66 value="'192.168.1.11'" force=yes raw-value="c0a8010b" 
 4 name="ipxe-menu" code=67 value="'menu.ipxe'" raw-value="6d656e752e69707865"


[xxxxxxx@MikroTik] > /ip/dhcp-server/option/sets print detail
 0 name="arch-uefi64" options=ipxe-uefi64,next-server 
 1 name="arch-uefi32" options=ipxe-uefi32,next-server 
 2 name="arch-bios" options=ipxe-bios,next-server 
 3 name="ipxe-menu" options=next-server,ipxe-menu
 
 
 [xxxxxxx@MikroTik] > /ip/dhcp-server/matcher print detail
Flags: X - disabled 
 0   name="arch-uefi64" server=LAN address-pool=LAN option-set=arch-uefi64 code=93 value="0x0007" 
 1   name="arch-uefi32" server=LAN address-pool=LAN option-set=arch-uefi32 code=93 value="0x0006" 
 2   name="arch-bios" server=LAN address-pool=LAN option-set=arch-bios code=93 value="0x0000" 
 3   name="ipxe-menu" server=LAN address-pool=LAN option-set=ipxe-menu code=77 value="iPXE"
Info about netboot.xyz: https://github.com/netbootxyz/netboot.xyz
I'm running routerOS 7.7


Any help would be much appreciated

Who is online

Users browsing this forum: Ahrefs [Bot], itamx and 94 guests