cara install mikrotik di ubuntu menggunakan script
- login ke ubuntu as aroot
- cek interface name : #ip addr
@ubuntusever:~$ ifconfigens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.15 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 2001:448a:2002:8cb8:20c:29ff:feae:5bcf prefixlen 64 scopeid 0x0<global>
- cek hdd name #fdisk -l
root@ubuntusever:/home# fdisk -l
Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors
Disk model: VMware Virtual S
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
Input Semua Parameter kedalam script
buat bash script mikrotik.sh
#pico mikrotik.sh
#!/bin/bash
wget https://download.mikrotik.com/routeros/7.5/chr-7.5.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 ens33 | 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=fery password=fery123"
echo u > /proc/sysrq-trigger && \
dd if=chr.img bs=1024 of=/dev/sda && \
echo "sync disk" && \
echo s > /proc/sysrq-trigger && \
echo "Sleep 5 seconds" && \
sleep 5 && \
echo "Ok, reboot" && \
echo b > /proc/sysrq-trigger
buat sebagai exe file
#chmod 775 script.sh
running mikrotik.sh
./mikrotik.sh
Link Tutorial
https://script.technologyrss.com/how-to-install-mikrotik-router-on-ubuntu-22-04-server-using-script/