Community discussions

MikroTik App
 
Johannes33
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 58
Joined: Mon Dec 26, 2016 1:26 am

HOW-TO Netinstall from LINUX (the offical page's method does not work)

Thu May 25, 2023 12:48 pm

Hi,
So how to netinstall from a linux machine to a routerboard device.
1. Install netinstall
a)
See if you have netinstall in any repository so you can install it with a package manager. If you do that you will pull the necessary dependencies and make the program work.
For me on manjaro with the ability to use the repository AUR found the netinstall program. All distributions based on Arch linux and have access to AUR will be able to get the program form there.
I use yay as package manager and used yay -Ss netinstall to find the package and then yay -S to install it.
yay -S netinstall
The version I got with that was netinstall-7.9.1.

b)
I checked out what type of file netinstall is with the file command:
file netinstall
netinstall: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, for GNU/Linux 2.6.16, stripped

So it is 32 bit and your and mine architecture are 64 bit. To be able to run 32 bit packages on a 64 bit machine you have to have libraries installed called 'multilib'. I have not researched it so much but this link talks about it and you should be able to read up about it for your distribution. If you sort it out please post how you did it and what dependencies you added.

2. See the actual commands of netinstall.
the program does not have a man page but you can use the -h option. The -a option form the support page does not exist. You have to use the -i option instead.
netinstall -h
usage: /usr/bin/netinstall [OPTIONS]

where OPTIONS are:
-h show this help
-i INTERFACE install via INTERFACE
-k KEYFILE use KEYFILE
-p PACKAGE install PACKAGE
-r reset configuration
-s SCRIPT run script

3. I do not know if you need to do all this but I did it and it worked and later on I see that netinstall used the address:
a) set a static ip on your interface which you want to connect to the routerboard. Ifconfig is deprecated so use the command ip instead.
just change the device name and you should be good to go.
sudo ip a add 192.168.88.2/24 broadcast + dev eth0
device eth0 is my ehternet connection form my computer but a lot of times it starts with enp0.

4. Connect to computer to boot interface on router. Often it is ethernet 1
5. Put the router in etherboot mode.
6. Run netinstall
for me it was:
sudo netinstall -i eth0 -p routeros-arm-6.48.7.npk -r
Version: 7.9.1(2023-05-19 12:54:50)
Will reset to default config
Interface Mask: 255.255.255.0
Using Client IP: 192.168.88.1
Using Server IP: 192.168.88.2
Starting PXE server
Waiting for RouterBOARD...
client: (mac-address)
Sending image: arm
sendFile 3449268
Discovered RouterBOARD...
Formatting...
Sending package routeros-arm-6.48.7.npk ...
Ready for reboot...
Sent reboot command

7. Remove the ip address from the interface if you want.
ip address flush dev <interface name>
8. Connect the cable form the boot port to where you want it. and log in with winbox.
Last edited by Johannes33 on Thu May 25, 2023 1:49 pm, edited 2 times in total.
 
holvoetn
Forum Guru
Forum Guru
Posts: 5403
Joined: Tue Apr 13, 2021 2:14 am
Location: Belgium

Re: HOW-TO Netinstall from LINUX (the offical page's method does not work)

Thu May 25, 2023 12:58 pm

Official instructions work just fine for me.

wget option is the preferred way to get the package, you can't know for sure what happens with package archives.
(especially not when you need the very last version which just has been released)

Only note I made for myself is to use 192.168.88.3 as IP address.
.//netinstall-cli -a 192.168.88.3 routeros-arm64-[VERSION].npk

Close to 100% success rate.
 
Johannes33
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 58
Joined: Mon Dec 26, 2016 1:26 am

Re: HOW-TO Netinstall from LINUX (the offical page's method does not work)

Thu May 25, 2023 1:23 pm

The problem is the dependencies of netconfig.
There is no mention of dependencies on the official page.
If you do not have them or know which they are then you can not run the program.
If someone made a working program by defining the dependencies and put it in a repository I'm happy to use it since I have no idea on how to get the right dependencies otherwise.
That there is no mentions about dependencies on the official page is a fundamental flaw when you distribute something to linux.
But you must have them installed since your program works. I did not.
This is what I got when I used the official guide:
wget https://download.mikrotik.com/routeros/ ... 8.7.tar.gz
tar -xzf netinstall-6.48.7.tar.gz
sudo ./netinstall -r -a 192.168.88.1 routeros-arm-6.48.7.npk
[sudo] password for johannes:
Will reset config
Using server IP: 192.168.88.2
Starting PXE server
Waiting for RouterBOARD...
PXE client: MAC-address
PXE client: MAC-address
PXE client: MAC-address
PXE client: MAC-address
PXE client: MAC-address
PXE client: MAC-address
PXE client: MAC-address
PXE client: MAC-address
PXE client: MAC-address
PXE client: MAC-address
PXE client: MAC-address
PXE client: MAC-address
PXE client: MAC-address
PXE client: MAC-address
PXE client: MAC-address
PXE client: MAC-address
PXE client: MAC-address
PXE client: MAC-address
PXE client: MAC-address
PXE client: MAC-address
PXE client: MAC-address

Where MAC-address is my mac address to my eth1 on my rb.

To use ifconfig, which nowadays is not installed on most distributions and I do not know if it works, is an other thing that does not work.
the ip command is installed on all distributions and works.

The -a option that is central in the guide does not work.
If you try to run it you just get an error, no mentions on how to find the right option or how to access help, which makes it not working or just bad:
sudo netinstall -r -a 192.168.88.1 routeros-arm-6.48.7.npk
[sudo] password for johannes:
/usr/bin/netinstall: illegal option -- a
No package given for installation.

But you are right in one way, if the command would have been well documented with which dependencies it uses and how to use it.
And also how to use a current program to set static ip address I would say that the wget method might be better.
I say might since it is more secure,
but there might be problems with dependencies still since different distributions ship different versions of a program in their packages which can lead to unpredictable behavior of a program if it is not tested, which you do when you make a package for a repository.
Last edited by Johannes33 on Thu May 25, 2023 2:23 pm, edited 2 times in total.
 
holvoetn
Forum Guru
Forum Guru
Posts: 5403
Joined: Tue Apr 13, 2021 2:14 am
Location: Belgium

Re: HOW-TO Netinstall from LINUX (the offical page's method does not work)

Thu May 25, 2023 1:28 pm

The -a option that is central in the guide does not work.
If you try to run it you just get an error, no mentions on how to find the right option or how to access help, which makes it not working or just bad:
sudo netinstall -r -a 192.168.88.1 routeros-arm-6.48.7.npk
[sudo] password for johannes:
/usr/bin/netinstall: illegal option -- a
No package given for installation.
Minor correction:
the correct command to be used is netinstall-cli
That's something else.
And that will work.
 
Johannes33
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 58
Joined: Mon Dec 26, 2016 1:26 am

Re: HOW-TO Netinstall from LINUX (the offical page's method does not work)

Thu May 25, 2023 1:36 pm

I have no netinstall-cli.
The wget from the official netinstall page downloads "netinstall" not "netinstall-cli".
I think you have an old download that might correspond to the old guide.
In that case the guide perhaps worked.
 
holvoetn
Forum Guru
Forum Guru
Posts: 5403
Joined: Tue Apr 13, 2021 2:14 am
Location: Belgium

Re: HOW-TO Netinstall from LINUX (the offical page's method does not work)

Thu May 25, 2023 2:12 pm

2023-05-25_13-07-26.jpg
You do not have the required permissions to view the files attached to this post.
 
Johannes33
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 58
Joined: Mon Dec 26, 2016 1:26 am

Re: HOW-TO Netinstall from LINUX (the offical page's method does not work)

Thu May 25, 2023 5:28 pm

Interesting,
There are two different programs you can get depending on the version you download.

From the official documentation:
download.mikrotik.com/routeros/[VERSION]/netinstall-[VERSION].tar.gz
But what is [VERSION]?
Normally the version that runs a task does not have to be the same as the version of the file the task is made run on.
But since I do not have any other version then my routerOS version, I download it according to routerOS version:
download.mikrotik.com/routeros/6.48.7/netinstall-6.48.7.tar.gz
and extract
tar -xzf netinstall-6.48.7.tar.gz
and get:
LICENSE.txt
netinstall
Yes you are right I do get netinstall-cli form 7.9.1.

Still I do not think I would have succeded with runing netinstall-cli ether since it is a 32 bit application and I have no idea on what dependencies it needs to run on a 64 bit machine.
One could also argue that since netinstall and netinstall-cli seems to be treated interchangably they might be a fork of the same program and use the same dependencies.
At least the netinstall did not run correctly. Now that I have netinstall installed from repository I have the dependencies to run netinstall and I tried to run netinstall-cli and I can run it also.

I have seen other posts on the forum that discuss not being able to run netinstall. I think dependencies are the problem for some of them and that is why I did the original post to help others like me that did not get it to work and make a tutorial for how to overcome the problems I faced. Which are real.

All the best
/Johannes
 
matd
just joined
Posts: 13
Joined: Wed Jan 17, 2018 5:12 pm

Re: HOW-TO Netinstall from LINUX (the offical page's method does not work)  [SOLVED]

Thu May 25, 2023 9:23 pm

Hi,
netinstall-cli from official Mikrotik download page is 32 bit, but it is statically linked without any dependency (no dynamic linking).
You can happily run it on 64-bit only system (no multilib is required).

With older linux versions (6.48) i had same issue, it does not worked.
But try latest netinstall (7.9) and it works also with older RouterOS versions.
 
Johannes33
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 58
Joined: Mon Dec 26, 2016 1:26 am

Re: HOW-TO Netinstall from LINUX (the offical page's method does not work)

Fri May 26, 2023 1:56 pm

Ok thanks for the information :) it is good to know.

Who is online

Users browsing this forum: andrep, boocko, mtkvvv and 45 guests