Showing posts with label mikrotik. Show all posts
Showing posts with label mikrotik. Show all posts

Wednesday, August 10, 2011

Securing Your Router Mikrotik

To protect your MikroTik RouterOS™, you should do following things:

Change admin's password

Just select the Password menu within the winbox GUI, for example:
Image:password_change.jpg
Or, type the following command in the CLI:
[admin@MikroTik] > / password 
old password: 
new password: ******
retype new password: ******
This will change your current admin's password to what you have entered twice. Make sure you remember the password! If you forget it, there is no recovery. You need to reinstall the router!

Add users to the system

You should add each user that is going to log on to the router as a separate user and specify group of privileges. Add yourself as user of group full (same as for admin), for example:
Image:new_user_add.jpg
You may create new groups for users with specific tasks.

Set up packet filtering

All packets with destination to the router are processed against the ip firewall filter's input chain. Note, that the input chain does not affect packets which are being transferred through the router!
You can add following rules to the input chain under /ip firewall filter (just 'copy and paste' to the router using Terminal Console or configure the relevant arguments in WinBox):
/ ip firewall filter
add chain=input connection-state=established comment="Accept established connections"
add chain=input connection-state=related comment="Accept related connections"
add chain=input connection-state=invalid action=drop comment="Drop invalid connections" 
add chain=input protocol=udp action=accept comment="UDP" disabled=no 
add chain=input protocol=icmp limit=50/5s,2 comment="Allow limited pings" 
add chain=input protocol=icmp action=drop comment="Drop excess pings" 
add chain=input protocol=tcp dst-port=22 comment="SSH for secure shell"
add chain=input protocol=tcp dst-port=8291 comment="winbox" 
# Edit these rules to reflect your actual IP addresses! # 
add chain=input src-address=159.148.172.192/28 comment="From Mikrotikls network" 
add chain=input src-address=10.0.0.0/8 comment="From our private LAN"
# End of Edit #
add chain=input action=log log-prefix="DROP INPUT" comment="Log everything else"
add chain=input action=drop comment="Drop everything else"
Use /ip firewall filter print input stats command to see how many packets have been processed against these rules. Use reset-counters-all command to reset the counters. Examine the system log file /log print to see the packets which have been dropped. 
You may need to include additional rules to allow access from certain hosts, etc. Remember that firewall rules are processed in the order they appear on the list! After a rule matches the packet, no more rules are processed for it. After adding new rules, move them up using the move command.
Note, if you mis-configured the firewall and have locked yourselves out from the router, you may use MAC telnet from another router or workstation on the same LAN to connect to your router and correct the problem.

Monday, May 9, 2011

Mikrotik MRTG / Graphing

Graphing adalah tool pada mokrotik yang difungsikan untuk memantau perubahan parameter-parameter pada setiap waktu. Perubahan perubahan itu berupa grafik uptodate dan dapat diakses menggunakan browser.
Graphing dapat menampilkan informasi berupa:
    * Resource usage (CPU, Memory and Disk usage)
    * Traffic yang melewati interfaces
    * Traffic yang melewati simple queues

Mengaktifkan fungsi graping
Klik menu Tool >Graphing>Resource Rules
Adalah mengaktifkan graphing untuk resource usage Mikrotik. Sedangkana allow address adalah IP mana saja yang boleh mengakses grafik tersebu,. 0.0.0.0/0 untuk semua ip address.
 Klik menu Tool>Graphing>Interface Rules
Adalah mengaktifkan graphing untuk monitoring traffic yang melewati interface, silahkan pilih interface yg mana yang ingin dipantau, atau pilih “all” untuk semua.
Graphing terdiri atas dua bagian, pertama mengumpulkan informasi/ data yang kedua menampilkanya dalam format web. Untuk mengakses graphics, ketik URL dengan format http://[Router_IP_address]/graphs/ dan pilih dari menu-menu yang ada, grafik mana yang ingin ditampilkan.
Contoh hasil grafik untuk traffic interface public:




 
Demikian, tutorial yang sedikit penulis sampaikan untuk sekedar membagi ilmu atau menyederhanakan untuk memudahkan pemahaman dari tutorial yang sudah tersedia di situs resmi mikrotik.