sexta-feira, 21 de outubro de 2011

Cache full no Mikrotik / Cache full in Mikrotik

Neste tutorial, você vai aprender a configurar um cache full em seu servidor Mikrotik de forma que todos os arquivos e programas baixado na internet pela sua rede interna fique armazenado no seu servidor, assim, quando outro usuário quiser baixar esse mesmo arquivo, ele não irá consumir mais banda, vai pegar esse arquivos direto do seu servidor na velocidade da sua rede interna. Para isso você vai precisa dos seguintes pré-requisitos:
In this tutorial you will learn how to configure a cache full Mikrotik on your server so that all files and programs downloaded from the Internet by your internal network be stored on your server, so when another user wants to download that same file, it will not consume more bandwidth, this will pick up files directly from your server at the speed of your internal network. For this you will need the following prerequisites:
  1. Ter o proxy devidamente configurado em seu servidor. Se ainda não tem, veja como fazer nesse link
  2. Ter um HD grande para poder armazenar todos os downloads.
  1. Having the proxy properly configured on your server. If you have not already, check out howthis link
  2. Having a large hard disk so you can store all downloads.
Vamos começar!
Let's get started!

1. Primeiro vamos realizar as marcações de conexões e pacotes no mangle. Clique em IP depois em FIREWALL
1. First we perform the markings of connections and packets in the mangle. Click IP thenFIREWALL


2. Na aba MANGLE, clique no botão +. Na aba GENERAL, no campo CHAIN selecione a opção OUTPUT. No campo PROTOCOL, selecione a opção TCP. No campo SRC.PORT, coloque a porta de configuração do seu proxy, se você não alterou, então coloque a porta 8080. Agora na aba ADVANCED, no campo DSCP (TOS), coloque 4 (esse é o número do Tipo de Serviço utilizado pelo proxy). Agora clique na aba ACTION, no campo ACTION, selecione a opção MARK CONNECTION. No campo NEW MARK CONNECTION coloque CONN-CACHE-FULL e deixe a opção PASSTHROUGH marcado. Por fim, clique em OK.
2. Mangle tab, click the + button. On the General tab, select the field CHAIN ​​OUTPUT option. In the Protocol field, select TCP. SRC.PORT in the field, put the port configuration of your proxy if you have not changed, then put the port 8080. Now on the Advanced tab, in the field DSCP (TOS), 4th place (this is the number of the type used by service proxy). Nowclick on the tab ACTION, ACTION field, select MARK CONNECTION. In the field NEWCONN-MARK place CONNECTION CACHE-FULL and leave the option PASSTHROUGHmarked. Finally, click OK.




3. Vamos para a próxima regra. Clique no botão + novamente. Na aba GENERAL, no campo CHAIN, selecione a opção OUTPUT. No campo CONNECTION MARK, selecione a opção CONN-CACHE-FULL. Agora na aba ACTION, no campo ACTION, selecione a opção MARK PACKET e no campo NEW PACKET MARK, coloque PAC-CACHE-FULL. Deixe marcada a opção PASSTHROUGH. Depois clique em OK.
3. Let's go to the next rule. Click the + button again. On the General tab, in the field CHAIN,select the OUTPUT option. MARK CONNECTION In the field, select the CONN-CACHE-FULL. Now tab ACTION, ACTION field, select the field and MARK PACKET PACKETNEW MARK, place PAC-CACHE-FULL. Check the box PASSTHROUGH. Then click OK.



4. Agora a última regra do mangle. Clique novamente no botão +. Na aba GENERAL, no campo CHAIN, selecione a opção OUTPUT. No campo CONNECTION MARK, selecione CONN-CACHE-FULL. Agora clique na aba ACTION e no campo ACTION selecione RETURN. Essa regra faz com que, depois de ter marcado as conexões do proxy, todas as suas regras do mangle (caso você tenha mais regras) continuem funcionando perfeitamente.
4. Now the last rule in the mangle. Click the + button again. On the General tab, in the fieldCHAIN, select the OUTPUT option. MARK CONNECTION In the field, selectCONN-CACHE-FULL. Now click on the tab in the field ACTION ACTION and selectRETURN. This rule means that, after you have checked the connections to the proxy, all the rules of the mangle (if you have more rules) continue to function perfectly.

