After reading a LOT of topic, wiki and Google, I haven't found a suitable way to generate ssl keys for RouterOS (2.9.34). Better: I found the way, but RouterOS doesn't want it! Winbox wouldn't to import my key/certificate. I try to follow the howto for certificate import, but no success...when I try to give a "decrypt" command, he ask me the passphrase, but no keys decrypted follows...I'm (quite) desperate! This is what I do: - generating the private key and certificate in this way:
- two file are generated: hotspot.mynetwork.net (certificate) and hotspot.mynetwork.net.key (private key) - upload the two file via FTP to an RB153 with RouterOS 2.9.34 - login via telnet to the RB153:
This HowTo is intended for use on MikroTik RouterBoard 112/153, with RouterOS 2.9.34.
Open your winbox utility, and connect to the board through MDP (or do a "/system reset" on a board already in use):
Click on "New Terminal".
Now we are going to control our interfaces, and to enable/disable whoes of our interest (I have a RB 153):
Quote:
[admin@MikroTik] > /interface print Flags: X - disabled, D - dynamic, R - running # NAME TYPE RX-RATE TX-RATE MTU 0 R ether1 ether 0 0 1500 1 R ether2 ether 0 0 1500 2 R ether3 ether 0 0 1500 3 R ether4 ether 0 0 1500 4 R ether5 ether 0 0 1500 5 X wlan1 wlan 0 0 1500 [admin@MikroTik] > interface [admin@MikroTik] interface> set 1,2,3,4 disabled=yes [admin@MikroTik] interface> set 5 disabled=no [admin@MikroTik] interface> print Flags: X - disabled, D - dynamic, R - running # NAME TYPE RX-RATE TX-RATE MTU 0 R ether1 ether 0 0 1500 1 X ether2 ether 0 0 1500 2 X ether3 ether 0 0 1500 3 X ether4 ether 0 0 1500 4 X ether5 ether 0 0 1500 5 wlan1 wlan 0 0 1500
Set a name for the Interfaces (without space on thw wireless interfaces, otherwise the hotspot setup will fail, I think that's a bug).
Quote:
[admin@MikroTik] interface> set 0 name=internet [admin@MikroTik] interface> set 5 name=hotspot [admin@MikroTik] interface> print Flags: X - disabled, D - dynamic, R - running # NAME TYPE RX-RATE TX-RATE MTU 0 R internet ether 0 0 1500 1 X ether2 ether 0 0 1500 2 X ether3 ether 0 0 1500 3 X ether4 ether 0 0 1500 4 X ether5 ether 0 0 1500 5 hotspot wlan 0 0 1500
Now, we are going to setting-up the wireless interface
Quote:
[admin@MikroTik] interface> wireless set hotspot ssid=IZ3HAD band=5ghz frequency=5280 mode=ap-bridge periodic-calibration=enabled
Set an IP address for the "internet" interface, it's default gateway and it's dns. The option allow-remote-requests is to speed up the dns by caching the local request to the MikroTik box.
Quote:
[admin@MikroTik] interface> /ip [admin@MikroTik] ip> address add address=192.168.10.99/24 interface=internet [admin@MikroTik] ip> route add gateway=192.168.10.1 [admin@MikroTik] ip> dns [admin@MikroTik] ip dns> set primary-dns=192.168.10.1 [admin@MikroTik] ip dns> set allow-remote-requests=yes [admin@MikroTik] ip dns> .. [admin@MikroTik] ip> ..
Now, create a certificate on a Linux Machine. A script could be the follow:
Then, give it the execution properties and execute it:
Code:
chmod +x myscript ./myscript
Give your password three times. Give all the information required (CA, email, ecc.).
Two file are produced: --- hotspot.mynetwork.net is the certificate --- hotspot.mynetwork.net.key is the private key
Put this (via FTP) file on the root of MT Board. Return to the MT Board CLI and give the following commands to import the certificate and the private keys:
[admin@MikroTik] certificate> print Flags: K - decrypted-private-key, Q - private-key, R - rsa, D - dsa 0 KR name="cert1" subject=C=IT,ST=xxxx,L=xxxx,O=xxxx,OU=xxxx,CN=IZ3HAD,emailAddress=xxxx issuer=C=IT,ST=xxxx,L=xxxx,O=xxxx,OU=xxxx,CN=IZ3HAD, emailAddress=xxxx serial-number="xxxx" email=xxxx invalid-before=nov/13/2006 13:13:27 invalid-after=nov/12/2009 13:13:27 ca=yes
It's time to set-up your hotspot.
Quote:
[admin@MikroTik] certificate> /ip hotspot [admin@MikroTik] ip hotspot> setup hotspot interface: hotspot local address of network: 192.168.100.1/24 masquerade network: yes address pool of network: 192.168.100.100-192.168.100.254 select certificate: IZ3HAD ip address of smtp server: 0.0.0.0 dns servers: 192.168.10.2 dns name: hotspot.mynetwork.net name of local hotspot user: admin password for the user: ******* [admin@MikroTik] ip hotspot>
To force the authentication mode to "only HTTPS", type this:
Quote:
[admin@MikroTik] ip hotspot> profile [admin@MikroTik] ip hotspot profile> set hsprof1 login-by=https
If you have a freeradius server, add in /etc/raddb/clients.conf a new entry like this:
Now you have a secured hotspot! Connect your client to the MT, and type any address on Firefox: you will get a certification approval request, it's yours!
Hints If you disable Connection Tracking, the HotSpot will not be able to redirect your connection.
P.S.
I found a perfectly working guide on a previous topic to made this config, but there was nothing on the SSL side, and no or erroneus info found for a "secure" hotspot authenticating on the rest of the forum, so I decided to made a new howto.
Thanks to Normis for it's hint.
73 de IZ3HAD
_________________ Bye
IZ3HAD, Mirco
Last edited by mipland on Tue Nov 14, 2006 10:58 pm, edited 4 times in total.
Sure, it's 100% working. I resetted my board and try to follow my howto as posted to made a hotspot. I powered on my laptop and it gives an IP from the hotspot DHCP's. Then, after started FFirefox, it request me to accept the certificate and show up the login page. The login, redirect, logout work perfectly.
I'm trying to register myself on wiki, but it appears to have some problem...I'll try later and I'll insert my howto.
Post subject: Re: [SOLVED] Hotspot with SSL: Private Key and Certificate fail
Posted: Tue Aug 19, 2008 12:57 pm
just joined
Joined: Sun May 11, 2008 10:02 pm Posts: 21
Karma: 0
I tried this tutorial and it works really good, thanks very much, everything is very well explained and you should definitely publish it in MikroTik wiki.
I don't know if the live cds are able to do this, if they have OpenSSl installed, i'm pretty sure it is possible.Then you just need an ftp client (I used Filezilla) and ssh or telnet to do the rest. Try to do everything on linux, because if you import your self signed certificate to windows it is possible that the properties of the file change and the certificate wont work. But you can try
After install go to the /bin directory and run the executale file, you can then create your own certificate and private key with this two simple commands:
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum