Tuesday, May 9, 2017

IPIP Tunnel

0 comments

The IPIP tunneling implementation on the MikroTik RouterOS is RFC 2003 compliant. IPIP tunnel is a simple protocol that encapsulates IP packets in IP to make a tunnel between two routers. The IPIP tunnel interface appears as an interface under the interface list. Many routers, including Cisco and Linux, support this protocol. This protocol makes multiple network schemes possible. for more details

IP tunnelling protocol adds the following possibilities to a network setups:
  • to tunnel Intranets over the Internet
  • to use it instead of source routing

##Router-1
##Ether1- WAN IP 42.166.17.158/28
##Ether5- LAN IP 192.168.1.1/24

/interface ethernet
set [ find default-name=ether1 ] name=ether1
set [ find default-name=ether5 ] name=ether5
/interface ipip
add !keepalive name=42.166.17.160 remote-address=42.166.17.160
/ip address
add address=42.166.17.158/28 interface=ether1 network=42.166.17.144
add address=192.168.1.1/24 interface=ether5 network=192.168.1.0
add address=172.16.10.1/30 interface=42.166.17.60 network=172.16.10.0
/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1
/ip route
add distance=2 dst-address=192.168.2.0/24 gateway=172.16.10.2


##Router-2
##Ether1- WAN IP 42.166.17.160/28
##Ether5- LAN IP 192.168.2.1/24
/interface ethernet
set [ find default-name=ether1 ] name=ether1
set [ find default-name=ether5 ] name=ether5
/interface ipip
add !keepalive name=42.166.17.158 remote-address=42.166.17.158
/ip address
add address=42.166.17.160/28 interface=ether1 network=42.166.17.144
add address=192.168.2.1/24 interface=ether5 network=192.168.2.0
add address=172.16.10.2/30 interface=42.166.17.158 network=172.16.10.0
/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1
/ip route
add distance=2 dst-address=192.168.1.0/24 gateway=172.16.10.1


Sunday, February 19, 2017

IP Cloud (for DSL users)

0 comments

What is IP Cloud ?  

IP Cloud is starting with RouterOS v6.14 MikroTik offers a Dynamic DNS name service for RouterBOARD devices.This means that your device can automatically get a working domain name, this is useful if your IP address changes often, and you want to always know how to connect to your router.






Sunday, February 5, 2017

Send Mikrotik User Manger Backup File Every Day Via E-mail

0 comments


/system script
add name=UserManger policy=\
   ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=":gl\
   obal SenderId #SENDER@gmail.com\r\
   \n:global SenderUser  #USER\r\
   \n:global GmailPwd #SENDER-PWD\r\
   \n:global RecMail #Receive@gmail.com\r\
   \n:local gmailip \"smtp.gmail.com\"\r\
   \n:global sub1 ([/system identity get name])\r\
   \n:global sub2 ([/system clock get time])\r\
   \n:global sub3 ([/system clock get date])\r\
   \n:global UserMangerFile usermanger\r\
   \n:log warning \"Mikrotik Sending UserManger Backup File.....BY >>>>WWW.ITLE\
   ARNWEB.COM<<<<\"\r\
   \n:log warning \"Creating new backup files\"\r\
   \n/tool user-manager database save name=\$UserMangerFile\r\
   \n:delay 10s\r\
   \n/tool e-mail set address=\$gmailip from=\$SenderId password=\$GmailPwd por\
   t=587 start-tls=yes user=\$SenderUser\r\
   \n:log info \"Sending Backup File.....BY >>>>WWW.ITLEARNWEB.COM<<<<\"\r\
   \n/tool e-mail send to=\$RecMail password=\$GmailPwd subject=\"UserManger Ba\
   ckup File (\$sub1 \$sub2 \$sub3) \" from=\$SenderId file=\$UserMangerFile se\
   rver=\$gmailip start-tls=yes\r\
   \n:log warning \"Please Wait....System is Busy\"\r\
   \n:delay 30s\r\
   \n/file remove \$UserMangerFile\r\
   \n:delay 05s\r\
   \n:log warning \"Finished\"\r\
   \n"
/system scheduler
add interval=1d name=UserManger on-event=UserManger policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon start-date=feb/05/2017 start-time=12:00:00

/

Dowload Scripts

Saturday, January 21, 2017

How to change MikroTik login Banner

5 comments






Download SYS-NOTE-FILE

SCRIPT

/system note
set show-at-login=yes
/set note="\t*************************************************************\r\
    \n\t    WARNING - PRIVATE NETWORK DOMAIN - ACCESS PROHIBITED\r\
    \n\r\
    \n       This device is a private network device. Access to this device is\r\
    \n\r\
    \n      not authorized. Any attempt for unauthorized access is being logged\r\
    \n\r\
    \n\t\t and appropriate legal action will be taken.\r\
    \n\t*************************************************************\r\
    \n\r\
    \n\t\t  ############################################# \r\
    \n\t\t  ###########Server Configuration By########### \r\
    \n\t\t  ###############<HAMZA KHALIL>################\r\
    \n\t\t  ############(www.itlearnweb.com)#############\r\
    \n\t\t  #############################################"

Tuesday, December 13, 2016

Connect Multiple Offices With Eoip Tunnel

2 comments
Office Side I Have RB3011UiAS-RM 


Configuration
/interface ethernet
set [find default-name=ether1 ] name=ether1 comment=WAN-Network
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
set [find default-name=ether6 ] name=ether6
set [find default-name=ether7 ] name=ether7
set [find default-name=ether8 ] name=ether8
set [find default-name=ether9 ] name=ether9
set [find default-name=ether10 ] name=ether10
/interface eoip add name="2nd Branch" remote-address=###2nd Branch WAN-IP
/interface eoip add name="3nd Branch" remote-address=###3rd Branch WAN-IP
/interface eoip add name="4nd Branch" remote-address=###4th Branch WAN-IP
/interface bridge
add name=DHCP
/interface bridge port
add bridge=DHCP interface=ether2
add bridge=DHCP interface=ether3
add bridge=DHCP interface=ether4
add bridge=DHCP interface=ether5
add bridge=DHCP interface=ether6
add bridge=DHCP interface=ether7
add bridge=DHCP interface=ether8
add bridge=DHCP interface=ether9
add bridge=DHCP interface=ether10
add bridge=DHCP interface="2nd Branch"
add bridge=DHCP interface="3rd Branch"
add bridge=DHCP interface="4th Branch"
/ip address
add address=###your WAN-IP interface=ether1
add address=192.168.10.1/23 interface=DHCP network=192.168.10.0
/ip dns
set servers=8.8.8.8,8.8.4.4
/ip pool
add name=dhcp_pool1 ranges=192.168.10.2-192.168.11.254
/ip dhcp-server
add address-pool=dhcp_pool1 disabled=no interface=DHCP name=dhcp2 lease-time=1h relay=\
    192.168.10.1
/ip dhcp-server network
add address=192.168.10.0/23 dns-server=8.8.8.8,8.8.4.4 gateway=192.168.10.1
/ip firewall nat
add action=masquerade chain=srcnat comment="Masquerade DHCP Network" \
    src-address=192.168.10.0/23
/ip route
add distance=1 gateway=###your gateway
/system identity
set name=Main-Branch

Other Branches Configuration......
we use hexlite

2nd Branch
/interface ethernet
set [find default-name=ether1 ] name=ether1 comment=WAN-Network
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
/interface eoip add name="eoip-tunnel1" remote-address=(###Main Branch WAN-IP) tunnel-id=20
/interface bridge
add name=Local-Network
/interface bridge port
add bridge=Local-Network interface=ether2
add bridge=Local-Network interface=ether3
add bridge=Local-Network interface=ether4
add bridge=Local-Network interface=ether5
add bridge=Local-Network interface=eoip-tunnel1
/ip address
add address=(###your WAN-IP) interface=ether1
/ip route
add distance=1 gateway=(###your gateway)
/system identity
set name=2nd-Branch 

3rd Branch
/interface ethernet
set [find default-name=ether1 ] name=ether1 comment=WAN-Network
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
/interface eoip add name="eoip-tunnel1" remote-address=(###Main Branch WAN-IP) tunnel-id=30
/interface bridge
add name=Local-Network
/interface bridge port
add bridge=Local-Network interface=ether2
add bridge=Local-Network interface=ether3
add bridge=Local-Network interface=ether4
add bridge=Local-Network interface=ether5
add bridge=Local-Network interface=eoip-tunnel1
/ip address
add address=(###your WAN-IP) interface=ether1
/ip route
add distance=1 gateway=(###your gateway)
/system identity
set name=3rd-Branch

4th Branch
/interface ethernet
set [find default-name=ether1 ] name=ether1 comment=WAN-Network
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
/interface eoip add name="eoip-tunnel1" remote-address=(###Main Branch WAN-IP) tunnel-id=40
/interface bridge
add name=Local-Network
/interface bridge port
add bridge=Local-Network interface=ether2
add bridge=Local-Network interface=ether3
add bridge=Local-Network interface=ether4
add bridge=Local-Network interface=ether5
add bridge=Local-Network interface=eoip-tunnel1
/ip address
add address=(###your WAN-IP) interface=ether1
/ip route
add distance=1 gateway=(###your gateway)
/system identity
set name=4th-Branch

Sunday, December 11, 2016

L2TP Tunnel (Remotely Connect To Work Computer From Home)

1 comments

L2TP is a secure tunnel protocol for transporting IP traffic using PPP. L2TP encapsulates PPP in virtual lines that run over IP, Frame Relay and other protocols (that are not currently supported by MikroTik RouterOS). L2TP incorporates PPP and MPPE (Microsoft Point to Point Encryption) to make encrypted links. The purpose of this protocol is to allow the Layer 2 and PPP endpoints to reside on different devices interconnected by a packet-switched network. With L2TP, a user has a Layer 2 connection to an access concentrator - LAC (e.g., modem bank, ADSL DSLAM, etc.), and the concentrator then tunnels individual PPP frames to the Network Access Server - NAS. This allows the actual processing of PPP packets to be separated from the termination of the Layer 2 circuit. From the user's perspective, there is no functional difference between having the L2 circuit terminate in a NAS directly or using L2TP. for more details

/ip pool
add name=L2TP ranges=172.16.100.1-172.16.100.254
/ppp profile
add dns-server=10.10.0.1,8.8.8.8 local-address=10.10.0.1 name=L2TP-VPN \
    remote-address=L2TP
/interface l2tp-server server
set default-profile=L2TP-VPN enabled=yes ipsec-secret=itlearnweb use-ipsec=yes
/ppp secret
add name=test password=test profile=L2TP-VPN service=l2tp
/ip firewall nat
add action=masquerade chain=srcnat comment="L2TP-VPN Masquerade" src-address=\
    172.16.100.1-172.16.100.254

Sunday, November 27, 2016

Mikrotik Interface Bonding 2 Ethernets

4 comments
Bonding is a technology that allows aggregation of multiple ethernet-like interfaces into a single virtual link, thus getting higher data rates and providing failover.
  
###Router-1
/interface bonding
add name=bonding1 slaves=ether9,ether10
/ip address
add address=172.16.1.1/24 interface=bonding1 network=172.16.1.0

###Router-2
/interface bonding
add name=bonding1 slaves=ether9,ether10
/ip address
add address=172.16.1.2/24 interface=bonding1 network=172.16.1.0