Community discussions

MikroTik App
 
User avatar
rextended
Forum Guru
Forum Guru
Topic Author
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

PLEASE MikroTik made NetInstall version for Docker....

Sat Sep 11, 2021 3:20 pm

PLEASE MikroTik made NetInstall version for Docker....
 
User avatar
jr0dd
just joined
Posts: 14
Joined: Fri Feb 10, 2017 4:46 am

Re: PLEASE MikroTik made NetInstall version for Docker....

Sat Sep 11, 2021 9:53 pm

I will work on one this weekend sometime and put in my GitHub registry
 
User avatar
rextended
Forum Guru
Forum Guru
Topic Author
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: PLEASE MikroTik made NetInstall version for Docker....

Sat Sep 11, 2021 11:42 pm

FANTASTIC!!!
 
User avatar
jr0dd
just joined
Posts: 14
Joined: Fri Feb 10, 2017 4:46 am

Re: PLEASE MikroTik made NetInstall version for Docker....

Sun Sep 12, 2021 3:30 am

FANTASTIC!!!
meh. After playing around with it, using a docker image to flash would take more effort than it's worth. You would have to mount the update file in the container and set env vars for the flags. It's way more efficient to just run the binary. If they had a web interface for the linux binary or if someone could write one, that would be the game changer though.
 
User avatar
rextended
Forum Guru
Forum Guru
Topic Author
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: PLEASE MikroTik made NetInstall version for Docker....

Mon Sep 13, 2021 2:38 pm

... :cry: :cry: :cry:
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 18959
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: PLEASE MikroTik made NetInstall version for Docker....

Mon Sep 13, 2021 6:09 pm

rextended, you have unravelled most of the mysteries in the universe, surely one small docker container is within your skill set!
perhaps jr0dd can be convinced to do so for a bottle of red italian wine!!
 
User avatar
rextended
Forum Guru
Forum Guru
Topic Author
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: PLEASE MikroTik made NetInstall version for Docker....

Mon Sep 13, 2021 6:48 pm

I do not have any experience on Docker... sorry :)
 
User avatar
deadkat
Frequent Visitor
Frequent Visitor
Posts: 57
Joined: Sun Nov 15, 2020 11:14 pm
Location: Alabama, USA

Re: PLEASE MikroTik made NetInstall version for Docker....

Mon Sep 13, 2021 11:05 pm

I am also trying to create such a solution and will be sure to update here when we get it working
 
infabo
Long time Member
Long time Member
Posts: 585
Joined: Thu Nov 12, 2020 12:07 pm

Re: PLEASE MikroTik made NetInstall version for Docker....

Tue Sep 14, 2021 9:04 am

I work with docker for years.

But please enlighten me: what/which use-case do we try to solve here? I don't get it. Running Windows Netinstall binary inside a Linux Docker container. What is this?
 
mducharme
Trainer
Trainer
Posts: 1777
Joined: Tue Jul 19, 2016 6:45 pm
Location: Vancouver, BC, Canada

Re: PLEASE MikroTik made NetInstall version for Docker....

Tue Sep 14, 2021 9:38 am

Who said Windows netinstall binary? There has been a Linux netinstall version for months now. I think they wish to run the Linux netinstall binary in a docker container.
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26287
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: PLEASE MikroTik made NetInstall version for Docker....

Tue Sep 14, 2021 9:44 am

How will you use it? Is there a use case scenario, where you need to reinstall many devices, but have no Linux or Windows computers anywhere?
 
blingblouw
Member
Member
Posts: 345
Joined: Wed Aug 25, 2010 9:43 am

Re: PLEASE MikroTik made NetInstall version for Docker....

Tue Sep 14, 2021 9:47 am

Yes. MDU with multiple customers, we have a router on the same broadcast domain. Can reset them all easily without having to travel to site
 
User avatar
Cha0s
Forum Guru
Forum Guru
Posts: 1135
Joined: Tue Oct 11, 2005 4:53 pm

Re: PLEASE MikroTik made NetInstall version for Docker....

Tue Sep 14, 2021 9:50 am

How will you use it? Is there a use case scenario, where you need to reinstall many devices, but have no Linux or Windows computers anywhere?
Remote locations, kilometers away.
It's not for 'many devices', but for that one device once every few years that needs to be netinstalled without having to drive 2 hours to a mountain somewhere.
 
mducharme
Trainer
Trainer
Posts: 1777
Joined: Tue Jul 19, 2016 6:45 pm
Location: Vancouver, BC, Canada

Re: PLEASE MikroTik made NetInstall version for Docker....

Tue Sep 14, 2021 9:52 am

Use case for us would be where a user 1000km away reboots their router while it is upgrading to a new RouterOS version, now it can no longer boot except to ethernet. We try to create a layer 2 tunnel to the user to netinstall their router when this happens but due to congestion long distance netinstall does not work properly.
Last edited by mducharme on Tue Sep 14, 2021 10:13 am, edited 2 times in total.
 
User avatar
rextended
Forum Guru
Forum Guru
Topic Author
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: PLEASE MikroTik made NetInstall version for Docker....

Tue Sep 14, 2021 9:52 am

I think they wish to run the Linux netinstall binary in a docker container.
E-X-A-C-T-L-Y

NetInstall is more sicure than upgrade, and can clean all what must not be present, if something has happen on "remote" past...
Last edited by rextended on Tue Sep 14, 2021 9:56 am, edited 1 time in total.
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26287
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: PLEASE MikroTik made NetInstall version for Docker....

Tue Sep 14, 2021 9:54 am

How do you put them into netinstall, mode, if you have no access?
Are they all set by default to nand-if-fail-then-ethernet ?
 
mducharme
Trainer
Trainer
Posts: 1777
Joined: Tue Jul 19, 2016 6:45 pm
Location: Vancouver, BC, Canada

Re: PLEASE MikroTik made NetInstall version for Docker....

Tue Sep 14, 2021 9:56 am

Are they all set by default to nand-if-fail-then-ethernet ?
Yes, they all are, in our case. It seems to be set to this by default. Some of them we can successfully netinstall remotely, if there is enough bandwidth. Others time out because the connection is too slow. It doesn't happen very often that we have to do this, but would be a handy feature for when this does need to happen.
Last edited by mducharme on Tue Sep 14, 2021 9:58 am, edited 1 time in total.
 
User avatar
rextended
Forum Guru
Forum Guru
Topic Author
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: PLEASE MikroTik made NetInstall version for Docker....

Tue Sep 14, 2021 9:58 am

I have all device powered from 8P, 16P or 24P RouterBOARDs,

on default I set all device
/partitions set [find] fallback-to=etherboot

# this is RouterOS default
/sys routerboard settings
set boot-device=nand-if-fail-then-ethernet

But the point is not only to netinstall devices with problems, but netinstall anything...
 
User avatar
jvanhambelgium
Forum Veteran
Forum Veteran
Posts: 985
Joined: Thu Jul 14, 2016 9:29 pm
Location: Belgium

Re: PLEASE MikroTik made NetInstall version for Docker....

Tue Sep 14, 2021 10:12 am

Use case for us would be where the user 1000km away reboots their router while it is upgrading RouterOS version, now it can no longer boot except to ethernet. We try to create a layer 2 tunnel to the user to netinstall their router when this happens but due to congestion long distance netinstall does not work properly.
But still that would not work?
Suppose while upgrading ROS the user/elec fails and the box boots to ethernet, so in a dodgy state.
Why would would you think the "container logic" on that box would be operational in this state ?
I do not fully understand at what level the container-daemons live in ROS, but I'm sure your ROS must be booted up to a certain level for that.
 
User avatar
rextended
Forum Guru
Forum Guru
Topic Author
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: PLEASE MikroTik made NetInstall version for Docker....

Tue Sep 14, 2021 10:14 am

Is logical that is not the only device present on-site...

