Skip to content

Instantly share code, notes, and snippets.

@mmsaffari
Forked from amingholami/make-chr.sh
Last active April 8, 2023 18:48
Show Gist options
  • Save mmsaffari/b8b928d8b66e3d01e64c6b8c963783ac to your computer and use it in GitHub Desktop.
Save mmsaffari/b8b928d8b66e3d01e64c6b8c963783ac to your computer and use it in GitHub Desktop.
Install Mikrotik CHR on a DigitalOcean Droplet (2021)
Install Mikrotik CHR on Digital Ocean Ubuntu 18.04 LTS Droplet. Tested 11/2021
1. Turn Off Droplet after creation and go to Recovery and set it to Boot from Recovery ISO.
2. Trun on Droplet and open Console
3. Press 6 and go to shell
4. Paste below code to install CHR on HDD
wget -O- https://download.mikrotik.com/routeros/7.8/chr-7.8.img.zip | funzip | dd of=/dev/vda bs=1M
5. Now, get IP address and Gateway by using below codes:
ADDRESS=`ip addr show eth0 | grep global | cut -d' ' -f 6 | head -n 1`
GATEWAY=`ip route list | grep default | cut -d' ' -f 3`
6. Store Address and Gateway in some place.
7. Turn off droplet and set the Recovery to normal and now using Had disk just like before.
7.1. DO NOT close the recovery console.
8. login to Mikrotik by using credintioal of
user: admin
password: [EMPTY]
9. So, type below codes to set the IP on Mikrotik console:
* Remember you have to replace Address and Gateway that you found them in step 5.
/ip address add address=[ADDRESS] interface=ether1
/ip route add gateway=[GATEWAY]
/ip dns set servers=8.8.8.8,8.8.4.4
/ip service disable telnet
10. Your Mikrotik CHR is now ready. try ping to google.com using:
/ping google.com
if it's OK, hit CTRL+C.
11. So, you can access your mikrotik by using winbox or a browser by opening the address.
* Remember to change your password and secure your CHR.
Have Fun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment