terça-feira, 8 de novembro de 2011

IP público para cliente. / Public IP client.

Neste tutorial você vai aprender a setar um IP público que você tem disponível para que ele seja exclusivo de um cliente específico. Para isto, você vai precisar dos seguintes pré-requisitos:
In this tutorial you will learn to set a public IP that you have available to it to be unique to aspecific customer. For this, you will need the following prerequisites:
  1. Ter sua rede interna devidamente configurada e com acesso a internet normalmente.
  2. Ter conhecimento do seu range de IP disponibilizado pelo seu ISP.
  1. Have properly configured your internal network and access the Internet normally.
  2. Be aware of your range of IP provided by your ISP.
Vamos começar!
Let's get started!

1. Coloque todos os seus IPs públicos disponíveis (ou só os que você deseja usar) setados na sua placa de rede onde chega o link. Exemplo: Se você recebe de seu ISP um range /29, então você tem disponível 6 IPs públicos. Vou dar como exemplo que meu range de IP público vai de 200.200.200.1 até 200.200.200.6. Para isso, clique em IP depois em ADDRESS. Clique no botão + e configure todos seus IPs públicos disponíveis.
1. Put all of your public IPs available (or only the ones you want to use) setados on your network card which comes the link. Example: If you receive a range of ISP / 29, then you have 6 available public IPs. Let me give an example that my public IP range is from200.200.200.1 to 200.200.200.6. To do this, then click IP ADDRESS. Click the + buttonand configure all of your public IPs available.



2. Clique em IP, depois em FIREWALL. Na aba NAT, clique no botão +. Na aba GENERAL, no campo CHAIN, selecione a opção SRCNAT. No campo SRC.ADDRESS, coloque o IP interno do cliente que você quer que tenha um IP  público específico. No campo OUT.INTERFACE, selecione a interface que está conectado o seu link de internet.
2. Click IP, then FIREWALL. In the NAT tab, click the + button. On the General tab, in the field CHAIN, select the option SRCNAT. SRC.ADDRESS in the field, put the internal IP of the client that you want to have a public IP specific. In OUT.INTERFACE field, select the interface that is connected to your Internet link.




3. Clique na aba ACTION. No campo ACTION, selecione a opção SRCNAT. No campo TO ADDRESS, coloque o IP público que você quer que seja específico para esse cliente e depois clique em OK.
3. Click on the ACTION. In the Action field, select the option SRCNAT. TO ADDRESS the field, put the public IP that you want to be specific to that client and then click OK.


4. Por fim, mova essa regra que você acabou de criar de forma que ela seja a primeira regra.
4. Finally, move this rule you just created so that it is the first rule.

Pronto, está feito. Para testar, basta acessar o site www.meuip.com.br da máquina desse cliente que você configurou e verá que o IP público pra ele será o mesmo que você deixou específico.
You are done. To test, simply visit the site www.meuip.com.br client machine that you have configured and see that the public IP to it will be the same as you left specific.

Obs.: Se você usa cache no seu MK, lembre de desabilitá-lo para fazer o teste, pois, o cache já armazenou o IP antigo.
Note: If you use MK in its cache, remember to disable it for testing, because the cache hasstored the old IP.

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.

quinta-feira, 29 de setembro de 2011

Boas práticas no Mikrotik - Parte 1 / Good practices in Mikrotik - Part 1

Neste tutorial, você vai aprender algumas dicas de como deixar seu servidor Mikrotik mais seguro. Essas boas práticas ajudam a melhorar o gerenciamento do servidor e a evitar conexões maliciosas que já as tão manjadas na grande rede. Pra isso, você vai precisar dos seguintes pré-requisitos:
In this tutorial you will learn some tips on how to make your server more secure Mikrotik.These best practices help improve server management and to prevent malicious connections that already so formulaic in large network. For that, you will need thefollowing prerequisites:
  1. Ter definido o que REALMENTE passa pelo seu servidor.
  1. Having defined what REALLY goes through your server.

Vamos começar!
Let's start!

1. Primeiro, vamos desabilitar todos os serviços que você não vai usar na sua rede. Esses serviços vem por padrão habilitados no Mikrotik. Clique em IP e depois em FIREWALL.
1. First, we disable all services that you will not use in your network. These services comeenabled by default in Mikrotik. IP and then click on Firewall.


2. Clique na aba SERVICES PORTS. Esses são os serviços que transitam de sua rede interna para a internet. Desabilite todas os serviços que você sabe que não vai utilizar em sua rede. Para desabilitar basta selecionar o serviço desejado e clicar no botão X. Na versão 5.5 os serviços disponíveis são:
2. Click on the PORTS SERVICES. These are services that travel from your internal network to the Internet. Disable all the services you know you will not use in your network.To disable just select the desired service and click the X. In version 5.5 the services available are:

FTP - Protocolo de Transferência de Arquivos. Esse deve ser o único serviço que deve ser mantido habilitado, caso contrário, sua rede ficar sem acesso a sites FTP.
H323 - Protocolo usado para sistemas que utilizam vídeo e audio, exclusivamente. Acredito que dificilmente você precisará desse serviço.
IRC - O velho serviço de bate papo. Quem nunca usou o mIRC? Pois bem, hoje em dia quase que não é utilizado.
PPTP - Protocolo de Tunelamento Ponto a Ponto. Se você pretende usar uma VPN no seu servidor, tem que deixar habilitado.
SIP - Protocolo de Iniciação de Sessão. É o velho VOIP. Se você utiliza serviço de voz sobre IP na sua rede, deixe habilitado.
TFTP - Protocolo de Transferência de Arquivos Trivial. Parecido com o FTP, mas,s muito pouco utilizado.
FTP - File Transfer Protocol. This must be the only service that should be kept enabled,otherwise your network is no access to FTP sites.
H323 - Protocol used for systems that use video and audio only. I think you hardly need this service.
IRC - The old chat service. Who never used mIRC? Well, nowadays almost not used.
PPTP - Point Tunneling Protocol of the Point. If you intend to use a VPN on your server, you have to leave enabled.
SIP - Session Initiation Protocol. It's the old VOIP. If you use Voice over IP in your network, leave enabled.
TFTP - File Transfer Protocol Trivial. Similar to FTP, but it, s very little used.


3. Bom, vamos agora desabilitar outros serviços do Mikrotik. Clique em IP e depois em SERVICES.
3. Well, we now disable other services Mikrotik. IP and then click on Services.


4. Esses são os serviços que são processados pelo seu servidor Mikrotik. Só deixe habilitado os serviços que você utiliza, e ainda assim, altere a porta padrão desses serviços para aumentar a sua segurança. Para desabilitar, selecione o serviço e clique no botão X. Os serviços são (na versão 5.5):
4. These are services that are processed by your server Mikrotik. Just leave enabledservices you use, and yet, change the default port of these services to increase their security. To disable, select the service and click the X. The services are (in version 5.5):

API - Interface de Programação de Aplicativo. Seu significado é um pouco extenso, portanto, sugiro olharem esse link e ver se realmente é importante pra você. http://pt.wikipedia.org/wiki/API
FTP - Protocolo de Transferência de Arquivo. Só que nesse FTP, o servidor é o seu próprio Mikrotik. Se você pretende fazer seu servidor Mikrotik como um Servidor FTP, tem que deixar habilitado.
SSH - Acesso Remoto Seguro. Serve para você acessar seu servidor Mikrotik via linha de comando. Se você pretende utilizar esse serviço, deixe habilitado e altere a sua porta padrão.
TELNET - O mesmo que o SSH, só que, com menos segurança.
WINBOX - É o aplicativo que você usa para acessar seu servidor Mikrotik via interface gráfica. Por motivos óbvios deve ficar habilitado.
WWW - É o serviço que possibilita a você acessar seu servidor Mikrotik via WEB, e assim, realizar configurações mais emergenciais, ou consultar gráficos, entre outras funcionalidades.
WWW-SSL - É o mesmo que o WWW, só que, seu servidor precisa está com um certificado de segurança configurado para que o acesso ao seu servidor Mikrotik ocorra de forma segura.
API - Application Programming Interface. Its meaning is a bit long, so I suggest you lookand see if this link is really important to you. http://pt.wikipedia.org/wiki/API
FTP - File Transfer Protocol. Only in this FTP server is your own Mikrotik. If you want to make your server as an FTP Server Mikrotik, have to leave enabled.
SSH - Secure Remote Access. Is for you to access your server via command lineMikrotik. If you want to use this service, let enabled and change its default port.
TELNET - The same as SSH, only with less security.
Winbox - This is the application you use to access your server via graphical interfaceMikrotik. For obvious reasons must be enabled.
WWW - is the service that allows you to access your server via WEB Mikrotik, and that they perform most emergency settings, or view graphics, among other features.
WWW-SSL - is the same as the WWW, only that your server is to have a security certificate configured so that access to your server Mikrotik occur safely.

Pronto. Agora estamos começando a dar uma cara mais profissional as configurações do seu servidor Mikrotik.
Ready. Now we are beginning to face a more professional settings of your serverMikrotik.




quarta-feira, 28 de setembro de 2011

Rastrear servidores DHCP da rede no Mikrotik. / Track DHCP servers in the network in Mikrotik.

Neste tutorial, você vai aprender configurar seu servidor Mikrotik para que ele monitore sua rede e lhe informe se existe algum servidor DHCP ativo na sua rede que não era esperado por você. Para isso você precisa dos seguintes pré-requisitos:
In this tutorial you will learn to configure your server so that it Mikrotik monitor your network and you know if there is any active DHCP server on your network that was not expected for you. For this you need the following prerequisites:
  1. Ter o endereço MAC do servidor DHCP permitido por você na rede (isso só se aplica se seu servidor DHCP for algum dispositivo que não seja o servidor Mikrotik onde você vai colocar essa regra)
  1. Having the MAC address of the DHCP server enabled on the network for you (this only applies if your DHCP server is a device other than the Mikrotik server where you will putthis rule)


Imagine a situação:
Imagine the situation:
Você configura seu servidor Mikrotik, ou outro dispositivo qualquer, para ser o servidor DHCP padrão de sua rede, de repente, alguém coloca um outro dispositivo ligado na sua rede física e ativa um outro DHCP SERVER nesse dispositivo. Quando seus clientes, ou usuários, vão solicitar IP na rede, ao invés de pegar os endereçamentos corretos criados por você no seu servidor DHCP, acabam pegando endereçamentos errados do outro dispositivo ativo na rede. Logo, sua rede fica um caos.
Mikrotik you configure your server, or any other device, to be the standard DHCP serveron your network suddenly someone puts another device plugged into your physical network and another active DHCP Server in this device. When your clients or users, will request the IP network, instead of taking the correct addresses that you create in your DHCP server, getting addresses wrong end of another active device in the network.Thus, your network is in chaos.
Esse "macete" que vou lhe ensinar, vai monitorar toda a sua rede, e, se encontrar algum outro servidor DHCP que não seja o autorizado por você, ele executará um script. O script que vou configurar aqui, é pra lhe mandar um e-mail informando essa situação.
This "trick" that will teach you, will monitor your entire network, and meet some otherDHCP server that is not authorized by you, it will execute a script. The script that'll set uphere is to send you an email informing about this.
Vamos começar!
Let's start!

1. Primeiro, vamos configurar seu servidor Mikrotik com os dados do seu servidor SMTP para que ele envie os e-mails. Clique em TOOLS e depois em EMAIL.
1. First, we configure your server Mikrotik with the data of your SMTP server so that it sends e-mails. Click TOOLS and then EMAIL.

2. No campo SERVER, coloque o IP do servidor SMTP que você vai usar. No campo PORT, coloque a porta 25. No campo FROM, coloque um usuário válido desse servidor SMTP que você usou entre < >. No campo USER, repita esse usuário válido sem < >. No campo PASSWORD, coloque a senha válida desse usuário que você utilizou. Agora clique em OK.
2. In the Server field, put the IP of the SMTP server you will use. In the Port field, enter port 25. In the FROM field, put a valid user of the SMTP server that you used the <>. In the field USER, repeat this without valid user <>. In the Password field, enter the passwordvalid for that user that you used. Now click OK.

3. Agora, vamos criar o script que vai enviar o e-mail para você. Na aba SCRIPT, clique no botão +. No campo NAME, coloque um nome qualquer para esse script. No campo POLICY, deixe todas as opções marcadas. No campo SOURCE, coloque o comando abaixo e depois clique em OK.
3. Now, let's create the script that will send the email to you. In the Script tab, click the + button. In the Name field, enter any name for this script. POLICY In the field, leave alloptions checked. In the SOURCE field, place the command below and then click OK.
/tool e-mail to=(seu e-mail) body=(o que vai está escrito no corpo do e-mail entre "") subject=(o assunto do e-mail)
/tool e-mail to=(your e-mail) body=(what will is written in the body of the e-mail between "") subject=(the subject of the e-mail)