Is obvious than the netinstall on a container is used to install another machine.

About power failure, is obvious that is it not a domestic case...
Last edited by rextended on Tue Sep 14, 2021 10:16 am, edited 1 time in total.
 
blingblouw
Member
Member
Posts: 345
Joined: Wed Aug 25, 2010 9:43 am

Re: PLEASE MikroTik made NetInstall version for Docker....

Tue Sep 14, 2021 10:15 am

How do you put them into netinstall, mode, if you have no access?
Are they all set by default to nand-if-fail-then-ethernet ?
So Mikrotik had a big exploit a few years ago. Only sure way to resolve this issue was to netinstall. If this could be done remotely in a controlled manner, with a remote device, lives would have been much easier. So netinstall is not only used when remote access is lost or device bricked.
 
mducharme
Trainer
Trainer
Posts: 1777
Joined: Tue Jul 19, 2016 6:45 pm
Location: Vancouver, BC, Canada

Re: PLEASE MikroTik made NetInstall version for Docker....

Tue Sep 14, 2021 10:17 am

I do not fully understand at what level the container-daemons live in ROS, but I'm sure your ROS must be booted up to a certain level for that.
I am talking about this from an ISP perspective. At the local site, by where the user is, we have a head-end router there that is fully operational. Many customers routers connect through this head end router. The customers router that connects to our router is trying to boot to ethernet because the user rebooted it while it was upgrading at 4am, when we didn't think any customers would be awake. We try to create a layer 2 tunnel (ex. EoIP) to netinstall the customer router, but due to congestion to the site, it isn't fast enough and the netinstall times out since it is designed for lower latencies. We do not have a linux or windows box at the site that can run netinstall and so we need to have the customer ship us back the router for reprogramming in that case. If we could run a netinstall docker container on our head-end router in that case, the connection would be very fast because it would be local, and the netinstall would probably be successful.
Last edited by mducharme on Tue Sep 14, 2021 10:21 am, edited 1 time in total.
 
User avatar
rextended
Forum Guru
Forum Guru
Topic Author
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: PLEASE MikroTik made NetInstall version for Docker....

Tue Sep 14, 2021 10:19 am

The fast way to launch netinstall remotely is to make one EoIP tunnel between my office and the remote switch where the device must be netinstalled...
Slower? Ahhh.....
 
User avatar
rextended
Forum Guru
Forum Guru
Topic Author
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: PLEASE MikroTik made NetInstall version for Docker....

Tue Sep 14, 2021 10:21 am

@mducharme
You're writing what I think
 
User avatar
StubArea51
Trainer
Trainer
Posts: 1739
Joined: Fri Aug 10, 2012 6:46 am
Location: stubarea51.net
Contact:

Re: PLEASE MikroTik made NetInstall version for Docker....

Tue Sep 14, 2021 1:09 pm

How do you put them into netinstall, mode, if you have no access?
Are they all set by default to nand-if-fail-then-ethernet ?

This is something I'd like to see as well. We often work on remote networks with serial console access but not a dedicated laptop. Being able to use a MikroTik router as a staging point for netinstall would be awesome.

A good example of a network like this are some of the ISPs in Alaska we work for. Getting to the sites is very expensive and often requires a helicopter but the use of solar power makes it impractical to keep a Windows PC/Laptop at every site.

Also data centers or sites with limited rack space available would make this ideal to take an existing device and extend the functionality rather than adding another 1RU just to do netinstall.
 
biomesh
Long time Member
Long time Member
Posts: 561
Joined: Fri Feb 10, 2012 8:25 pm

Re: PLEASE MikroTik made NetInstall version for Docker....

Tue Sep 14, 2021 2:55 pm

Getting netinstall to work in a container is not difficult when using host networking. When using bridge mode - which is the only mode I have seen on the examples for ROS it won't work. The container will reside in a 172.17.0.0/16 network and when you run netinstall you have to provide an ip address on the command line that the client will receive. Normally dstnat would be used for most docker based communications to the bridge network, but you can't assign the correct IP address to the network since it will only accept 172.17.0.0/16 addresses. Any attempt to assign an address outside of this range to netinstall will result in an error - "Invalid client IP address".

You can run in in your own docker host though:
FROM debian:bullseye-slim
ENV VER=6.48.4
RUN apt-get update && apt-get install -y apt-transport-https curl && \
        curl -o /tmp/netinstall.tgz https://download.mikrotik.com/routeros/${VER}/netinstall-${VER}.tar.gz && \
        mkdir -p /opt/mikrotik/bin/ && tar zxvf /tmp/netinstall.tgz -C /opt/mikrotik/bin/ && \
        rm /tmp/netinstall.tgz 
EXPOSE 5000/udp 67/udp 69/udp
CMD /opt/mikrotik/bin/netinstall ${NETINSTALL_OPTS} 


If netinstall can be modified to run in a bridge mode / allow for client address override, then this would be a good option.
 
User avatar
deadkat
Frequent Visitor
Frequent Visitor
Posts: 57
Joined: Sun Nov 15, 2020 11:14 pm
Location: Alabama, USA

Re: PLEASE MikroTik made NetInstall version for Docker....

Tue Sep 14, 2021 3:13 pm

In our case my company configures and ships hundreds, sometimes thousands, of routerboards per month and we would like to create a station that allows for automating netinstall.

Have a container host connected to one or more poe out crs that will telnet and automatically place a device into etherboot when it’s seen in neighbor discovery and then have netinstall container running on a loop to netinstall anything plugged into the crs automatically. Then host multiple containers and segment them with vlans. Each port on the crs could go back to one netinstall container.

No more need to hold down the button for netinstall, it’ll just start the process as soon as a board is connected to the crs. Much faster config of boards because one person can now netinstall 12+ routerboards simultaneously.
Last edited by deadkat on Tue Sep 14, 2021 6:46 pm, edited 1 time in total.
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11381
Joined: Thu Mar 03, 2016 10:23 pm

Re: PLEASE MikroTik made NetInstall version for Docker....

Tue Sep 14, 2021 3:42 pm

Getting netinstall to work in a container is not difficult when using host networking. When using bridge mode - which is the only mode I have seen on the examples for ROS it won't work.

Why not? Configuration examples, prepared by Mikrotik, go like this:
  1. create bridge for docker
  2. set IP address on docker bridge (so that ROS can communicate via this bridge)
  3. create veth device for container, configure it with IP address (from docker subnet)
    (documentation says "for docker" but one should create one veth device for each container)
  4. add veth interface to docker bridge
  5. run container using veth interface
Sure enough container doesn't have L2 access to (external) LAN.

But it would have L2 access to LAN subnet if the configuration steps would be like these:
  1. create veth device for container, configure it with IP address from LAN subnet
  2. add veth device to LAN bridge
  3. run container using veth interface
 
biomesh
Long time Member
Long time Member
Posts: 561
Joined: Fri Feb 10, 2012 8:25 pm

Re: PLEASE MikroTik made NetInstall version for Docker....

Tue Sep 14, 2021 3:45 pm

Well, unfortunately it does not work that way.

I assumed that and spent a LOT of time on it. I could only get a bridged mode of 172.17.0.0/16 to work and not a bridged mode to my local network.

Perhaps there is a way, but there is almost no docs on the feature as it is new. From what I have seen, only the "built-in" bridge network is available.
 
pe1chl
Forum Guru
Forum Guru
Posts: 10183
Joined: Mon Jun 08, 2015 12:09 pm

Re: PLEASE MikroTik made NetInstall version for Docker....

Tue Sep 14, 2021 4:40 pm

How do you put them into netinstall, mode, if you have no access?
Are they all set by default to nand-if-fail-then-ethernet ?
In the past I have set devices to "try-ethernet-once-then-nand" so I would always be able to force them to netinstall in case something fails.
But this setting no longer sticks. It always falls back to "nand-if-fail-then-ethernet" which I think is less than optimal as it would not work in case the system does boot but is unreachable.
E.g. in tower installs where a powercycle can be done, but pushing the reset button involves a lot of work.

Why has this change been made???
 
User avatar
SiB
Forum Guru
Forum Guru
Posts: 1888
Joined: Sun Jan 06, 2013 11:19 pm
Location: Poland

Re: PLEASE MikroTik made NetInstall version for Docker....

Tue Sep 14, 2021 5:51 pm

+1 for 'try-ethernet-once-then-nand' stay after reboot, be a new default action, not one-time action.

All my branches use a scheduler with start-time=startup and action try-ethernet-once-then-nand becasue after reboot it revert to other option. Thanks to this user not must press button + power - this is so problematic for not IT people .
This help me with remote netinstall (via TeamViewer) and thanks to that I can fix branch in 2h (most problem is end-user laptop and communication with that person).
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 18959
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: PLEASE MikroTik made NetInstall version for Docker....

Tue Sep 14, 2021 6:10 pm

+1, I think it would be cool to be able to netinstall a router and not even be there! Some amazing reasons provided, mind blowing what you guys have to deal with (not just I am too lazy to climb a mountain LOL)
Plus rextended really really wants this bad!!
 
User avatar
Cha0s
Forum Guru
Forum Guru
Posts: 1135
Joined: Tue Oct 11, 2005 4:53 pm

Re: PLEASE MikroTik made NetInstall version for Docker....

Tue Sep 14, 2021 9:21 pm

+1 for 'try-ethernet-once-then-nand' stay after reboot, be a new default action, not one-time action
+1 :)
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11381
Joined: Thu Mar 03, 2016 10:23 pm

Re: PLEASE MikroTik made NetInstall version for Docker....

Tue Sep 14, 2021 10:24 pm

I assumed that and spent a LOT of time on it. I could only get a bridged mode of 172.17.0.0/16 to work and not a bridged mode to my local network.

Well ... perhaps this docker container support indeed needs some polishing. IIRC docker (implicit) default networking uses bridge with 172.17.0.0/16 network, but one can change it ... plus one can add additional networks with different network addresses.

The bummer is if one is running LAN with network address 172.17.0.0/16 (or a subnet of thereof) and hence this (as of this time unchangeable) default setting messes things up.
 
Easen
just joined
Posts: 22
Joined: Tue Mar 23, 2021 9:38 pm

Re: PLEASE MikroTik made NetInstall version for Docker....

Wed Sep 15, 2021 10:18 am

I started to play around with this a few weeks ago, but I didn't get that far. I've recently gave it another go and I've committed what I've got so far to Github and Docker Hub (https://github.com/Easen/mikrotik-netinstall & https://hub.docker.com/r/easen/mikrotik-netinstall).

However I am struggling to get it to work when I'm testing with my hEX on MacOSX. Any pointers?
docker run --rm -it --network=host -v `pwd`:/root/ easen/mikrotik-netinstall:7.1rc3  -a 192.168.88.2 /root/routeros-7.1rc3-mmips.npk      
Using server IP: 192.168.65.3
Starting PXE server
Waiting for RouterBOARD...
Has anyone else managed to get this approach to work on MacOSX?
 
biomesh
Long time Member
Long time Member
Posts: 561
Joined: Fri Feb 10, 2012 8:25 pm

Re: PLEASE MikroTik made NetInstall version for Docker....

Wed Sep 15, 2021 1:22 pm

I don't have a Mac os device, but normally with netinstall, the client address (-a) is on the same network as the server. When running on routeros docker, netinstall will fail to run if this is not correct.

So in your case it could be "-a 192.168.65.100"
 
colin
Frequent Visitor
Frequent Visitor
Posts: 74
Joined: Mon May 11, 2015 11:11 am

Re: PLEASE MikroTik made NetInstall version for Docker....

Thu Sep 16, 2021 11:32 am

I do not fully understand at what level the container-daemons live in ROS, but I'm sure your ROS must be booted up to a certain level for that.
I am talking about this from an ISP perspective. At the local site, by where the user is, we have a head-end router there that is fully operational. Many customers routers connect through this head end router. The customers router that connects to our router is trying to boot to ethernet because the user rebooted it while it was upgrading at 4am, when we didn't think any customers would be awake. We try to create a layer 2 tunnel (ex. EoIP) to netinstall the customer router, but due to congestion to the site, it isn't fast enough and the netinstall times out since it is designed for lower latencies. We do not have a linux or windows box at the site that can run netinstall and so we need to have the customer ship us back the router for reprogramming in that case. If we could run a netinstall docker container on our head-end router in that case, the connection would be very fast because it would be local, and the netinstall would probably be successful.
In this case, i think it's better to request a feature that support netinstall within routeros.
 
User avatar
rextended
Forum Guru
Forum Guru
Topic Author
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: PLEASE MikroTik made NetInstall version for Docker....

Thu Sep 16, 2021 6:00 pm

Is like other dozen of requested feature: nothing.
Better do something active than waiting for nothing...
 
infabo
Long time Member
Long time Member
Posts: 585
Joined: Thu Nov 12, 2020 12:07 pm

Re: PLEASE MikroTik made NetInstall version for Docker....

Fri Sep 17, 2021 2:02 pm

Who said Windows netinstall binary? There has been a Linux netinstall version for months now. I think they wish to run the Linux netinstall binary in a docker container.
ROFL. this binary I tried recently that

a) has no help output at all. just synopsis and thats it. [-r] flag. what is this? recursive? revert? retransmit? this is not helpful at all. and there is obviously no wiki page that would describe all these params. just a bunch of flags/options without any further infos.

b) exits with a segmentation fault every time.

"Starting PXE server
Segmentation fault (core dumped)
"

This is far away from anything.
 
biomesh
Long time Member
Long time Member
Posts: 561
Joined: Fri Feb 10, 2012 8:25 pm

Re: PLEASE MikroTik made NetInstall version for Docker....

Fri Sep 17, 2021 2:10 pm

The linux netinstall docs are here:

https://help.mikrotik.com/docs/display/ ... nsforLinux

I saw the segfaults, but I think it was before I exposed the ports in the container or I had something else misconfigured.
 
infabo
Long time Member
Long time Member
Posts: 585
Joined: Thu Nov 12, 2020 12:07 pm

Re: PLEASE MikroTik made NetInstall version for Docker....

Fri Sep 17, 2021 2:34 pm

Thanks for the link. But still I do not understand, why put the info to online docs - and not to "netinstall --help".
./netinstall -a 192.168.0.3 routeros-7.1rc3-arm.npk 
Using server IP: 192.168.0.135
Starting PXE server
Segmentation fault (core dumped)
 
User avatar
jr0dd
just joined
Posts: 14
Joined: Fri Feb 10, 2017 4:46 am

Re: PLEASE MikroTik made NetInstall version for Docker....

Sun Sep 19, 2021 6:11 am

I started to play around with this a few weeks ago, but I didn't get that far. I've recently gave it another go and I've committed what I've got so far to Github and Docker Hub (https://github.com/Easen/mikrotik-netinstall & https://hub.docker.com/r/easen/mikrotik-netinstall).

However I am struggling to get it to work when I'm testing with my hEX on MacOSX. Any pointers?
docker run --rm -it --network=host -v `pwd`:/root/ easen/mikrotik-netinstall:7.1rc3  -a 192.168.88.2 /root/routeros-7.1rc3-mmips.npk      
Using server IP: 192.168.65.3
Starting PXE server
Waiting for RouterBOARD...
Has anyone else managed to get this approach to work on MacOSX?
I’ll play around with this some more tomorrow. I had started working on a container and thought it was easier to just run the binary, but since there isn’t a MacOS binary this is a great use case for the containerized version.

Who is online

Users browsing this forum: No registered users and 16 guests