Community discussions

MikroTik App
 
User avatar
LordError
just joined
Topic Author
Posts: 16
Joined: Mon Jun 25, 2018 10:35 am
Location: IR,IRAN

PXE Boot From Mikrotik

Wed Jul 11, 2018 2:21 pm

Hi
How Can Using a Mikrotik router to PXE Boot?
Thank you
 
pe1chl
Forum Guru
Forum Guru
Posts: 10529
Joined: Mon Jun 08, 2015 12:09 pm

Re: PXE Boot From Mikrotik

Wed Jul 11, 2018 2:28 pm

- setup DHCP server with the required options for your client
- add storage to your router for the required bootfiles (USB stick, SD card, M.2 card, whatever fits your router)
- put required bootfiles on the storage
- configure TFTP service with these files
 
User avatar
LordError
just joined
Topic Author
Posts: 16
Joined: Mon Jun 25, 2018 10:35 am
Location: IR,IRAN

Re: PXE Boot From Mikrotik

Wed Aug 01, 2018 8:24 am

- setup DHCP server with the required options for your client
- add storage to your router for the required bootfiles (USB stick, SD card, M.2 card, whatever fits your router)
- put required bootfiles on the storage
- configure TFTP service with these files
I did it
But Error Number 0 is displayed in the Mikrotik log!
 
kkutzera
just joined
Posts: 2
Joined: Tue Aug 28, 2018 10:23 pm

Re: PXE Boot From Mikrotik

Tue Aug 28, 2018 10:56 pm

Hello,
Really interested in a solution. Trying to setup a PXE boot server. For initial testing I've setup a standalone network on a CCR1009. OS 6.40.8.
4 ports in a bridge to a DHCP server for a single LAN 192.168.0.0/24. DHCP lease scope 192.168.0.10-50. Options set for PXE boot, but this doesn't really matter yet since I'm first just trying to get the tftp to work.... There's no firewall or routing.
Used the CCR to format an SD card fat32. Used the FTP protocol to copy the files from another working PXE server. The files are located in disk1/tftpboot . (again need to focus on tftp first)

I've used several dozen versions of the syntax to setup the tftp server. (Also MS Windows native tftp client, and a third party download).
/ip tftp add allow-rollover=yes real-filename=disk1/tftpboot/ req-filename=.*
Just to try and get some success I tried
/ip tftp add allow-rollover=yes real-filename=disk1/tftpboot/pxelinux.0 req-filename=pxelinux.0
Sometimes I specify the 192.168.0.0/24 for allowed. Sometimes I specify 0.0.0.0 Most of the time I leave this blank.