4. Agora, vamos criar a regra que vai monitorar a rede. Clique em IP e depois em DHCP SERVER
4. Now, let's create a rule that will monitor the network. IP and then click on DHCP Server

5. Na aba ALERTS, clique no botão +. No campo INTERFACE, selecione a placa de rede que será monitorada. No campo VALID SERVERS, coloque o endereço MAC do servidor DHCP ativo na rede, mas, autorizado por você. Assim, ele não irá tratar seu servidor DHCP como um desconhecido. No campo ALERT TIMEOUT, coloque depois de quanto tempo você quer ser informado novamente de um servidor DHCP desconhecido que já lhe foi avisando antes. Exemplo: O alerta detectou um servidor DHCP desconhecido na rede e lhe mandou um e-mail. Se você configurou esse campo com dez minutos, então, se daqui a dez minutos esse servidor DHCP desconhecido continuar ativo, o alerta vai te avisar de novo. O campo UNKNOW SERVERS é só de leitura. Quando o alerta encontrar um servidor DHCP desconhecido na rede, ele vai te mostrar o endereço MAC desse servidor. Assm fica mais fácil de você identificar qual é o dispositivo desconhecido. No campo ON ALERT, coloque o mesmo nome, exatamente igual com maiúsculas e minúsculas, script que você criou para lhe enviar o e-mail. Depois, clique em OK.
5. ALERTS tab, click the + button. In the Interface field, select the network card that will be monitored. VALID SERVERS in the field, put the MAC address of the active DHCP server on the network, but authorized by you. So he will not treat her as an unknownDHCP server. ALERT TIMEOUT in the field, then put on how long you want to be informed again of an unknown DHCP server that you have been warned before.Example: The alarm has detected an unknown DHCP server on the network and sent him an email. If you set this field with ten minutes, so if in ten minutes this unknownDHCP server remains active, the alert will warn you again. SERVERS UNKNOW field is read-only. When the alert to find an unknown DHCP server on the network, it will show you the MAC address of that server. ASSM is easier for you to identify what the unknown device. ALERT ON the field, put the same name, with exactly the same case,the script you created to send you e-mail. Then click OK.

Pronto. Sua rede está sendo monitorada, e, se alguém ativar um outro servidor DHCP que não tenha sido autorizado por você, um e-mail chegará na sua caixa postal com o aviso.
Ready. Your network is being monitored, and if someone activate another DHCP serverthat has not been authorized by you, an email will arrive in your mailbox with the warning.

terça-feira, 27 de setembro de 2011

Backup agendado e envio por e-mail no Mikrotik. / Scheduled backup and sending email in Mikrotik.

Neste tutorial, você vai aprender como configurar o seu servidor Mikrotik para que ele faça o backup automático e logo após envie pra você por e-mail. Para isso, você precisa dos seguintes pré-requisitos:
In this tutorial you will learn how to configure your server Mikrotik for it to do automatic backup and soon after to send you by e-mail. For this you need the followingprerequisites:
  1. Saber qual é o IP do servidor SMTP que você vai usar para enviar o e-mail;
  2. Ter um usuário e senha válidos desse servidor SMTP.
  1. Know what the IP of the SMTP server you will use to send e-mail;
  2. Have a valid username and password of SMTP server.
Vamos começar.
Let's start

1. Primeiro, vamos criar um script para criar o backup do seu servidor. Clique em SYSTEM e depois em SCRIPT.
1. First, let's create a script to create the backup of your server. Click System and thenSCRIPT.


2. Na aba SCRIPT, clique no botão +. No campo NAME, coloque o nome qualquer para esse script. No campo POLICY, deixe todas as opções marcadas. No campo SOURCE, coloque o comando abaixo e depois clique em OK:
2. In the Script tab, click the + button. In the Name field, put any name for this script.POLICY In the field, leave all options checked. In the SOURCE field, place the commandbelow and then click OK:

/system backup save name=o nome que quiser dar ao backup
/system backup save name=the name you want to give backup


3. Agora, vamos criar o script que vai enviar o e-mail para você. Na aba SCRIPT, clique no botão +. No campo NAME, coloque um nome qualquer para esse script. No campo POLICY, deixe todas as opções marcadas. No campo SOURCE, coloque o comando abaixo e depois clique em OK:
3. Now, let's create the script that will send the email to you. In the Script tab, click the + button. In the Name field, enter any name for this script. POLICY In the field, leave alloptions checked. In the SOURCE field, place the command below and then click OK:

