Skip to content

Instantly share code, notes, and snippets.

@DeckerSU
Forked from amingholami/make-chr.sh
Created June 2, 2022 12:00
Show Gist options
  • Save DeckerSU/0754674980883f6231ba4fef6f635e22 to your computer and use it in GitHub Desktop.
Save DeckerSU/0754674980883f6231ba4fef6f635e22 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment