Monday, 11 December 2023

Cisco Command lines

 


Commands in MikroTik Router OS



Basic commands for Mikrotik Router OS – It is definitely confusing for those of you who are just learning to use Mikrotik with the command (command line) used in Router OS. Whereas, many basic commands of Mikrotik are important to be known so that user will utilize the Router OS well. Actually, the basic commands of  MikroTik Router OS have not much different from
the basic commands in Linux in general. Because, the Mikrotik is actually an outgrowth of the Debian linux kernel.


Router OS mikrotik shell commands is just the same as Linux’s, like efficient in writing the command; imply use the TAB key on the keyboard to make a long command; no longer need to be typed; simply type the initial command, then Shell will automatically display the complete commands. For example, the IP ADDRESS commands on mikrotik. It is simply type the IP ADD, then press spacebar and press the TAB key, then the shell will automatically recognize and translate the IP ADDRESS command.

Here are the basic commands of Mikrotik that are commonly used:

1 . Commands to shutdown and restart the computer, type:
[ admin @ MikroTik ] > system shutdown (to shutdown the computer)
[ admin @ MikroTik ] > system reboot (to restart the computer)
[ admin @ MikroTik ] > system reset ( to reset  predefined configuration). Please keep in mind that the commands should be performed on the admin directory.

2 . Commands to change the name of the Mikrotik machine, type:
[ admin @ MikroTik ] > /system identity
[ admin @ MikroTik ] > system identity> set name = proxy
To view the configuration, type "print" or "pr"
E.g. [ admin @ MikroTik ] system identity > pr name: " proxy "
Then the console will turn into [ admin @ proxy ]

3 . Commands to change the password of MikroTik machine, type:
[ admin @ proxy ] > /password
[ admin @ proxy ] password > old password (if you have not set a password then enter empty)
[admin @ proxy ] password > new password : ...... (type the new password)
[admin @ proxy ] password > Retype new password : ........ (insert once again password)

For example:
If the old password is empty and the new password is ABCD, then the command is as follows:
[ admin @ proxy ] > /password
[ admin @ proxy ] password > old password
[ admin @ proxy ] password > new password ABCD
[ admin @ proxy ] password > Retype new password ABCD

4 . Commands to see the condition of the interface on Mikrotik Router:

[ admin @ MikroTik ] > interface print
Flags : X - disabled , D - dynamic , R - running
# NAME TYPE RX - RATE TX - RATE MTU
0 R ether1 ether 0 0 1500
1 R ether2 ether 0 0 1500
[ admin @ MikroTik ] >

If there is an X interface ( disabled ) after the number ( 0.1 ), then check again
the ethernet card; it should be R (running).

a. Change the interface name
    [admin @ MikroTik ] > interface ( enter)
b . To change the name of Interface ether1 into the Public (or whatever), then:
    [admin @ MikroTik ] interface > set 0 name = Public
c . So does for ether2, it supposed to change the name into Local, then
    [admin @ MikroTik ] interface > set 1 name = Local
d . Or just from the position of the root directory, put the sign " / " , without the quotes
    [admin @ MikroTik ] > /interface set 0 name = Public
e . Check again if the name of the interface has been changed
    [ admin @ MikroTik ] > /interface print
    Flags : X - disabled , D - dynamic , R - running
   # NAME TYPE RX - RATE TX - RATE MTU
   0 R Local ether 0 0 1500
   1 R Public ether 0 0 1500

5 . Commands to see the package software of MikroTik OS :
[ admin @ proxy ] > /system package
[ admin @ proxy ] system package > print or pr> <type

With the command above, then it will appear the package software of MikroTik Os.
For example:

[ admin @ MikroTik system package > pr
Flags : X - disabled
 # Name
0 X routing - test
1 dhcp
2 radiolan
3 user - manager
4 X webproxy - test
5 arlan
6 isdn
7 hotspot -fix
8 ppp
9 wireless
10 web - proxy
11 hotspots
12 advanced -tools
13 security
14 Telephony
15 routing
16, synchronous
17 system
18 routerboard
19 RSTP - bridge - test
20 X wireless- legacy

To see more details, then type:
     [ admin @ proxy ] system package > pr detail fl gs : X - disabled
0 X name = " routing - test" version = " 2.9.27 " build - time = 10:57:53 jul/03/2006 scheduled
1 name = " system " version = " 2.9.27 " build - time = jul/03/2006 10 : 56:37 schedule
2 name = " system " version = " 2.9.27 " build - time = jul/03/2006 10 : 56 : 44 schedule
3 name = " web - proxy " version = " 2.9.27 " build-time = jul/03/2006 10 : ` 58 : 03 schedule
4 name = " advanced - tools" version = " 2.9.27 " build-time = jul / 03 / 2006 10:56 GMT : 41 Scheduled = " "
5 name = " dhcp " version = " 2.9.27 " build-time = 10:56:45 Scheduled jul/03/2006 = " "
6 name = " hotspot " version = " 2.9.27 " build-time = 10:56:58 Scheduled jul/03/2006 = " "
7 x name = " webproxy - test" version = " 2.9.27 " build-time = jul / 03 / 2006 10:57:52 Scheduled
8 name = " routerboard " version = " 2.9.27 " build-time = jul / 03 / 2006 10 : 57 : 17 - [ Q quit | D dump | up | down ]

6 . Commands to upgrade the router software package :
[ admin @ MikroTik ] system upgrade >
To upgrade chosen packages:
Download 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14

7 . Command to enable existing software packages in the MikroTik OS:
    [ admin @ MikroTik ] system page >
     Enable <type package will>
For example :
[ admin @ proxy ] system package > enable dhcp

8 . Command to change the name of Ethernet of the MikroTik OS on the machine:
[ admin @ proxy ] > /interface
[ admin @ proxy ] interfaces > ethernet set Ethernet name = public
Or by using the command
[ admin @ proxy ] interface > set <type number ethernet used>
 name = new ethernet <username> >
For example :
[ admin @ proxy ] interface > set 0 name = public
[ admin @ proxy ] interface > set 1 name = lan
or
[ admin @ proxy ] interface >
set 0 name = public ; set 1 name = lan

9 . Commands to set the IP address on the machine MikroTik OS :
[ admin @ proxy ] > ip address
[ admin @ proxy ] ip address >
Add interface = <username> interface> address =
( type the IP address /subnet mask interface)
example :
If the interface name " Ian " and the IP address that you want: 192.168.01 and subnet mask : 255.255.255.0, then the command are as follows:
[ admin @ proxy ] > /ip address
[ admin @ proxy ] ip address >
Add interface = lan address = 192.168.0.1/24

10 . Commands setting primary and Secondary DNS IP:
[ admin @ proxy ] . /ip dns
[ admin @ proxy ] ip dns >
Set the name - dns > = <IP dns of ISP>

For example :
If IP DNS the primary ISP: 202.134.1.10 and secondary :
202.134.0.0155, then the command are as follows :
[ admin @ proxy ] . /ip dns
[ admin @ proxy ] ip dns >
Set primary - dns = 202.134.1.10
[ admin @ proxy ] ip dns >
Set secondary - dns = 202.134.0.155

11 . Commands to set IP gateway settings on the machine MikroTik OS:
[ admin @ proxy ] > /ip route
[ admin @ proxy ] ip route > add gateway = < ip gateway
Examples of ISP's gateway IP : 202.134.1.1, then the commands are:
[ admin @ proxy ] > /ip route
[ admin @ proxy ] ip route >
add gateway = 202.134.1.1

12 . Commands Translate Network address (NAT) on the MikroTik OS machine
[ admin @ proxy ] > /ip firewall nat
[ admin @ proxy ] ip firewall nat >
add chain = srcnat out-interface = < interface connected
WAN networks > scr-address =
< network-id interface connected to the LAN / subnet mask interface
LAN > action = masquerade

For example :
if the LAN interface network - id : "192.168.0.0" and subnet
Mask : " 255.255.255.0 " . for MikroTik OS machine interface that is connected to the network
WAN : " public ", then the command are as follows :
[ admin @ proxy ] > /ip firewall nat
[ admin @ proxy [ ip firewall nat >
Add chain = srcnat out-interface = public
Src-address = 192.168.0.0/24 action = masquerade