-
-
Save amingholami/8c71bf2dbd95bd1ad187dd078635d7bf to your computer and use it in GitHub Desktop.
Revisions
-
amingholami revised this gist
Apr 11, 2021 . 1 changed file with 5 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,21 +10,21 @@ Install Mikrotik CHR on Digital Ocean Ubuntu 18.04 LTS Droplet. Tested 11/2021 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] @@ -38,5 +38,6 @@ password: [EMPTY] 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 -
amingholami revised this gist
Apr 11, 2021 . 1 changed file with 41 additions and 55 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,56 +1,42 @@ 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. So 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 using Had disk. 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 find it 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. Have Fun -
amingholami revised this gist
Jul 22, 2020 . No changes.There are no files selected for viewing
-
amingholami revised this gist
Jul 22, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ # # Digital Ocean Ubuntu 16.04.6 Droplet # Running: # wget https://gist.githubusercontent.com/amingholami/8c71bf2dbd95bd1ad187dd078635d7bf/raw/112d7ee81a0e499aa27e8321c1d31f0bce3024c0/make-chr.sh # chmod +x make-chr.sh # ./make-chr.sh # -
amingholami revised this gist
Jul 22, 2020 . 1 changed file with 9 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,19 +6,19 @@ # chmod +x make-chr.sh # ./make-chr.sh # wget https://download.mikrotik.com/routeros/6.42.3/chr-6.42.3.img.zip -O chr.img.zip && \ gunzip -c chr.img.zip > chr.img && \ apt-get update && \ apt install -y qemu-utils pv && \ qemu-img convert chr.img -O qcow2 chr.qcow2 && \ qemu-img resize chr.qcow2 1073741824 && \ modprobe nbd && \ qemu-nbd -c /dev/nvme0n1 chr.qcow2 && \ echo "Give some time for qemu-nbd to be ready" && \ sleep 2 && \ partprobe /dev/nvme0n1 && \ sleep 5 && \ mount /dev/nvme0n1p2 /mnt && \ ADDRESS=`ip addr show eth0 | grep global | cut -d' ' -f 6 | head -n 1` && \ GATEWAY=`ip route list | grep default | cut -d' ' -f 3` && \ PASSWORD="CHANGEME" && \ @@ -31,14 +31,14 @@ echo "/ip address add address=$ADDRESS interface=[/interface ethernet find where " > /mnt/rw/autorun.scr && \ umount /mnt && \ echo "Magic constant is 65537 (second partition address). You can check it with fdisk before appliyng this" && \ echo "This scary sequence removes seconds partition on nvme0n1 and creates new, but bigger one" && \ echo -e 'd\n2\nn\np\n2\n65537\n\nw\n' | fdisk /dev/nvme0n1 && \ e2fsck -f -y /dev/nvme0n1p2 || true && \ resize2fs /dev/nvme0n1p2 && \ sleep 1 && \ echo "Compressing to gzip, this can take several minutes" && \ mount -t tmpfs tmpfs /mnt && \ pv /dev/nvme0n1 | gzip > /mnt/chr-extended.gz && \ sleep 1 && \ killall qemu-nbd && \ sleep 1 && \ -
stroebs revised this gist
Aug 31, 2019 . 1 changed file with 8 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,11 @@ #!/bin/bash # # Digital Ocean Ubuntu 16.04.6 Droplet # Running: # wget https://gist.githubusercontent.com/stroebs/54fc09734a3911e91eeeb43434f117df/raw/1ede2fb162d404171122db0c84a9eeea468a92cd/make-chr.sh # chmod +x make-chr.sh # ./make-chr.sh # wget http://download2.mikrotik.com/routeros/6.37/chr-6.37.img.zip -O chr.img.zip && \ gunzip -c chr.img.zip > chr.img && \ apt-get update && \ -
stroebs revised this gist
Aug 31, 2019 . No changes.There are no files selected for viewing
-
stroebs revised this gist
Aug 31, 2019 . 1 changed file with 9 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,21 +1,25 @@ wget http://download2.mikrotik.com/routeros/6.37/chr-6.37.img.zip -O chr.img.zip && \ gunzip -c chr.img.zip > chr.img && \ apt-get update && \ apt install -y qemu-utils pv && \ qemu-img convert chr.img -O qcow2 chr.qcow2 && \ qemu-img resize chr.qcow2 1073741824 && \ modprobe nbd && \ qemu-nbd -c /dev/nbd0 chr.qcow2 && \ echo "Give some time for qemu-nbd to be ready" && \ sleep 2 && \ partprobe /dev/nbd0 && \ sleep 5 && \ mount /dev/nbd0p2 /mnt && \ ADDRESS=`ip addr show eth0 | grep global | cut -d' ' -f 6 | head -n 1` && \ GATEWAY=`ip route list | grep default | cut -d' ' -f 3` && \ PASSWORD="CHANGEME" && \ 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=$PASSWORD /ip dns set servers=1.1.1.1,1.0.0.1 /system package update install " > /mnt/rw/autorun.scr && \ umount /mnt && \ echo "Magic constant is 65537 (second partition address). You can check it with fdisk before appliyng this" && \ @@ -35,6 +39,7 @@ echo "Warming up sleep" && \ sleep 1 && \ echo "Writing raw image, this will take time" && \ zcat /mnt/chr-extended.gz | pv > /dev/vda && \ echo "Don't forget your password: $PASSWORD" && \ echo "Sleep 5 seconds (if lucky)" && \ sleep 5 || true && \ echo "sync disk" && \ -
stroebs revised this gist
Nov 30, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ wget http://download2.mikrotik.com/routeros/6.40.5/chr-6.40.5.img.zip -O chr.img.zip && \ gunzip -c chr.img.zip > chr.img && \ apt-get update && \ apt install -y qemu-utils pv && \ qemu-img convert chr.img -O qcow2 chr.qcow2 && \ qemu-img resize chr.qcow2 `fdisk /dev/vda -l | head -n 1 | cut -d',' -f 2 | cut -d' ' -f 2` && \ modprobe nbd && \ -
stroebs revised this gist
Nov 30, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ wget http://download2.mikrotik.com/routeros/6.40.5/chr-6.40.5.img.zip -O chr.img.zip && \ gunzip -c chr.img.zip > chr.img && \ apt-get update && \ apt install -y qemu-utils pv partx && \ qemu-img convert chr.img -O qcow2 chr.qcow2 && \ qemu-img resize chr.qcow2 `fdisk /dev/vda -l | head -n 1 | cut -d',' -f 2 | cut -d' ' -f 2` && \ modprobe nbd && \ -
stroebs revised this gist
Nov 30, 2017 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,6 +8,7 @@ modprobe nbd && \ qemu-nbd -c /dev/nbd0 chr.qcow2 && \ echo "Give some time for qemu-nbd to be ready" && \ sleep 2 && \ partx -a /dev/nbd0 && \ mount /dev/nbd0p2 /mnt && \ ADDRESS=`ip addr show eth0 | grep global | cut -d' ' -f 6 | head -n 1` && \ GATEWAY=`ip route list | grep default | cut -d' ' -f 3` && \ -
stroebs revised this gist
Nov 22, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ wget http://download2.mikrotik.com/routeros/6.40.5/chr-6.40.5.img.zip -O chr.img.zip && \ gunzip -c chr.img.zip > chr.img && \ apt-get update && \ apt install -y qemu-utils pv && \ -
stroebs revised this gist
Oct 28, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ wget http://download2.mikrotik.com/routeros/6.40.4/chr-6.40.4.img.zip -O chr.img.zip && \ gunzip -c chr.img.zip > chr.img && \ apt-get update && \ apt install -y qemu-utils pv && \ -
stroebs created this gist
Oct 28, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,42 @@ wget http://download2.mikrotik.com/routeros/6.36.4/chr-6.40.4.img.zip -O chr.img.zip && \ gunzip -c chr.img.zip > chr.img && \ apt-get update && \ apt install -y qemu-utils pv && \ qemu-img convert chr.img -O qcow2 chr.qcow2 && \ qemu-img resize chr.qcow2 `fdisk /dev/vda -l | head -n 1 | cut -d',' -f 2 | cut -d' ' -f 2` && \ modprobe nbd && \ qemu-nbd -c /dev/nbd0 chr.qcow2 && \ echo "Give some time for qemu-nbd to be ready" && \ sleep 2 && \ mount /dev/nbd0p2 /mnt && \ ADDRESS=`ip addr show eth0 | 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 "Magic constant is 65537 (second partition address). You can check it with fdisk before appliyng this" && \ echo "This scary sequence removes seconds partition on nbd0 and creates new, but bigger one" && \ echo -e 'd\n2\nn\np\n2\n65537\n\nw\n' | fdisk /dev/nbd0 && \ e2fsck -f -y /dev/nbd0p2 || true && \ resize2fs /dev/nbd0p2 && \ sleep 1 && \ echo "Compressing to gzip, this can take several minutes" && \ mount -t tmpfs tmpfs /mnt && \ pv /dev/nbd0 | gzip > /mnt/chr-extended.gz && \ sleep 1 && \ killall qemu-nbd && \ sleep 1 && \ echo u > /proc/sysrq-trigger && \ echo "Warming up sleep" && \ sleep 1 && \ echo "Writing raw image, this will take time" && \ zcat /mnt/chr-extended.gz | pv > /dev/vda && \ echo "Sleep 5 seconds (if lucky)" && \ sleep 5 || true && \ echo "sync disk" && \ echo s > /proc/sysrq-trigger && \ echo "Ok, reboot" && \ echo b > /proc/sysrq-trigger