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.

Tuesday, May 31, 2016

2 WANS ''WAN-1 FOR PPPoE USERS''---''WAN-2 FOR HOTPSOT USERS''

4 comments



/interface ethernet
set [ find default-name=ether1 ] name=ether1-Wan1
set [ find default-name=ether2 ] name=ether2-Wan2
set [ find default-name=ether3 ] name=ether3-PPPoE
set [ find default-name=ether4 ] name=ether4-Hotspot
set [ find default-name=ether5 ] name=ether5
/ip address
add address=192.168.10.2/24 interface=ether1-Wan1 network=192.168.10.0
add address=192.168.11.2/24 interface=ether2-Wan2 network=192.168.11.0
add address=10.10.0.1/24 interface=ether3-PPPoE network=10.10.0.0
add address=192.168.50.1/24 interface=ether4-Hotspot network=192.168.50.0
/ip route
add distance=1 gateway=192.168.10.1
add distance=1 gateway=192.168.11.1
/ip dns
set allow-remote-requests=yes servers=8.8.8.8,8.8.4.4
/ip firewall nat
add action=masquerade chain=srcnat comment="WAN1 MASQUERADE" out-interface=ether1-Wan1
add action=masquerade chain=srcnat comment="WAN2 MASQUERADE" out-interface=ether2-Wan2
add action=masquerade chain=srcnat disabled=no src-address=\
    172.16.1.2-172.16.1.254
add action=masquerade chain=srcnat comment="masquerade hotspot network" \
    src-address=192.168.50.0/24
/ip firewall mangle
add action=mark-routing chain=prerouting comment="PPPoE GO THAROUGH WAN1" new-routing-mark=pppoe-wan1 src-address=172.16.1.2-172.16.1.254
add action=mark-routing chain=prerouting comment="HOTSPOT GO THAROUGH WAN2" new-routing-mark=hotspot-wan2 src-address=192.168.50.0/24
/ip route
add distance=1 gateway=192.168.10.1 routing-mark=pppoe-wan1
add distance=1 gateway=192.168.11.1 routing-mark=hotspot-wan2
/system note set note="Server Configuration By <HAMZA KHALIL> (www.itlearnweb.com)" show-at-login=yes
/ip pool
add name=ppp ranges=172.16.1.2-172.16.1.254
add name=hs-pool-4 ranges=192.168.50.2-192.168.50.254
: log warning "PPPoE setup is started by Hamza Khalil"
/interface pppoe-server server
add authentication=pap,chap default-profile=default disabled=no interface=\
    ether3-PPPoE keepalive-timeout=10 max-mru=1480 max-mtu=1480 max-sessions=0 mrru=\
    disabled one-session-per-host=yes service-name=service1
/ppp profile
set 0 change-tcp-mss=yes dns-server=10.10.0.1,192.168.10.1 local-address=\
    10.10.0.1 name=default only-one=default remote-address=ppp use-compression=\
    default
add change-tcp-mss=default dns-server=10.10.0.1,192.168.10.1 local-address=\
    10.10.0.1 name=2MB only-one=yes rate-limit=500K/2M remote-address=ppp \
    use-compression=default
add change-tcp-mss=default dns-server=10.10.0.1,192.168.10.1 local-address=\
    10.10.0.1 name="my profile" only-one=default remote-address=ppp \
    use-compression=default
: log warning "PPPoE setup is completed by Hamza Khalil"
: log warning "Hotspot setup is starting by Hamza Khalil"
/ip hotspot profile
add dns-name=login.net hotspot-address=192.168.50.1 login-by=\
    http-chap,https,http-pap name=hsprof1
/ip hotspot user profile
set [ find default=yes ] idle-timeout=none keepalive-timeout=2m \

    mac-cookie-timeout=3d
/ip dhcp-server
add address-pool=hs-pool-4 disabled=no interface=ether4 lease-time=1h name=\
    dhcp1
/ip hotspot
add address-pool=hs-pool-4 disabled=no interface=ether4 name=hotspot1 profile=\
    hsprof1
/ip dhcp-server network
add address=192.168.50.0/24 comment="hotspot network" gateway=192.168.50.1
: log warning "full setup is completed by Hamza Khalil"

DOWNLOAD BACKUP FILE AND SCRIPT

Tuesday, May 24, 2016

Block Hotspot Shield And Other VPN Ports

10 comments

/ip firewall address-list
add address=157.56.106.0/24 list=HotspotShield-itlearnweb
add address=157.56.144.0/24 list=HotspotShield-itlearnweb
add address=198.144.116.0/24 list=HotspotShield-itlearnweb
add address=204.14.77.0/24 list=HotspotShield-itlearnweb
add address=204.14.0.0/16 list=HotspotShield-itlearnweb
add address=205.164.34.0/24 list=HotspotShield-itlearnweb
add address=209.73.0.0/16 list=HotspotShield-itlearnweb
add address=212.118.232.0/24 list=HotspotShield-itlearnweb
add address=216.172.138.0/24 list=HotspotShield-itlearnweb
add address=216.172.0.0/16 list=HotspotShield-itlearnweb
add address=46.0.0.0/8 list=HotspotShield-itlearnweb
add address=66.171.229.0/24 list=HotspotShield-itlearnweb
add address=68.68.107.0/24 list=HotspotShield-itlearnweb
add address=68.68.108.0/24 list=HotspotShield-itlearnweb
add address=69.22.168.0/24 list=HotspotShield-itlearnweb
add address=69.22.170.0/24 list=HotspotShield-itlearnweb
add address=74.115.0.0/16 list=HotspotShield-itlearnweb
add address=94.245.121.0/24 list=HotspotShield-itlearnweb
add address=69.22.185.0/24 list=HotspotShield-itlearnweb
add address=174.129.0.0/16 list=HotspotShield-itlearnweb
add address=216.172.135.0/24 list=HotspotShield-itlearnweb
add address=67.220.0.0/16 list=HotspotShield-itlearnweb
add address=50.0.0.0/8 list=HotspotShield-itlearnweb
add address=79.125.0.0/16 list=HotspotShield-itlearnweb
add address=75.101.0.0/16 list=HotspotShield-itlearnweb
add address=176.56.0.0/16 list=HotspotShield-itlearnweb
add address=54.75.0.0/16 list=HotspotShield-itlearnweb
add address=54.161.0.0/16 list=HotspotShield-itlearnweb
add address=199.188.0.0/16 list=HotspotShield-itlearnweb
add address=64.55.144.0/24 list=HotspotShield-itlearnweb
add address=54.192.201.0/24 list=HotspotShield-itlearnweb
add address=173.245.64.0/24 list=HotspotShield-itlearnweb
add address=209.107.208.0/24 list=HotspotShield-itlearnweb
add address=209.107.208.0/24 list=HotspotShield-itlearnweb
add address=66.160.196.0/24 list=HotspotShield-itlearnweb
add address=68.68.108.0/24 list=HotspotShield-itlearnweb
add address=216.151.191.0/24 list=HotspotShield-itlearnweb
add address=85.237.211.0/24 list=HotspotShield-itlearnweb
add address=68.68.107.0/24 list=HotspotShield-itlearnweb
add address=206.223.118.0/24 list=HotspotShield-itlearnweb
add address=72.52.92.0/24 list=HotspotShield-itlearnweb
add address=64.71.150.0/24 list=HotspotShield-itlearnweb
add address=72.13.93.0/24 list=HotspotShield-itlearnweb
add address=68.68.109.0/24 list=HotspotShield-itlearnweb
add address=69.31.103.0/24 list=HotspotShield-itlearnweb
add address=205.164.34.0/24 list=HotspotShield-itlearnweb
add address=216.151.191.0/24 list=HotspotShield-itlearnweb
add address=173.245.64.0/24 list=HotspotShield-itlearnweb
/ip firewall filter
add action=drop chain=forward comment=\
    "Block Hotspot Shield by Addresses /www.itlearnweb.com" src-address-list=\
    HotspotShield-itlearnweb
add action=drop chain=forward comment=\
    "Block Hotspot Shield by Ports /www.itlearnweb.com" dst-port=\
    5345,3398,990,179,3451,105,706,995,800,5245,3451,15009,5050,1194,8245 \
    protocol=tcp
add action=drop chain=forward comment=\
    "Block Hotspot Shield by Ports /www.itlearnweb.com" dst-port=\
    5345,3398,990,179,3451,105,706,995,800,5245,3451,15009,5050,1194,8245 \
    protocol=udp
add action=drop chain=forward comment=\
    "Block Other VPN Ports (PPTP,L2TP,IPSec)/www.itlearnweb.com" dst-port=\
    1701,1723,47,4500,500 protocol=udp
add action=drop chain=forward comment=\
    "Block Other VPN Ports (PPTP,L2TP,IPSec)/www.itlearnweb.com" dst-port=\
    1701,1723,47,4500,500 protocol=tcp


DOWNLOAD%20FULL%20SCRIPTS

Sunday, May 15, 2016

Simple Bandwidth Sharing With ''DHCP & QUEUE''

1 comments

First we configure DHCP fellow this post and configure ''DHCP SERVER''

Now we will setup Bandwidth Control (2M/300K per user)

/queue typeadd kind=pcq name=PCQ-DOW pcq-classifier=dst-address pcq-dst-address6-mask=64 \    pcq-rate=2M pcq-src-address6-mask=64add kind=pcq name=PCQ-UP pcq-classifier=src-address pcq-dst-address6-mask=64 \    pcq-rate=300k pcq-src-address6-mask=64
 /queue simpleadd comment="2MB PER USER " name=PCQ-2MB queue=PCQ-UP/PCQ-DOW target=\    192.168.10.0/24

Monday, May 9, 2016

EoIP Tunnel Configuration (Transparent Bridge)

1 comments

An EoIP interface should be configured on two routers that have the possibility for an IP level connection. The EoIP tunnel may run over an IPIP tunnel, a PPTP 128bit encrypted tunnel, a PPPoE connection, or any connection that transports IP.
Each EoIP tunnel interface can connect with one remote router which has a corresponding interface configured with the same 'Tunnel ID'.
  • The EoIP interface appears as an Ethernet interface under the interface list.
  • This interface supports all features of an Ethernet interface. IP addresses and other tunnels may be run over the interface.
  • The EoIP protocol encapsulates Ethernet frames in GRE (IP protocol number 47) packets (just like PPTP) and sends them to the remote side of the EoIP tunnel.
  • Maximal count of EoIP tunnels is 65536.
####Server Side####
/interface eoip add remote-address=10.10.0.4 tunnel-id=100 name=10.10.0.4-Branch2
/interface pppoe-server server add authentication=pap,chap disabled=no interface=10.10.0.30-Branch2 one-session-per-host=yes service-name=service2

####2nd Branch####
/interface eoip add remote-address=10.10.0.1 tunnel-id=100 name=Main-Branch
/interface bridge
add name=access
/interface bridge port
add bridge=access interface=ether2
add bridge=access interface=ether3
add bridge=access interface=ether4
add bridge=access interface=ether5
add bridge=access interface=Main-Branch
/ip address
add address=10.10.0.4/24 interface=ether1 network=10.10.0.0
add address=192.168.100.1/24 interface=access network=192.168.100.0

Result For Example Server_Side

Result For Example Other_Side

Sunday, May 8, 2016

Multiple Servers (DHCP, Hotspot & PPPoE) in one RB

1 comments
/interface ethernet
set [ find default-name=ether1 ] comment="Wan Network"
set [ find default-name=ether2 ] comment="Dhcp Server"
set [ find default-name=ether3 ] comment="Hotspot Server"
set [ find default-name=ether4 ] comment="PPPoE Server"
/ip address
add address=192.168.1.10/24 comment="Wan Network" interface=ether1 network=\
    192.168.1.0
add address=10.10.0.1/24 comment="PPP Network" interface=ether4 network=\
    10.10.0.0
add address=192.168.2.1/24 comment="DHCP Network" interface=ether2 network=\
    192.168.2.0
add address=192.168.3.1/24 comment="Hotspot Network" interface=ether3 \
    network=192.168.3.0
/ip dns
set allow-remote-requests=yes cache-size=10000KiB servers=8.8.8.8,8.8.4.4
/ip route
add distance=1 gateway=192.168.1.1
/ip pool
add name=hs-pool-3 ranges=192.168.3.2-192.168.3.254
add name=dhcp_pool1 ranges=192.168.2.2-192.168.2.254
add name=ppp ranges=172.16.2.254-172.168.1.2
/ip dhcp-server
add address-pool=hs-pool-3 disabled=no interface=ether3 lease-time=1h name=\
    dhcp1
add address-pool=dhcp_pool1 disabled=no interface=ether2 name=dhcp2
/ip dhcp-server network
add address=192.168.2.0/24 gateway=192.168.2.1
add address=192.168.3.0/24 comment="hotspot network" gateway=192.168.3.1
/ip hotspot
add address-pool=hs-pool-3 disabled=no interface=ether3 name=hotspot1 \
    profile=hsprof1
/ip hotspot profile
add dns-name=login.net hotspot-address=192.168.3.1 login-by=\
    http-chap,https,http-pap name=hsprof1
/ip hotspot user profile
set [ find default=yes ] idle-timeout=none keepalive-timeout=2m \
    mac-cookie-timeout=3d
add idle-timeout=none keepalive-timeout=2m mac-cookie-timeout=3d name=1Mb \
    rate-limit=300K/1M transparent-proxy=yes
add idle-timeout=none keepalive-timeout=2m mac-cookie-timeout=3d name=2Mb \
    rate-limit=300K/2M transparent-proxy=yes
add idle-timeout=none keepalive-timeout=2m mac-cookie-timeout=3d name=4Mb \
    rate-limit=1M/4M transparent-proxy=yes
/ip hotspot user
add name=admin password=admin
/interface pppoe-server server
add authentication=pap,chap disabled=no interface=ether4 \
    one-session-per-host=yes service-name=service1
/ppp profile
add local-address=10.10.0.1 name=1Mb only-one=yes rate-limit=300K/1M \
    remote-address=ppp
add local-address=10.10.0.1 name=2Mb only-one=yes rate-limit=300K/2M \
    remote-address=ppp
add local-address=10.10.0.1 name=4Mb only-one=yes rate-limit=1M/4M \
    remote-address=ppp
/ppp secret
add name=test password=test profile=4Mb service=p
/ip firewall filter
add action=passthrough chain=unused-hs-chain comment=\
    "place hotspot rules here" disabled=yes
/ip firewall nat
add action=passthrough chain=unused-hs-chain comment=\
    "place hotspot rules here" disabled=yes
add action=masquerade chain=srcnat comment="masqu
    src-address=192.168.3.0/24
add action=masquerade chain=srcnat comment="masqu
    src-address=192.168.2.2-192.168.2.254
add action=masquerade chain=srcnat comment="masqu
    src-address=172.16.1.2-172.16.2.254

DONLOAD%20SCRIPTS%20%20%26%20BACKUP%20FILE