Loading

Installing CHR on CentOS

svg14/02/2022LinuxDenny

Login as root.

Check IP address:

$ ip r

make install.sh files:

$ vi install.sh

copy paste following code:

wget https://download.mikrotik.com/routeros/6.49.2/chr-6.49.2.img.zip -O chr.img.zip  && \
gunzip -c chr.img.zip > chr.img  && \
mount -o loop,offset=512 chr.img /mnt && \
ADDRESS=`ip addr show eth1 | 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 dns set servers=8.8.8.8,8.8.4.4" > /mnt/rw/autorun.scr && \
umount /mnt && \
echo u > /proc/sysrq-trigger && \
dd if=chr.img bs=1024 of=/dev/vda && \
echo "sync disk" && \
echo s > /proc/sysrq-trigger && \
echo "Sleep 6 seconds" && \
sleep 6 && \
echo "Ok, reboot" && \
echo b > /proc/sysrq-trigger

choose your chr version you want to download. change eth1 with your interface. Change /dev/vda with your diskname.

check diskname:

$ lsblk

check interface name:

$ ip a

save install.sh file. then make it executable and run it.

$ chmod +x install.sh
$ /install.sh

done.

Denny Kristna

Motobike & food lovers. Father of four. Workin' on some linux & mikrotik servers. Just simply, enjoyable journey.

svg

What do you think?

Show comments / Leave a comment

Leave a reply

svg
Quick Navigation
  • 01

    Installing CHR on CentOS

Kosmo Dapatkan notifikasi untuk setiap update yang ada.
Dismiss
Allow Notifications