There are three result...
ERROR code;0 string:permission denied!
or
ERROR code:1 string: file no found (typically when I deliberately GET something invalid like a file I know isn't there)
ERROR code: 8 (no other text after this. (This occurs when I boot a NUC on this LAN, which indicates DHCP is working.).

When I specify a req-filename (specific or wildcard) the tftp GET fails immediately (usually with permission denied)
If I don't specify any req-filename the GET command has to time out or exhaust all retries.

Ultimately I would like a blank (or wildcard) req-filename parameter, and a real-filename parameter that sets disk1/tftpboot folder as the TFTP root....
This shouldn't be hard.

Anyone out there have any success with this.
Thanks
Kevin
 
pe1chl
Forum Guru
Forum Guru
Posts: 10529
Joined: Mon Jun 08, 2015 12:09 pm

Re: PXE Boot From Mikrotik

Wed Aug 29, 2018 12:38 pm

Well, I consider it brave to try that. Good luck!
I have some experience with making a PXE server work, to install Windows from the network starting with a PXE
boot (and then starting a dialog with pxelinux, user selects and enters some options, finally setup is loaded and started).
This all without using Microsoft's tools that work only on Windows Server (which we don't have).
I got it all working (on a Linux server) but there so many small details and tricks that I would not even think of implementing
this on RouterOS....
When you want to use it to install Windows I also wonder how you implement the Boot Information Negotiation Layer?
(I use a Python program called binlsrv2.py for that, but I would not know how to do that on RouterOS)

Easy solution: do it on a Raspberry Pi.
 
vrgpy
just joined
Posts: 3
Joined: Fri Dec 31, 2021 9:59 pm

Re: PXE Boot From Mikrotik

Mon Jun 19, 2023 10:00 pm

Hello,
Really interested in a solution. Trying to setup a PXE boot server. For initial testing I've setup a standalone network on a CCR1009. OS 6.40.8.
4 ports in a bridge to a DHCP server for a single LAN 192.168.0.0/24. DHCP lease scope 192.168.0.10-50. Options set for PXE boot, but this doesn't really matter yet since I'm first just trying to get the tftp to work.... There's no firewall or routing.
Used the CCR to format an SD card fat32. Used the FTP protocol to copy the files from another working PXE server. The files are located in disk1/tftpboot . (again need to focus on tftp first)

I've used several dozen versions of the syntax to setup the tftp server. (Also MS Windows native tftp client, and a third party download).
/ip tftp add allow-rollover=yes real-filename=disk1/tftpboot/ req-filename=.*
Just to try and get some success I tried
/ip tftp add allow-rollover=yes real-filename=disk1/tftpboot/pxelinux.0 req-filename=pxelinux.0
Sometimes I specify the 192.168.0.0/24 for allowed. Sometimes I specify 0.0.0.0 Most of the time I leave this blank.

There are three result...
ERROR code;0 string:permission denied!
or
ERROR code:1 string: file no found (typically when I deliberately GET something invalid like a file I know isn't there)
ERROR code: 8 (no other text after this. (This occurs when I boot a NUC on this LAN, which indicates DHCP is working.).

When I specify a req-filename (specific or wildcard) the tftp GET fails immediately (usually with permission denied)
If I don't specify any req-filename the GET command has to time out or exhaust all retries.

Ultimately I would like a blank (or wildcard) req-filename parameter, and a real-filename parameter that sets disk1/tftpboot folder as the TFTP root....
This shouldn't be hard.

Anyone out there have any success with this.
Thanks
Kevin
Still not working in ROS 7.10. The error is still the same "permission denied!", in the log it appears as:
ERROR code:0 string:permission denied!

If i increase the logging to DEBUG, an additional line appears before:
requested file(binary): pxeboot access: denied

this is strange as there is no permission setting in the router.

I i use a different external tftp server there is no problem to get the boot file, but this SHOULD work on ROS.
 
vrgpy
just joined
Posts: 3
Joined: Fri Dec 31, 2021 9:59 pm

Re: PXE Boot From Mikrotik

Sat Jul 01, 2023 11:30 pm

Hello,
Really interested in a solution. Trying to setup a PXE boot server. For initial testing I've setup a standalone network on a CCR1009. OS 6.40.8.
4 ports in a bridge to a DHCP server for a single LAN 192.168.0.0/24. DHCP lease scope 192.168.0.10-50. Options set for PXE boot, but this doesn't really matter yet since I'm first just trying to get the tftp to work.... There's no firewall or routing.
Used the CCR to format an SD card fat32. Used the FTP protocol to copy the files from another working PXE server. The files are located in disk1/tftpboot . (again need to focus on tftp first)

I've used several dozen versions of the syntax to setup the tftp server. (Also MS Windows native tftp client, and a third party download).
/ip tftp add allow-rollover=yes real-filename=disk1/tftpboot/ req-filename=.*
Just to try and get some success I tried
/ip tftp add allow-rollover=yes real-filename=disk1/tftpboot/pxelinux.0 req-filename=pxelinux.0
Sometimes I specify the 192.168.0.0/24 for allowed. Sometimes I specify 0.0.0.0 Most of the time I leave this blank.

There are three result...
ERROR code;0 string:permission denied!
or
ERROR code:1 string: file no found (typically when I deliberately GET something invalid like a file I know isn't there)
ERROR code: 8 (no other text after this. (This occurs when I boot a NUC on this LAN, which indicates DHCP is working.).

When I specify a req-filename (specific or wildcard) the tftp GET fails immediately (usually with permission denied)
If I don't specify any req-filename the GET command has to time out or exhaust all retries.

Ultimately I would like a blank (or wildcard) req-filename parameter, and a real-filename parameter that sets disk1/tftpboot folder as the TFTP root....
This shouldn't be hard.

Anyone out there have any success with this.
Thanks
Kevin
Still not working in ROS 7.10. The error is still the same "permission denied!", in the log it appears as:
ERROR code:0 string:permission denied!

If i increase the logging to DEBUG, an additional line appears before:
requested file(binary): pxeboot access: denied

this is strange as there is no permission setting in the router.

I i use a different external tftp server there is no problem to get the boot file, but this SHOULD work on ROS.
I tried removing the IP address parameter as this is like an ACL, but now the error is: Error 8 (no more info)
 
wiseroute
Member
Member
Posts: 423
Joined: Sun Feb 05, 2023 11:06 am

Re: PXE Boot From Mikrotik

Sun Jul 02, 2023 4:22 am

tftp error code explained:

https://docs.ruckuswireless.com/fastiro ... 014D2.html

hope this helps.
 
jonnes86
just joined
Posts: 4
Joined: Sat Mar 11, 2023 6:24 am

Re: PXE Boot From Mikrotik

Wed Nov 22, 2023 3:44 am

/ip dhcp-server option
add code=66 name=boot-server value="IP_of_PXE_Server"
add code=67 name=boot-file value="pxelinux.0"
 
tonyd
newbie
Posts: 49
Joined: Fri Jul 20, 2012 3:31 pm

Re: PXE Boot From Mikrotik

Sat Dec 30, 2023 9:13 pm

Hello all,

I would like to contribute to this discussion what it is I found necessary to get TFTP network boot to work for those struggling. I hope this helps out.

Best

As a foundation, I am using a server w/ Proxmox 8.0.4. I've set up a LXC container running Docker and the netboot.xyz image to serve as my TFTP Server. Then I can configure a VM to network boot. It works just as well for bare metal hardware client.

For reference to the netboot.xyz: Linuxserver.io

RouterOS Config:
As @jonnes86 pointed out, you need to set some DHCP Options. Notice, though, you have to be specific in the value formats or RouterOS will complain it's not a valid entry with
"... Unknown data type"
Notice the double quote around a single quoted string. You then configure an Option Set to include both of the Options defined. Then, you need to update one, any or all of your Networks to include a Next Server, which points to your PXE server IP and select the DHCP Option Set you configured. Alternatively, you can skip the Option Set and select the DHCP Options themselves. I don't understand why it's necessary to select a Next Server when it's already been defined in an Option Set and by virtue of the fact that you've set the DHCP Open Set (or DHCP Options) it should already know you're configuring the Network to point to a TFTP Server, but oh well.

CLI method:
/ip dhcp-server option
add code=66 name=pxe-boot-server value="'10.13.37.113'"
add code=67 name=boot-file value="'netboot.xyz.kpxe'"

/ip dhcp-server option sets
add name=NetworkBoot options=pxe-boot-server,boot-file
Set the needed changes to the network(s) entry to include next-server and dhcp-option-set (or dhcp-option alternatively)
/ip dhcp-server network
add address=10.13.37.0/24 dhcp-option-set=NetworkBoot dns-server=10.0.2.11,10.0.2.12,1.1.1.1 gateway=10.13.37.1 \
    next-server=10.13.37.113
GUI Method:
You do not have the required permissions to view the files attached to this post.

Who is online

Users browsing this forum: vingjfg, whitefxdesign and 42 guests