Skip to content

Instantly share code, notes, and snippets.

@amingholami
Forked from stroebs/make-chr.sh
Last active April 24, 2024 18:13
Show Gist options
  • Star 18 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save amingholami/8c71bf2dbd95bd1ad187dd078635d7bf to your computer and use it in GitHub Desktop.
Save amingholami/8c71bf2dbd95bd1ad187dd078635d7bf 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/6.48.1/chr-6.48.1.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.
8. Open Console again and 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
@aungthawdar
Copy link

Thanks for right/clear instruction for Install CHR at DO. 👍

@arkashiks
Copy link

Many thanks for this, I was struggling with some scripts suitable for Ubuntu 16.x which weren't working now.

@AnonymousWebHacker
Copy link

and to install a version 7.x?

@rexsllemel
Copy link

and to install a version 7.x?

Replace the link with this link:
https://download.mikrotik.com/routeros/7.2.3/chr-7.2.3.img.zip

@Ki4wn
Copy link

Ki4wn commented Oct 11, 2022

very pleasent and working instruction .
if you install the lastest 7.X version it needs to set a mac address .
just dont forget to setup
/interface ethernet set ether1 mac-address=[MACADDRESS]
mac address format should be XX:XX:XX:XX:XX

@T-helper
Copy link

Thanks a lot, it save my day !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment