How To Convert Ubuntu 19.04 Server To MikroTik Router Using Script4 min read
MikroTik is the best router so I want to share how to convert Ubuntu 19.04 server to the MikroTik router using script. MikroTik router easy manages from winbox client soft. Remember if you use this script on your laptop then can’t get back previous operating system. So be careful using this guide. This guide for using mainly vps or virtual system, not for use physical server.
★ How To Add Windows Host In Zabbix Server
★ Monitor mysql Service In My Zabbix Server
MikroTik chr version : 6.44.6
Ubuntu version : 19.04
MikroTik default user : admin
MikroTik default password : don’t needed
Step #01: Check my ubuntu server like version & ip using below command.
root@Ubuntu-16:~# lsb_release -a
No LSB modules are available.
Distributer ID: Ubuntu
Description: Ubuntu 16.04.6 LTS
Release: 16.04
Codename: xenial
Step #02: Open script file and copy my provided script
vi script.sh
#!/bin/bash wget https://download.mikrotik.com/routeros/6.44.6/chr-6.44.6.img.zip -O chr.img.zip && \ gunzip -c chr.img.zip > chr.img && \ mount -o loop,offset=512 chr.img /mnt && \ ADDRESS=`ip addr show eth1 | grep global | cut -d' ' -f 6 | head -n 1` && \ GATEWAY=`ip route list | grep default | cut -d' ' -f 3` && \ echo "/ip address add address=$ADDRESS interface=[/interface ethernet find where name=ether1] /ip route add gateway=$GATEWAY /ip service disable telnet /user set 0 name=root password=xxxxxx " > /mnt/rw/autorun.scr && \ umount /mnt && \ echo u > /proc/sysrq-trigger && \ dd if=chr.img bs=1024 of=/dev/xvda && \ echo "sync disk" && \ echo s > /proc/sysrq-trigger && \ echo "Sleep 5 seconds" && \ sleep 5 && \ echo "Ok, reboot" && \ echo b > /proc/sysrq-trigger
Then press Esc :wq then press Enter for save file.
Step #03: If your server disk name xvda so not needed any change script.
Check your server disk name using below command.
root@Ubuntu-16:~# lsblk
when you see disk is xvda so it is fine not change from script. But if you see another disk name so must be change it.
If you see any problem please see my YouTube channel for more details.
- How To Install Zabbix Server 6.4 On AlmaLinux 8 Server - August 9, 2024
- How To Clear RAM Memory Cache Buffer Linux Server - February 29, 2024
- How To Install Apache Cloud Stack Management Server 4.17 On Ubuntu 22.04 - February 1, 2024
We really appreciate for your support for buying me a coffee.
It takes us a while to compose and upload new content, as they have to be checked to see if Properly works. We appreciate you if you help me for one cup of coffee to keep us awake and always deliver good quality content.
No contribution is small of an amount. We are grateful for any amount you support us with. Thank you!
Not conversion, overwtire the disk
Yes, You are right. Server convert and disk overwrite.
Thanks.
Im installed on ubuntu virtual server. what can access this on winbox (Remote Access)
Download winbox then connect using
server ip
username admin
password is blank.
Thanks.
Hello, I need to do the same process but with RouterOS 7
Sure, This is same process. Thanks.
hello i do it, but after installing and reboot server not work, no ping but in VNC i can see mikrotik installed, whats the problem ? thanks
Which MikroTik version you installed? latest version have issue.
Thanks.
I am a newbie and I mistakenly ran this script on my laptop terminal instead of terminal server.
Now, when the system boots, it stays on the load and nothing happens
How can I go back to the previous state?
Why your run this script without read this post.? Not possible back previous state.
Thanks.