oriolrius.cat

Des del 2000 compartiendo sobre…

Tag: routeros

Mikrotik as a PPTP server for Android

Reading time: 4 – 6 minutes

Two years ago I installed a Mikrotik Cloud Switch and lately I stoped my pfSense and I started using that switch as my network router, firewall and also as a switch. RouterOS is really powerful and allows to do a lot of things with that hardware. One of those things is set-up a VPN server based on PPTP. This is not the most secure way to create VPNs but usually the only requirement is a little bit of security on top of an IP over IP service that allows us to use local service when we’re in remote. In my case I have a lot of services in my LAN and I need some of them when I’m out of home specially I need to use them from my mobile phone.

Next steps describe how I set-up a PPTP server on my Mikrotik server allowing my Android 6 device (Huawei Mate 8) to connect to my home services through the VPN. Bellow you have a simple schema representing the schenario of the solution:

architecture

I’m only going to describe steps from the web console, of course, all those steps can be done using Winbox or the command line. To be honest I’m not used to RouterOS CLI but I think it’s not difficult to figure out the CLI commands to get the same result.

First step is set-up a pool of IP addresses to be assigned to the tunnel endpoints.

01-ip-pool

02-ip-pool

Thanks to an ARP proxy those IP addresses will be available like local IPs, this is transparent for the VPN configuration.

00-arp-proxy

configuration of connection profile is done inside “Profiles” tab:

05-profiles

first of all create a new profile called “default-encription”:

061-profiles

and another profile called “pptp-profile”:

06-profiles

“Secrets” tab is where you have to manage users, in my case only two users are created:

07-secrets

configuration details about my user are:

08-secrets

Inside PPP menu there is a button with a label “PPTP server” click there…

03-pptp-server

… and copy next settings:

04-pptp-server

Don’t forget to check that your PPTP port is accessible from your public IP address. Remember it’s 1723/TCP.

Android configuration is simple, first of all go to “settings” icon. Look for a “More” section bellow network options, and you’ll find VPN managment. Add a new connection, define a name, the type and the IP address and leave the rest by default. After that when you come back to VPN list you’ll find your new VPN in the list, click there and just set-up your PPTP credentials.

android

If you have some trouble the only thing that you can do is go to Mikrotik logs or start sniffing to figure out where is the problem. I had to do some tests before it was working but in the end everything was so simple like I explained here.

Good luck and enjoy it.

Thanks to next blog entries to inspire me:

 

 

RouterOS el sistema operatiu de Mikrotik

Reading time: 3 – 5 minutes

mikrotik.png

Ahir vaig poder jugar unes quantes hores (unes 6h) amb el RouterOS el sistema operatiu que usen els dispositius Mikrotik. Fins ara no hi havia pogut jugar gaire estona (durant 1h aproximadament) però ahir realment vaig poder aprofundir una mica més en aquest sistema. A priori sembla força complex o una mica difícil d’usar, sobretot per la sintaxi i que no hi ha un manual que expliqui com treballar amb la CLI. Bàsicament el truc és usar el Winbox que és una utilitat semi-gràfica que simplifica molt les comandes al més pur estil CLI.

El que més m’ha agradat d’aquest sistema operatiu és el seu gran dinamisme però sense caure en la complexitat d’haver de mantenir un sistema operatiu de PC. S’ha de dir però que de senzill no ho és gaire, és a dir calen coneixements tècnics per poder usar-lo, no tant per la sintaxi sinó perquè s’ha de treballar a baix nivell. És a dir, no usa aquest coi d’assistents de configuració que tan em molesten sinó que has de tenir clars els conceptes de xarxes per tal de fer les configuracions del dispositiu. En part recorda al IOS de Cisco, però jo diria que és molt més senzill i orientat a les aplicacions per les que està pensat. A més malgrat no ser lliure les llicències són molt més econòmiques que les de Cisco. També cal dir que malgrat esta pensat per les plaques embedded de Mikrotik també pot funcionar en arquitectures PC i d’altres.

Obviament esta molt orientat a serveis que es donen des d’un AP, ja que els equips de Mikrotik són escencialment equips de WiFi. Però arriben a soportar serveis com ara servidors RADIUS, servidors d’VPN, servidors RAS, proxies, etc. Per no parlar de les eines d’escaneix de freqüències i d’altres eines més enfocades a les xarxes sense fils. Obviament el hardware que suporta és força limitat però s’ha de pensar que esta molt orientat a tasques de routing, firewalling, hotspot gateway, bridging, client access, etc. així doncs no interessa tan el fet de suportar un gran ventall de hardware com el fet de ser molt potent en les funcions comentades.

En l’aspecte referent al WiFi destacar la capacitat de publicar més d’un SSID simultaneament, a més de poder actuar simultaneament com a AP, client o bridge. A més de suportar múltiples sistemes de xifrat: WEP, WPA-PSK, WPA-RADIUS, WPA2, etc. A l’hora de montar un hotspot també és brutal la capacitat que té de simplificar els passos per montar-lo i els sistemes d’autenticació, les formes i llocs on pot tenir o demanar les BBDD d’usuaris, a més d’estar completament preparat per montar un sistema AAA i unir-lo amb un sistema de facturació, per exemple. A més per internet he vist diversos programes orientats a facturar com a WISP o per propietaris de hotspots, com hotels i d’altres similars.

Així doncs estic molt content d’aquest descobrimient, a veure si puc completar les proves de l’escenari que estava provant les quals encara no les he pogut acabar al 100% però ja puc quasi assegurar que funcionaràn amb el que he vist fins ara. Així doncs Jordi el sistema mixte de hotspots de Mikrotiks amb Linksys (amb DD-WRT v23 SP2) ha de funcionar quasi segur quan ho tingui llest ja passaré la configuració per aquí. Si voleu ampliar coneixements sobre les funcions que ofereix el routerOS sobretot no ús perdeu aquest resum (local).

Sputnik: AAA centralitzat en wifi

Reading time: 2 – 3 minutes

sputnik.gifAvui he descobert per casualitat a través del DD-WRT el servei d’AAA que ofereix l’empresa Sputnik a través d’internet, com a servei, venent el software i fins hi tot el
hardware si ens interessa. Realment el tema m’ha semblat molt bona idea. Ja que un WISP podria montar una infraestructura realment molt professional gràcies només a aquest software i a hardware tan econmòmic com el Linksys WRT54GL o d’altre una mica més professional com ara el de mikrotik.

A més ens permet unificar serveis de portal captiu de forma molt senzilla, ja que per exemple, a través de la última versió del firmware DD-WRT del WRT54GL i del client de Sputnik per routerOS de mikrotik. Podriem montar una solució completament integrada. Les avantatges són infinites val la pena donar un tomb per la web de l’empresa i fer volar la imaginació.

Resumint les solucions software d’Sputnik, tindriem això:

  • Embedded software, the Sputnik Agent, running on a growing number of wireless access points (APs) or powerful network gateway
  • Server software, Sputnik Control Center, which runs in your data center, or which we provide as the hosted SputnikNet service
  • Business software Modules, options that enable service providers to charge credit cards, PayPal® accounts, utilize pre-paid cards, or plug into existing RADIUS or Microsoft® Active Directory “single sign-on” systems

A continuació us recomano donar un cop d’ull al següent gràfic que us servirà per aclarir les idees, de com funciona tot plegat.

network_sputnik_powered.png

Realment de tan en tan, troves coses amb les que t’emportes grates sorpreses. Llàstima que no tinc mai prou temps per provar les coses a fons, perquè aquest s’ho val.