/tool e-mail send file=(o nome que você deu ao script do backup criado no passo anterior seguido de .backup) to=(seu e-mail) body=(o que vai está escrito no corpo do e-mail entre "") subject=(o assunto do e-mail)
/tool e-mail send file=(the name you gave the script the backup created in the previous step, followed by .backup) to=(your e-mail) body=(what will is written in the body of the e-mail between "") subject=(the subject of the e-mail)


4. Agora, vamos configurar seu servidor Mikrotik com os dados do seu servidor SMTP para que ele envie os e-mails. Clique em TOOLS e depois em EMAIL.
4. Now we will configure your server with the data Mikrotik of your SMTP server so that it sends e-mails. Click TOOLS and then EMAIL.


5. No campo SERVER, coloque o IP do servidor SMTP que você vai usar. No campo PORT, coloque a porta 25. No campo FROM, coloque um usuário válido desse servidor SMTP que você usou entre < >. No campo USER, repita esse usuário válido sem < >. No campo PASSWORD, coloque a senha válida desse usuário que você utilizou. Agora clique em OK
5. In the Server field, put the IP of the SMTP server you will use. In the Port field, enter port 25. In the FROM field, put a valid user of the SMTP server that you used the <>. In the field USER, repeat this without valid user <>. In the Password field, enter the passwordvalid for that user that you used. Now click OK


6. Antes de fazer o agendamento dos scripts e, assim, torná-los automáticos, vamos testar se tudo está funcionando. Clique novamente em SYSTEM e depois em SCRIPT. Selecione o script que cria o backup e depois clique no botão RUN SCRIPT. Agora clique no botão FILES no menu de botões e certifique que o backup que você criou está lá. Se não está, volte para o início desse tutorial. Se está, volte a janela de scripts, selecione o script que envia o backup e clique em RUN SCRIPT. Agora verifique em sua caixa de e-mail se o seu backup chegou em anexo. Se não chegou, clique no botão LOG no menu de botões e verifique qual erro aconteceu no envio do e-mail.
6. Before making the scheduling of scripts and thus make them automatic, test that everything is working. Click again and then SYSTEM SCRIPT. Select the script thatcreates the backup and then click on RUN SCRIPT. Now click the FILES menu buttonsand make sure the backup that you created is there. If not, go back to the beginning of this tutorial. If you re-scripts window, select the script that sends the backup and click Run Script. Now check box in your e-mail if your backup arrived attached. If not here, click theLOG menu buttons and see what error occurred in sending the email.

7. Agora, se deu tudo certo, vamos programas para que o backup seja realizado e enviado automaticamente. Clique no botão SYSTEM e depois em SCHEDULER.
7. Now, if everything went right, let's programs for the backup is done and sent automatically. Click the button and then SYSTEM SCHEDULER.


8. Vamos criar o agendamento para executar o script do backup. Clique no botão +. No campo NAME, coloque o nome que quiser para esse agendamento. No campo START DATE, coloque quando esse agendamento deve começar. No campo START TIME, coloque que horas ele deve executar. No campo INTERVAL, coloque de quanto em quanto tempo esse agendamento deve ser executado. No meu caso, ele executa de sete em sete dias. No campo ON EVENT, coloque o mesmo nome, exatamente igual (com letras maiúsculas e minúsculas), do que você colocou no script para realizar o backup. No campo POLICY, deixe tudo marcado e clique em OK.
8. Let's create the schedule to run the backup script. Click the + button. In the Name field,enter the name you want for this schedule. In the START DATE field, set when theschedule should start. In the START TIME field, put what time it should run. In the Interval field, set how often to this schedule should run. In my case, it runs every seven days.EVENT ON the field, put the same name, exactly the same (with uppercase andlowercase), than you put in the script to perform the backup. POLICY In the field, leave everything checked and click OK.


9. Agora, vamos criar o agendamento para enviar o e-mail com o backup para você. Clique no botão +. No campo NAME, coloque o nome que quiser para esse agendamento. No campo START DATE, coloque quando esse agendamento deve começar (naturalmente, deve começar no mesmo dia que o agendamento do backup). No campo START TIME, coloque que horas ele deve executar (sugiro colocar cinco minutos após a hora que foi configurada no agendamento do backup). No campo INTERVAL, coloque de quanto em quanto tempo esse agendamento deve ser executado (sugiro o mesmo intervalo que o agendamento do backup). No meu caso, ele executa de sete em sete dias. No campo ON EVENT, coloque o mesmo nome, exatamente igual (com letras maiúsculas e minúsculas), do que você colocou no script para realizar o envio do e-mail. No campo POLICY, deixe tudo marcado e clique em OK.
9. Now, create the schedule for sending the e-mail with the backup for you. Click the + button. In the Name field, enter the name you want for this schedule. In the START DATEfield, place to start when the schedule (of course, must begin the same day as the backup schedule). In the START TIME field, put what time it should run (I suggest putting five minutes after the hour that was set up in the backup schedule). In the Interval field, set how often the schedule is to run this (I suggest the same range as the backup schedule). In my case, it runs every seven days. EVENT ON the field, put the same name, exactly the same (with uppercase and lowercase), than you put in the script to make sending e-mail.POLICY In the field, leave everything checked and click OK.


Pronto. Seu backup está configurado para executar automaticamente e ser enviado para você por e-mail.
Ready. Your backup is configured to run automatically and be sent to you via e-mail.

segunda-feira, 26 de setembro de 2011

Controle de banda simples por IP no Mikrotik. / Simple bandwidth control for IP in Mikrotik.

Nesse tutorial, você vai aprender a fazer um controle de banda simples por IP no Mikrotik. Para isso, você precisa dos seguintes pré-requisitos.
In this tutorial you will learn to make a simple bandwidth control for IP in Mikrotik. For this you need the following prerequisites.
  1. Saber quais IPs serão controlados;
  2. Noções básicas de endereçamentos IPs;
  3. Noções básicas sobre largura de banda.
  1. Knowing which IPs will be checked;
  2. Basics of IP addresses;
  3. Understanding bandwidth.
Vamos começar!
Let's start!

1. Clique em QUEUES e na aba SIMPLE QUEUES, clique no botão +.
1. Click QUEUE and Simple Queue tab, click the + button.


2. Na aba GENERAL, no campo NAME, coloque o nome que quiser. No campo TARGET ADDRESS, coloque um IP, ou uma faixa de rede (exemplo: 192.168.55.25 ou 192.168.55.0/24) que deseja controlar a banda. Marque os checkbox TARGET UPLOAD e TARGET DOWNLOAD. No campo MAX. LIMIT, selecione a velocidade desejada para upload e download, ou, coloque manualmente (OBS.: se colocar manualmente, não esqueça de colocar no final a letra "k" se for em kbits ou "M" se em megasbits). Depois clique em OK.
2. On the General tab, in the Name field, enter the name you want. TARGET ADDRESSin the field, put an IP network or a range (example: 192.168.55.0/24 192.168.55.25 or) you want to control the band. Mark the checkbox TARGET TARGET UPLOAD andDOWNLOAD. In the MAX field. LIMIT, select the desired speed for upload and download, or manually feed (NOTE: if you put manually, do not forget to put at the end of the letter "k" if it is in kbits or "M" in megasbits). Then click OK.


Pronto. Agora basta repetir a mesma regra com todos os IP que você queira controlar a banda. Nesse meu exemplo, o IP 192.168.55.25 só vai poder consumir, no máximo, 256 kbits do meu link total de internet.
Ready. Now just repeat the same rule to all IP that you want to control the band. In my example, the IP address 192.168.55.25 will only be able to consume up to 256 kbits of my total internet link.

Configurar DHCP Server e DHCP Client no Mikrotik. / Configure DHCP Server and DHCP Client in Mikrotik.


Neste tutorial, você vai aprender a realizar as configurações básicas do DHCP Server e DHCP Client do Mikrotik. Para isso, você precisa dos seguintes pré-requisitos:
In this tutorial you will learn to perform basic configuration of DHCP Server and DHCPClient Mikrotik's. For this you need the following prerequisites:
  1. Ter noções básicas de endereçamentos IPs.
  1. Have some basic IP addresses.
Vamos começar!
Let's start!


1. Vamos começar configurando o servidor Mikrotik para que ele funcione como um Cliente DHCP. Clique em IP e depois em DHCP CLIENT.
1. Let's start configuring the server Mikrotik to make it work as a DHCP client. IP and then click on DHCP CLIENT.

2. Clique no botão + e na aba DHCP, no campo INTERFACE, selecione qual a placa de rede que você deseja receber um IP automático. Deixe todas as outras opções marcadas e clique em OK.
2. Click the + button in the DHCP tab in the Interface field, select which network card you want to receive an IP automatically. Leave all other options checked and click OK.

