Line 6: |
Line 6: |
| = General Information = | | = General Information = |
| Mikrotik Website: https://mikrotik.com/ | | Mikrotik Website: https://mikrotik.com/ |
| + | |
| + | = MikroTik CHR on VPS = |
| + | Instructions for installing the MikroTik Cloud Hosted Router (CHR) on a VPS provider. |
| + | |
| + | Note: You will be overwriting the existing VPS server using this guide. |
| + | |
| + | == Preparation == |
| + | *Spin up a VPS using a Debian based Linux distro |
| + | **Choose one with at least one CPU and 512MB of memory. You can go larger or smaller as your needs dictate. |
| + | *Login to VPS |
| + | |
| + | == Installation == |
| + | *Run the following to replace the Linux install on the VPS. |
| + | |
| + | Note: Adjust the /dev/vda listed in the last line to match the actual drive used in the VPS. |
| + | |
| + | *First make sure the packages information is up to date |
| + | |
| + | apt-get update |
| + | |
| + | *Ensure unzip is installed |
| + | |
| + | apt-get install unzip |
| + | |
| + | *Set '''$ADDRESS''' to the IP address the MikroTik CHR will use |
| + | *Set $GATEWAY to the IP address of the Gateway the MikroTik CHR will use |
| + | |
| + | set $ADDRESS="1.1.1.1" |
| + | set $GATEWAY="2.2.2.2" |
| + | |
| + | *Then copy and run the entire block of commands below into the terminal |
| + | |
| + | wget https://download.mikrotik.com/routeros/6.48.3/chr-6.48.3.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 |
| + | |
| + | *Once you successfully complete the above, power off (do not shut down) the VPS and then turn it back on to boot into MikroTik CHR. |
| + | |
| + | *Login to the MikroTik CHR via the terminal using admin for the username with no password |
| + | *Change the default admin password with: |
| + | /user set name=admin password=<new password> |
| + | |
| + | == Network Configuration == |
| + | Set $ADDRESS and $GATEWAY first or replace them in the line below with the actual values. |
| + | echo "/ip address add address=$ADDRESS interface=[/interface ethernet find where name=ether1] /ip route add gateway=$GATEWAY" |
| + | |
| + | *If the above does not work on setting the IP address and gateway properly: |
| + | **Set IP address with: '''/ip addres interface=ether1 add address=<ip address> netmask=<netmask>''' |
| + | **Set Gateway IP address with: '''/ip route add dst-address=0.0.0.0/0 gateway=<gateway IP>''' |
| + | |
| + | *Now login to the web page of your MikroTik CHR using http://<IP> or download Winbox from https://mikrotik.com/download to login and configure your MikroTik CHR. |
| + | *Read the documentation at https://help.mikrotik.com/docs/display/ROS/Getting+started pay special attention to the First Time Configuration section |
| | | |
| = AMPRNet/44Net = | | = AMPRNet/44Net = |