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.
★ 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.
Leave a Comment