3. Após clicar em OK, aguarde até que a placa de rede pegue um IP de algum servidor DHCP que está conectado à ela.
3. After you click OK, wait until the network card get an IP from any DHCP server that is connected to it.

Pronto. Seu servidor Mikrotik já está pegando IP automático. Agora vamos configurar ele para ser um servidor DHCP.
Ready. Mikrotik your server is already getting IP automatically. Now let's set it to be aDHCP server.
1. Clique em IP e depois em POOL. Aqui é onde vamos configurar o range de IPs que vocês deseja distribuir na rede.
1. Click IP and then POOL. Here is where we configure the IP range you want to distribute the network.

2. Na aba POOLS, clique no botão +. No campo NAME, coloque o nome que quiser. No campor ADDRESS, coloque o range de IPs (inicial e final) que você quer distribuir. Exemplo: 192.168.55.10-192.168.55.50. Nesse exemplo que dei, seu servidor vai distribuir IPs do final 10 até o final 50, ou seja, vai distribuir 40 IPs. Depois, clique em OK.
2. POOLS tab, click the + button. In the Name field, enter the name you want. Incamporee ADDRESS, put the IP range (initial and final) that you want to distribute.Example: 192.168.55.10-192.168.55.50. I gave this example, your server will distributeIPs to the end 10 end 50, or 40 will distribute IPs. Then click OK.


3. Agora clique em IP e depois em DHCP SERVER.
3. Now click on IP and then click DHCP Server.

4. Na aba DHCP, clique no botão +. No campo NAME coloque o nome que quiser, no campo INTERFACE selecione a placa de rede que irá distribuir os endereços IPs. No campo ADDRESS POOL, selecione o POOL que você criou no passo anterior. Marque o checkbox ADD ARP FOR RELEASE e clique em OK.
4. DHCP tab, click the + button. In the Name field enter the name you want in the fieldInterface select the network card that will distribute the IP addresses. In the field address pool, select the pool you created one. Mark the checkbox ADD FOR RELEASE ARPand click OK.

5. Agora clique na aba NETWORKS e depois clique no botão +. No campo NAME, coloque a rede que será distribuída. A mesma rede que você criou no POOL. No campo GATEWAY, coloque o IP do gateway da sua rede (na maioria dos casos é o IP do seu próprio servidor Mikrotik). No campo NETMASK, coloque a máscara de sua rede. No campo DNS SERVERS, coloque os IPs dos seus servidores DNS que será distribuídos. Depois clique em OK.
5. NETWORKS Now click on the tab and then click the + button. In the Name field, put the network that will be distributed. The same network that you created in the pool. In the Gateway, set the gateway IP in your network (in most cases is the IP of your own serverMikrotik). NETMASK in the field, put the mask on your network. DNS SERVERS in the field, put the IPs of your DNS servers that will be distributed. Then click OK.

Proto. Seu servidor DHCP está funcionando. Para saber quais máquinas da sua rede já pegaram IP do seu servidor, clique na aba LEASES.
Proto. Your DHCP server is working. To see which machines on your network has picked up your server's IP, click on the tab Lease.

domingo, 25 de setembro de 2011

Configurar IP, DNS, GATEWAY e NAT no Mikrotik. / Configure IP, DNS, gateway and NAT in Mikrotik.

Neste tutorial, você vai aprender a realizar as configurações básicas para o acesso a internet da sua rede interna. Para isso, você precisa dos seguintes pré-requisitos:
In this tutorial you will learn how to perform basic settings for the internet access from your internal network. For this you need the following prerequisites:
  1. Ter posse dos endereçamentos IPs de seu provedor de internet (IP, Gateway e DNS);
  2. NÃO utilizar internet ADLS (Velox, Speed e etc.) a não ser que, o modem esteja ROTEADO;
  3. Ter noção básica de máscaras de rede.
  4. Baixar o aplicativo WINBOX.
  1. Having ownership of the IP addresses of your ISP (IP, Gateway and DNS); 
  2. Do not use Internet ADSL (Velox, Speed ​​and etc.). Unless the modem is routed; 
  3. Have basic understanding of network masks. 
  4. Download the application Winbox.
Vamos começar.
Let's start.

