Tuesday, June 21, 2016

How To Recover User Manager Password

0 comments


  1. /tool user-manager customer print

Sunday, June 19, 2016

Check IP Pool Statistics

0 comments
 
  • /ip pool {
  • :local poolname
  • :local pooladdresses
  • :local poolused
  • :local poolpercent
  • :local minaddress
  • :local maxaddress
  • :local findindex
  • :local tmpint
  • :local maxindex
  • :local line
  • :put ("IP Pool Statistics")
  • :put ("------------------")
  • :foreach p in=[find] do={
  • :set poolname [get $p name]
  • :set pooladdresses 0
  • :set poolused 0
  • :set line ""
  • :set line (" " . $poolname)
  • :foreach r in=[:toarray [get $p range]] do={
  • :set findindex [:find [:tostr $r] "-"]
  • :if ([:len $findindex] > 0) do={
  • :set minaddress [:pick [:tostr $r] 0 $findindex]
  • :set maxaddress [:pick [:tostr $r] ($findindex + 1) [:len [:tostr $r]]]
  • } else={
  • :set minaddress [:tostr $r]
  • :set maxaddress [:tostr $r]
  • }
  • :for x from=0 to=([:len [:tostr $minaddress]] - 1) do={
  • :if ([:pick [:tostr $minaddress] $x ($x + 1)] = ".") do={
  • :set minaddress ([:pick [:tostr $minaddress] 0 $x] . "," . \
  • [:pick [:tostr $minaddress] ($x + 1) [:len [:tostr $minaddress]]]) }
  • }
  • :for x from=0 to=([:len [:tostr $maxaddress]] - 1) do={
  • :if ([:pick [:tostr $maxaddress] $x ($x + 1)] = ".") do={
  • :set maxaddress ([:pick [:tostr $maxaddress] 0 $x] . "," . \
  • [:pick [:tostr $maxaddress] ($x + 1) [:len [:tostr $maxaddress]]]) }
  • }
  • :if ([:len [:toarray $minaddress]] = [:len [:toarray $maxaddress]]) do={
  • :set maxindex ([:len [:toarray $minaddress]] - 1)
  • :for x from=$maxindex to=0 step=-1 do={
  • # Calculate 256^($maxindex - $x)
  • :set tmpint 1
  • :if (($maxindex - $x) > 0) do={
  • :for y from=1 to=($maxindex - $x) do={ :set tmpint (256 * $tmpint) }
  • }
  • :set tmpint ($tmpint * ([:tonum [:pick [:toarray $maxaddress] $x]] - \
  • [:tonum [:pick [:toarray $minaddress] $x]]) )
  • :set pooladdresses ($pooladdresses + $tmpint)
  • # for x
  • }
  • # if len array $minaddress = $maxaddress
  • }
  • # Add current range to total pool's available addresses
  • :set pooladdresses ($pooladdresses + 1)
  • # foreach r
  • }
  • :set poolused [:len [used find pool=[:tostr $poolname]]]
  • :set poolpercent (($poolused * 100) / $pooladdresses)
  • :set line ([:tostr $line] . " [" . $poolused . "/" . $pooladdresses . "]")
  • :set line ([:tostr $line] . " " . $poolpercent . " % used")
  • :if ( [:tonum $poolpercent] > $criticalthreshold ) do={
  • :log error ("IP Pool " . $poolname . " is " . $poolpercent . "% full")
  • :put ([:terminal style varname] . $line)
  • } else={
  • :if ( [:tonum $poolpercent] > $warnthreshold ) do={
  • :log warning ("IP Pool " . $poolname . " is " . $poolpercent . "% full")
  • :put ([:terminal style syntax-meta] . $line)
  • } else={
  • :put ([:terminal style none] . $line)
  • }
  • }
  • # foreach p
  • }
  • # /ip pool
  • }
  • /#IP Pool Statistics 

Sunday, June 5, 2016

2 WAN EQUAL LOAD BALANCING PCC

2 comments

/interface ethernet
set [ find default-name=ether1 ] name=ether1
set [ find default-name=ether2 ] name=ether2
set [ find default-name=ether3 ] name=ether3
set [ find default-name=ether4 ] name=ether4
set [ find default-name=ether5 ] name=ether5
/system note set note="Server Configuration By <HAMZA KHALIL> (www.itlearnweb.com)" show-at-login=yes
/ip address
add address=192.168.1.10/24 interface=ether1
add address=192.168.2.10/24 interface=ether2
add address=192.168.10.1/24 interface=ether5
/ip dns
set allow-remote-requests=yes cache-size=5000KiB max-udp-packet-size=2048 servers=192.168.1.1,192.168.2.1
/ip firewall mangle
add chain=input in-interface=ether1 action=mark-connection new-connection-mark=WAN1_con
add chain=input in-interface=ether2 action=mark-connection new-connection-mark=WAN2_con
add action=mark-routing chain=output connection-mark=WAN1_con new-routing-mark=to_WAN1
add action=mark-routing chain=output connection-mark=WAN2_con new-routing-mark=to_WAN2
add chain=prerouting dst-address=192.168.1.0/24 in-interface=ether5
add chain=prerouting dst-address=192.168.2.0/24 in-interface=ether5
add action=mark-connection chain=prerouting dst-address-type=!local hotspot=auth in-interface=ether5 new-connection-mark=WAN1_con per-connection-classifier=both-addresses-and-ports:2/0
add action=mark-connection chain=prerouting dst-address-type=!local hotspot=auth in-interface=ether5 new-connection-mark=WAN2_con per-connection-classifier=both-addresses-and-ports:2/1
add action=mark-routing chain=prerouting connection-mark=WAN1_con in-interface=ether5 new-routing-mark=to_WAN1
add action=mark-routing chain=prerouting connection-mark=WAN2_con in-interface=ether5 new-routing-mark=to_WAN2
/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1
add action=masquerade chain=srcnat out-interface=ether2
/ip route
add check-gateway=ping distance=1 gateway=192.168.1.1 routing-mark=to_WAN1
add check-gateway=ping distance=1 gateway=192.168.2.1 routing-mark=to_WAN2
add check-gateway=ping distance=1 gateway=192.168.1.1
add check-gateway=ping distance=2 gateway=192.168.2.1
  • If you are using two different ISP’s and their respective name servers, possibly some clients are accessing ISP1’s DNS server through ISP2’s connection and ISP1 is blocking DNS requests from  outside their IP space.
  • Use Open DNS 
  1. 8.8.8.8, 8.8.4.4
  2. 208.67.222.222, 208.67.220.220
  •  http issues, some images load, other don’t, problems with some secure sites.
  1. Using “both addresses” or “source address “ for PCC
    classifier.