Install MikroTik CHR on VPS: Difference between revisions
Jump to navigation
Jump to search
(Created initial page) |
m (Added note) |
||
Line 4: | Line 4: | ||
=Install= | =Install= | ||
Spin up VPS with some Debian based Linux distro and login. Then run the following to replace the install with a MikroTik CHR: | Spin up VPS with some Debian based Linux distro and login. Then run the following to replace the install with a MikroTik CHR: | ||
'''''Note: Replace the chr-6.40.1.img.zip with the version of Mikrotik's CHR that you wish to use.''''' | |||
apt-get install unzip | apt-get install unzip |
Latest revision as of 17:36, 7 July 2024
Misc notes on installing a MiktoTik CHR on a VPS
Install
Spin up VPS with some Debian based Linux distro and login. Then run the following to replace the install with a MikroTik CHR:
Note: Replace the chr-6.40.1.img.zip with the version of Mikrotik's CHR that you wish to use.
apt-get install unzip wget https://download2.mikrotik.com/routeros/6.40.1/chr-6.40.1.img.zip -O chr.img.zip && \ gunzip -c chr.img.zip > chr.img && \ mount -o loop,offset=33554944 chr.img /mnt && \ ADDRESS=`ip addr show ens3 | 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 " > /mnt/rw/autorun.scr && \ umount /mnt && \ echo u > /proc/sysrq-trigger && \ dd if=chr.img bs=1024 of=/dev/vda && \ reboot
- Once done you should have the system power off and then back on to reboot into the MikroTik CHR
Config Networking on CHR
Set $ADDRESS and $GATEWAY first or replace them in the line below (as it appears in the script above) with the actual values
echo "/ip address add address=$ADDRESS interface=[/interface ethernet find where name=ether1] /ip route add gateway=$GATEWAY