Home > Mikrotik > MikroTik Cloud Hosted Router User Guide

MikroTik Cloud Hosted Router User Guide

echo "The system is updated and required packages are installed."  
# Determine the root file system device  
root_device=$(df / | awk 'NR==2 {print $1}')  
root_device_base=$(echo $root_device | sed 's/[0-9]\+$//')  
echo "Root filesystem is on device: $root_device"  
echo "Device path: $root_device_base"  
# Create and mount a temporary directory  
mkdir /mt_ros_tmp && mount -t tmpfs tmpfs /mt_ros_tmp/ && cd /mt_ros_tmp  
# Get IP address and gateway  
INTERFACE=$(ip route | grep default | awk '{print $5}')  
ADDRESS=$(ip addr show "$INTERFACE" | grep global | cut -d' ' -f 6 | head -n 1)  
GATEWAY=$(ip route list | grep default | cut -d' ' -f 3)  
echo "Please enter the channel (default='stable', or='testing'): "  
read channel  
# Default to 'stable' if no input is provided  
if [ -z "$channel" ]; then  
channel="stable"  
echo "Installing RouterOS CHR from the '$channel' channel..."  
# Download URL based on selected channel  
if [ "$channel" == "testing" ]; then  
rss_feed="https://download.mikrotik.com/routeros/latest-testing.rss"  
else  
rss_feed="https://download.mikrotik.com/routeros/latest-stable.rss"  
# Download the latest version of MikroTik RouterOS  
rss_content=$(curl -s $rss_feed)  
latest_version=$(echo "$rss_content" | grep -oP '(?<=<title>RouterOS )[\d\.]  
+rc\d+' | head -1)  
if [ -z "$latest_version" ]; then  
echo "Could not retrieve the latest version number."  
exit 1  
echo "Latest version: $latest_version"  
$latest_version.img.zip"  
echo "Downloading from $download_url..."  
wget --no-check-certificate -O "chr-$latest_version.img.zip" "$download_url"  
if [ $? -eq 0 ]; then  
echo "File successfully downloaded: chr-$latest_version.img.zip"  
else  
echo "File download failed."  
exit 1  
# Unzip and prepare the image  
gunzip -c "chr-$latest_version.img.zip" > "chr-$latest_version.img"  
# Mount the image  
mount -o loop "chr-$latest_version.img" /mnt  
# Generate a random password  
PASSWORD=$(pwgen 12 1)  
# Write autorun script to configure the RouterOS instance  
echo "Username (Kullanıcı adı): admin"  
echo "Password (Şifre): $PASSWORD"  
echo "/ip address add address=$ADDRESS interface=[/interface ethernet find  
where name=ether1]" > /mnt/rw/autorun.scr  
echo "/ip route add gateway=$GATEWAY" >> /mnt/rw/autorun.scr  
echo "/ip service disable telnet" >> /mnt/rw/autorun.scr  
echo "/user set 0 name=admin password=$PASSWORD" >>  
/mnt/rw/autorun.scr  
echo "/ip dns set server=8.8.8.8,1.1.1.1" >> /mnt/rw/autorun.scr  
# Remount all mounted filesystems to read-only mode  
sync && echo u > /proc/sysrq-trigger  
# Flash the image to the disk  
dd if="chr-$latest_version.img" of=$root_device_base bs=4M oflag=sync  
# Force system reboot  
echo 1 > /proc/sys/kernel/sysrq  
echo b > /proc/sysrq-trigger  
ONE-LINER (Short) SCRiPT for Automated Installations  
if command -v yum &> /dev/null; then pkg_manager="yum"; elif command -v  
apt &> /dev/null; then pkg_manager="apt"; else echo "Neither yum nor apt  
found. This script is not supported."; exit 1; fi && \  
[ "$pkg_manager" == "yum" ] && sudo yum -y update && sudo yum -y install  
unzip pwgen coreutils || [ "$pkg_manager" == "apt" ] && sudo apt-get -y  
update && sudo apt-get -y install unzip pwgen coreutils && \  
root_device=$(df / | awk 'NR==2 {print $1}') && root_device_base=$(echo  
$root_device | sed 's/[0-9]\+$//') && \  
echo "Root filesystem is on device: $root_device" && echo "Device path:  
$root_device_base" && \  
mkdir /mt_ros_tmp && mount -t tmpfs tmpfs /mt_ros_tmp/ && cd /mt_ros_tmp  
&& \  
GeneralDetails
NameMikroTik Cloud Hosted Router User Guide
MakeMikrotik
LanguageEnglish
FiletypePDF (Download)
File size0.08 MB
Download PDF
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
Loading...

If you have any questions regarding MikroTik Cloud Hosted Router User Guide, please ask here and describe the problem in detail.

Leave a Reply

Your email address will not be published. Required fields are marked *

four × four =

mikrotik RB960PGS Hex PoE 5-Port Router User Manual
mikrotik RB960PGS Hex PoE 5-Port Router User Manual
MikroTik RB750r2 hEX Lite Router User Guide
MikroTik RB750r2 hEX Lite Router User Guide
MikroTik C52iG-5HaxD2HaxD-TC Wireless Router User Guide
MikroTik C52iG-5HaxD2HaxD-TC Wireless Router User Guide
MikroTik RBcAPGi-5acD2nD-XL Wireless Router User Guide
MikroTik RBcAPGi-5acD2nD-XL Wireless Router User Guide
MikroTik hAP ax³ Wireless Network Router User Manual
MikroTik hAP ax³ Wireless Network Router User Manual
MikroTik wAP ac Wireless Router User Manual
MikroTik wAP ac Wireless Router User Manual
MikroTik Chateau LTE18 ax Dual Band Wireless Router User Manual
MikroTik Chateau LTE18 ax Dual Band Wireless Router User Manual
MikroTik RBMetalG-52SHPacn Metal Wireless Router User Manual
MikroTik RBMetalG-52SHPacn Metal Wireless Router User Manual
MIKROTIK 2004-1G-12S+2XS Cloud Core Router User Manual
MIKROTIK 2004-1G-12S+2XS Cloud Core Router User Manual
MikroTik RBwAPG-5HacD2HnD Wireless Router User Guide
MikroTik RBwAPG-5HacD2HnD Wireless Router User Guide

MikroTik Cloud Hosted Router User Guide