Depois de ter feito essas três regras, lembre de colocá-las como as três primeiras regras do mangle arrastando-as pra cima.
Once you have done these three rules, remember to place them as the first three rules of the mangle dragging them up.



Agora vamos criar um regra em FILTER pra por permitir que sua rede interna tenha acesso ao proxy.
Now let's create a rule for allowing FILTER to your internal network has access to the proxy.

5. Ainda em IP > FIREWALL, clique na aba FILTER e depois no botão +. Na aba GENERAL, no campo CHAIN, selecione a opção INPUT. No campor PROTOCOL, selecione a opção TCP, no campo DST.PORT coloque a porta do seu proxy 8080, no campo IN.INTERFACE, selecione a placa de rede da sua rede interna. Agora clique na aba ACTION. No campo ACTION, selecione a opção ACCEPT.
5. Although IP-> Firewall, click the FILTER tab and then the + button. On the General tab, in the field CHAIN​​, select INPUT. In camporee PROTOCOL, select TCP in the fieldDST.PORT put your proxy port 8080, IN.INTERFACE field, select the network card of your internal network. Now click on the tab ACTION. In the Action field, select ACCEPT.



Pronto. O proxy está devidamente funcionando. Para testar, faça um download em algum site de um programa ou arquivo em alguma máquina interna sua. Depois, baixe esse MESMO arquivo ou programa de outra máquina da rede interna e observe a velocidade desse segundo download.
Pronto. The proxy is properly working. To test, download from a site of a program or filesomewhere inside your machine. Then download the same file or program to another machine on the internal network and observe the speed of this second download.

segunda-feira, 10 de outubro de 2011

Bloquear páginas no Mikrotik (Web-Proxy) / Block pages in Mikrotik (Web-Proxy)

Neste vídeo, você vai aprender a controlar o acesso a internet de sua rede interna bloqueando sites e downloads por extensões (exe, zip, rar e etc). Para isso, você precisa dos seguintes pré-requisitos:
In this video you will learn how to control access to Internet from your internal network to block sites and downloads by extension (exe, zip, rar, etc.). For this you need the following prerequisites:
  1. Ter o serviço Web-Proxy já configurado no seu servidor Mikrotik. Se ainda não tem, veja como fazer clicando AQUI!
  1. Having the service Web-Proxy on your server already configured Mikrotik. If you have not already, check out how by clicking HERE!

Vamos começar!
Let's start

1. Clique em IP e depois em WEB PROXY. 
1. IP and then click Web Proxy.

2. Na aba ACESSE, clique no botão +. No campo SRC. ADDRESS, coloque o endereço de origem que deseja bloquear o acesso. Se quiser que a regra se aplique a qualquer endereço de origem da sua rede, não altere esse campo. Existem três formas de realizar o bloqueio:
2. On the Access tab, click the + button. SRC in the field. ADDRESS, set the source address you want to block access. If you want the rule to apply to any source address of your network, do not change this field. There are three forms of the blockade:
     a) Pelo domínio do site. Se quiser bloquear o site sexo.com.br, basta colocar no campo DST. HOST a palavra SEXO, precedida de ":".
     b) Pela palavra na URL. Se quiser bloquear qualquer site que tenha a palavra SEXO em sua URL, basta colocar no campo PATH a palavra SEXO.
     c) Pela extensão de download. Se quiser bloquear downloads de arquivos executáveis, ou seja, com extensão .EXE, basta colocar no campo PATH "*.exe". O * quer dizer que é pra bloquear qualquer coisa que venha antes de .exe