OBS.: Para realizar as configurações a baixo vocês precisa fazer o download do programa WINBOX para poder se conectar no seu servidor Mikrotik.
OBS.: To perform the following settings you need to download the program Winbox to be able to connect to your server Mikrotik.
1. Renomeie as interfaces de redes para facilitar as configurações. Clique no botão INTERFACES, e na aba INTERFACES identifique qual é a sua placa onde está conectada sua rede interna e qual placa está conectada o roteador do seu link de internet.
1. Rename network interfaces for easy settings. Click INTERFACES. INTERFACESidentify which tab is where your card is connected to your internal network and which cardis connected to the router from your Internet link.



2. Dê um duplo clique na placa de rede desejada. Na aba GENERAL clique no campo NAME e coloque o nome que quiser para identificar essa placa. Após a alteração, clique em OK.
2. Double-click the network card you want. On the General tab click the NAME field and enter the name you want to identify this card. After the change, click OK.



3. Agora vamos colocar os IPs nas devidas placas. Clique em IP depois em ADDRESS.
3. Now let's put the IPs in the appropriate boards. Then click IP ADDRESS.

4. Clique no boatão + e no campo ADDRESS, coloque o ip da sua placa que está conectada na sua rede interna, depois, no campo INTERFACE, selecione a sua interface da rede interna. Faça o mesmo processo com o endereço ip da placa conectada ao link de internet.
4. Click the + and boatão ADDRESS field, put the ip of your card that is connected to your internal network, then the Interface field, select your internal network interface. Do the same process with the ip address of the card connected to the Internet link.

5. Agora vamos configurar o DNS. Clique em IP e depois em DNS.
5. Now let's configure the DNS. IP and then click DNS.

6. Na aba STATIC, clique no botão SETTINGS.
6. STATIC tab, click the Settings button.

7. No campo SERVERS, coloque o ip do servidor DNS. Se quiser colocar mais de um servidor basta clicar na SETA PRA BAIXO. Após, marque o checkbox ALLOW REMOTE REQUESTS. Se você não marcar esse checkbox a sua rede interna não vai conseguir resolver nomes, consequentemente, as páginas de internet não vão abrir. Depois, clique em OK.
7. SERVERS in the field, set the DNS server ip. If you want to put more than one serverjust click the arrow down. Then, select the checkbox Allow Remote Requests. If you do not select this checkbox your internal network will not be able to resolve names, hence theweb pages will not open. Then click OK.

8. Agora vamos configurar o gateway, ou seja, a rota padrão para conexões com a internet. Clique em IP e depois em ROUTES.
8. Now let's configure the gateway, ie a default route to internet connections. Click IP and then ROUTES.


9. Na aba ROUTES clique no botão +. Na aba GENERAL, no campo DST. ADDRESS coloque o IP 0.0.0.0/0 (significa que a rota que você vai colocar é pra QUALQUER destino que não seja da sua própria rede). No campo GATEWAY coloque o ip do equipamento que está conectado na sua placa de rede que dá acesso ao link de internet. Provavelmente esse equipamento é um roteador de seu provedor de internet. Depois clique em OK.
9. ROUTES tab click the + button. On the General tab, in the STD field. Use the IPADDRESS 0.0.0.0 / 0 (meaning that the route is going to put you to any destination thatis not its own network). In the GATEWAY ip put the equipment that is connected to your network card that gives access to the Internet link. Probably this equipment is a router from your ISP. Then click OK.


10. Agora vamos configurar o NAT. Clique em IP e depois em FIREWALL.
10. Now let's configure the NAT. Click IP and then FIREWALL.

11. Na aba NAT, clique no botão +.
11. NAT tab, click the + button.

12. Na aba GENERAL, no campor CHAIN, selecione a opção SRCNAT. no campo OUT.INTERFACE, selecione a placa de rede que está conectado o seu link de internet. Agora clique na aba ACTION e no campo ACTION, selecione a opção MASQUERADE. Depois clique em OK.
12. On the General tab, in camporee CHAIN, select the option SRCNAT.OUT.INTERFACE field, select the network adapter that is connected to your Internet link.Now click on the tab, and ACTION ACTION field, select the option MASQUERADE. Then click OK.



Pronto. Se você seguiu todos esses passos e colocou os endereçamentos corretos, a sua internet já deve está funcionando. Para testar, clique em NEW TERMINAL e depois ping para um site.
Ready. If you followed all these steps and put the correct address, your Internet should already be working. To test, click NEW TERMINAL and then ping a site.