Mikrotik is a company engaged in the production of hardware (hardware) and software (Software) associated with computer network system headquartered in Latvia, adjacent to Russia. Mikrotik was founded in 1995 to develop a wireless router and ISP (Internet Service Provider) system.
Mikrotik provides one of convenience when we write commands so as not to long-term. For example if we will type the system reset-configuration command, we only need to type the first 3 letters "SYS" then press "TAB" on your keyboard and the "SYSTEM" command will appear as well as other commands.
1. Install the adapter and the LAN cable according to your network topology.
4. Let us configure mikrotik via CLI by clicking New Terminal menu and will appear Mikrotik Terminal window.
A. Mikrotik Identity Configuration
To change the identity of mikrotik, type the script command as follows and then enter:
[code h1="1, 4, 7"]
/system identity set name=[ Your Mikrotik Name ]
[/code]
B. Configure IP Addresses in any Mikrotik Ethers
To change the IP address of mikrotik, type the script command as follows and then enter:
[code h1="1, 4, 7"] /ip address add address=[ Your IP Address ] interface=[Ether to use] disabled=no [/code]
To check the IP Address configuration, you can use the following script:
[code h1="1, 4, 7"] ip address print [/code]
C. Configuring Gateway Routing On Mikrotik
To give a route gateway, type the script command as follows and then enter:
[code h1="1, 4, 7"] /ip route add gateway=[Your Gateway IP] [/code]
To check the Routing configuration, you can use the following script:
[code h1="1, 4, 7"] ip route print [/code]
D. Configure DNS And Firewall On Mikrotik
In order for us to access a domain site like
http://cyberpassnettech.blogspot.co.id or
https://www.google.com we have to configure a DNS (Domain Name System) first by typing the script command as follows and then enter:
» Simple DNS
[code h1="1, 4, 7"] /ip dns set servers=8.8.8.8,8.8.4.4 allow-remote-requests=yes [/code]
» Static DNS
[code h1="1, 4, 7"] /ip dns static add name=[Your DNS Name] address=[Your DNS IP] [/code]
» Checking DNS Configuration
[code h1="1, 4, 7"] ip dns print [/code]
And so that client can get internet access, we have to configure firewall first by typing command script as follows and then enter:
[code h1="1, 4, 7"] /ip firewall nat add chain=srcnat protocol=tcp out-interface=[Ether used as the Internet access recipient of your ISP (Internet Service Provider)] action=masquerade [/code]
E. Checking Ping Connection
To check the connection ping, you simply type the command:
[code h1="1, 4, 7"]ping 8.8.8.8 [If you have not set up DNS]
Or
Ping google.com [If you have set up DNS] [/code]
F. Configure the DHCP Server
In order for the client to obtain the IP Address automatically, we must configure the DHCP Server in mikrotik first by typing the script command as follows and then enter:
[code h1="1, 4, 7"] /ip dhcp-server setup [/code]
Then type the ether you want to create DHCP Server, then enter it until it's done.
If you want to limit the clients who get the DHCP IP Address, you can set the "addresses to give out".
Example: Address to give out: 192.168.0.2 - 192.168.0.100 then we limit the DHCP Server to IP address starting from 192.168.0.2 up to 192.168.0.100.
G. Configure Proxy To Block Sites And File Extensions
If you want to block a site or an extension file like mp3, mkv, avi, zip and so on, type the following script command and then enter:
[code h1="1, 4, 7"]/ip proxy set enabled=yes cache-administrator=[Your Name Or Email] cache-on-disk=yes
/ip proxy access add dst-host=*[Sites You Want to Block]* action=deny
/ip proxy access add path=*[Extension Files That You Want to Block]* action=deny
/ip firewall nat add chain=dstnat protocol=tcp dst-port=80 action=redirect to-ports=8080 disabled=no[/code]
If you want to see the proxy configuration, just type:
[code h1="1, 4, 7"] ip proxy print [/code]
After that change the IP address of your computer to "Obtain an IP address automatically" to get the IP address automatically.
After that open the site you blocked earlier in the browser and see the results will be filtered to the proxy server and displays Error Forbidden.
Likewise also with file extensions that you have blocked.
That's how I can post about
How to Configure Mikrotik Using CLI. Interested in using Command Line Interface Mode? Please you can practice the script that I share above and hopefully it is useful for you. If there is any criticism or feedback about this post, you can advise in the comments field. thanks.