a) the website's domain. If you want to block the site sexo.com.br, just put the STD field.HOST SEX word, preceded by "."
b) the word in the URL. If you want to block any site that has the word SEX in your URL, just put the word PATH in the field SEX.
c) the extension download. If you want to block downloads of executables, that is, with.EXE, just put in the field PATH "*. exe". The * means that it is to block anything that comes before. Exe


Pronto. Agora é só repetir essa regra para todos os sites e downloads que queira bloquear.
Ready. Now just repeat this rule to all sites and downloads that you want to block.

segunda-feira, 3 de outubro de 2011

Saiba quanto será o sinal de seu ponto-a-ponto antes da implantação. / Find out how the signal from its point-to-point before the deployment.

Pessoal, No site da Mikrotik existe uma ferramenta que pode lhe auxiliar na criação de um enlace de longa distância (e pequena também se desejar).
Personal site of the Mikrotik there a tool that can assist you in creating a long distancelink (and small too if desired).
Lá você coloca as informações dos cartões wireless, antenas e cabo utilizados no ponto-a-ponto do enlace que você vai criar e ele lhe dará o nível de sinal que você pode obter (se as antenas forem alinhadas perfeitamente). Essa ferramenta lhe auxilia na hora de saber quais equipamentos você deve utilizar para alcançar o sinal desejado.
There you put the information of the wireless cards, antennas and cable used in point-to-point link that you will create and it will give you the signal you can get (if the antennas are aligned properly). This tool assists you in time to know what equipment you should use to achieve the desired signal.
http://www.mikrotik.com/test_link.php

Aproveitem!
Enjoy!

Configurar Proxy no Mikrotik / Configure the Proxy Mikrotik

Neste tutorial, você vai aprender a realizar a configuração de Proxy no seu Mikrotik. Nesse turorial, eu utilizo a versão 5.5.
In this tutorial you will learn to perform the proxy setting in your Mikrotik. In this turorial I use version 5.5.
Conceito resumido:
Concept summary:
Para quem não sabe, o Proxy é um conceito muito utilizado para fazer o CACHE de páginas acessadas em sua rede. Exemplo: Quando a máquina A acessa o site www.terra.com.br, seu servidor de internet (Mikrotik) vai no servidor do TERRA, traz a página solicita, armazena no CAHCE do servidor de internet (Mikrotik) e depois mostra essa página pra máquina A. Quando a máquina B acessa o mesmo site, www.terra.com.br, o servidor faz um consulta em seu CACHE, e se ele já tiver essa página armazenada ele já mostra pra máquina B, evitando assim de ir novamente na internet para buscar essa informação. Com isso você ganha agilidade ao abrir as páginas e economia na utilização do link.
For those unaware, the proxy is a concept often used to cache pages accessed on your network. Example: When the machine www.terra.com.br A accesses the site, your Internet Service Provider (Mikrotik) the server will TERRA, brings the page requests, stores the Internet server CAHCE (Mikrotik) and then displays this page for machine A.When the machine B accesses the same site, www.terra.com.br, the server makes aquery in its cache, and if it has already stored this page he shows to machine B, thus avoiding going back to check on the Internet this information. With it you gain speed by opening the pages and economic use of the link.
Para isso, você vai precisar dos seguintes pré-requisitos:
For this you will need the following prerequisites:
  1. Ter um servidor Mikrotik instalado e acessando a internet normalmente.
  2. Sua rede interna também deve está acessando a internet normalmente.
  1. Mikrotik have a server installed and accessing the internet normally.
  2. Your internal network should also accessing the internet normally.
Vamos começar!
Let's start!

1. Vamos começar realizando a configuração do Proxy. Clique em IP e depois WEB PROXY.
1. Let's start doing the Proxy configuration. IP and then click Web Proxy.


2. Na aba access, clique no botão WEB PROXY SETTINGS. Na aba GENERAL, Marque o campo ENABLE. No campo PORT, coloque uma porta da qual o proxy vai utilizar (utilize uma porta acima de 1024). Se você quiser um proxy transparente, deixe os campos PARENTE PROXY e PARENT PROXY PORT vazios. No campo MAX. CACHE SIZE, coloque o tamanho que o seu cache pode ocupar no disco. No meu caso eu coloquei um valo ILIMITADO, visto que, eu não uso meu HD pra mais nada. Marque a opção CACHE ON DISK para que o cache seja armazenado no disco. No campo MAX CLIENTS CONNECTIONS, coloque a quantidade máxima de clientes que podem se conectarão no seu proxy. No campo MAX FRESH TIME, coloque quanto tempo as páginas podem ficar armazenadas no seu cache (não sugiro colocar tempo muito longo, pois, você pode está mostrando informações antigas para seus clientes). Marque a opção ALWAYS FROM CACHE para que as requisições sempre busquem primeiro as páginas no cache. Depois, clique no botão OK.
2. Access tab, click the WEB PROXY SETTINGS. On the General tab, check theENABLE field. In the Port field, enter a port from which the proxy will use (use a port above 1024). If you want a transparent proxy, leave the fields and PARENT PARENTPROXY PROXY PORT empty. In the MAX field. CACHE SIZE, place the size of yourcache can occupy on disk. In my case I put a ditch UNLIMITED, since I do not use my HD for anything else. Check the ON DISK CACHE so that the cache is stored on disk.MAX CONNECTIONS CLIENTS In the field, put the maximum amount of clients that canconnect to your proxy. In the field MAX FRESH TIME, place and time the pages can be stored in its cache (do not suggest putting very long time, because you are showing old information to their customers). Check the boxe ALWAYS FROM CACHE requests to always seek first the pages in the cache. Then click the OK button.


3. Agora, vamos criar uma regra para forçar todas as conexões de acesso HTTP da sua rede interna a passar pelo proxy. Clique em IP e depois em FIREWALL.
3. Now, let's create a rule to force all HTTP connections to access your internal network to pass through the proxy. IP and then click on Firewall.


4. Na aba NAT, clique no botão +. Na aba GENERAL, no campo CHAIN, selecione a opção DSTNAT. No campo PROTOCOL, selecione o protocolo TCP. No campo DST. PORT, coloque a porta 80 e no campo IN. INTERFACE, selecione a placa de rede da rede que passará pelo proxy. Agora clique na aba ACTION. No campo ACTION, selecione a opção REDIRECT. No campo TO PORTS, coloque a mesma porta que você escolheu lá nas configurações do WEB PROXY. Depois clique em OK. 
4. NAT tab, click the + button. On the General tab, in the field CHAIN, select the optionDSTNAT. In the Protocol field, select TCP. In the STD field. PORT, place the port 80 and the field IN. INTERFACE, select the network card of the network that pass through theproxy. Now click on the tab ACTION. In the Action field, select the REDIRECT option.PORTS TO on the field, put the same port you chose there in the Web Proxy settings.Then click OK.

Explicando: Essa regra que você configurou diz o seguinte: Todo o tráfego que seja do protocolo tcp, com destino de porta 80 (a porta padrão de acesso a páginas de internet HTTP) entrando pela placa de rede local deve ser direcionado para a porta 8080 (ou a porta que você escolheu). Assim, você vai garantir que todo tráfego HTTP vai passar pelo seu proxy.
Explaining: This rule says that you have configured the following: All traffic is TCP protocol with destination port 80 (the default port to access web pages HTTP) enteringthe local network card should be directed to port 8080 (or the port you chose). Thus, you will ensure that all HTTP traffic will pass through your proxy.




5. Pronto, agora todo o seu tráfego de acesso a páginas de internet está passando pelo seu proxy e seu cache já está funcionando.
5. Okay, now all your traffic to access web pages is going through your proxy and yourcache is already working.