Pages

Friday, 31 January 2014

Mobile Education

I decided to publish a video of the project I have been working with Dr. Pavlin Dulev for some time now. Please let me know if there is any interest corporate or not, we are seeking sponsorship. The server side consists of a panel for the teachers where they can set up tests for their students and share video lecture material. Everything is downloaded to the mobile device (Android) and from there the student can do the tests or view the lectures. For best results view the video in Full Screen Mode, high resolution. The teachers panel is coded in PHP+MySQL, the Android application is Java+Android SDK. 


Thursday, 23 January 2014

Zentyal - Mail Server - Webmail and RDNS

I have set up a mail server based on Zentyal and was very happy with it, but noticed a issue with the RDNS test. So I remembered that I just clicked Next when I set up the server on host name - I should have thought on the consequences first. When you set up Zentyal and set the domain name and hostname be sure that it matches what you need for the mail service. If you change it afterwards in System>General> Hostname&Domain you will have to recreate all the mailboxes and aliases in Office>User and Computers>Manage. But this was only the begining of this adventure:

I got an error on the webmail:

DATABASE ERROR: CONNECTION FAILED!
 
Unable to connect to the database!
Please contact your server-administrator.

To fix this:
Disable the webmail service in 'Module Status'
sudo nano /etc/mysql/conf.d/zentyal.cnf
and change this line as shown: innodb=on
then: service mysql restart
get the MySQL pass: sudo cat /var/lib/zentyal/conf/zentyal-mysql.passwd
then: sudo mysql -p
Execute this query: DROP DATABASE roundcube;
Run this script: sudo /usr/share/zentyal-webmail/enable-module
Re-enable the webmail service in 'Module Status'

Easy huh. Everything is working now. Think about it when you click Next.


Friday, 10 January 2014

Mikrotik Setting up ntp client

Having logs and not having the correct time on them is as bad as not having any logs at all. This is how you can set up your ntp client to have the correct time on a Mikrotik.

/system ntp client> set enable=yes primary-ntp=[:resolve 0.bg.pool.ntp.org] mode=unicast

Don't forget to change the ntp server to whatever you need.

You can check the current time afterwards:

/system clock> print

Tuesday, 7 January 2014

VMware VCA Certification

VMware is offering now free training courses. During the holidays I got really bored so I took the VCA-Cloud Training course and did the exam today for breakfast and passed it - VMware Certified Associate - Cloud.

Try the free courses they are really useful for understanding the basic concepts, there is also free practice exam available on the site:
http://mylearn.vmware.com/mgrReg/plan.cfm?plan=40721&ui=www_edu

VMware OVF Tool

Tried converting a VMX file today to OVA so I can migrate it to another environment. It's pretty easy actually all you have to do is: 
1. In cmd go to C:\Program Files (x86)\VMware\VMware Player\OVFTool
2. Convert with ovftool by executing ovftool.exe <path>\<file>.vmx <path>\<file>.ova

Mikrotik Destination NAT

This is very useful in case you want to make services available from your router to the public. In the example I have shown destination NAT for FTP. Also don't forget to allow such traffic in the firewall - might get filtered out.

/ip firewall nat add chain=dstnat dst-address=<real ip> protocol=tcp dst-port=20-21 action=dst-nat to-addresses=<internal ip> to-port=20-21 

Thursday, 19 December 2013

Mikrotik Wifi - NAT and DNS

I had to spend some time to figure how to get my Mikrotik router working with my WiFi. It seemed either the DNS did not work or the nat was wrong, well it was the NAT. 

Here is some experience, some key points. Not neccesary in the correct order, but hope it helps you. 


After setting up the wifi networks (2 - one guest and one primary).

The IPs for the networks:

/ip address
add address=<internal network>/<mask> comment="default configuration" disabled=no \
    interface=wlan1 network=<internal network>

This will set the real ip to the WAN port:

add address=<real ip>/<mask> disabled=no interface=ether1-gateway network=\
    <the isp network>

add address=<internal network>/<mask> disabled=no interface=bridge-local network=\
    <internal network>
add address=<guest network>/<mask> disabled=no interface=wlan2 network=<guest network>


Set the address list:

/ip firewall address-list
add address=<internal network> disabled=no list=Internal
add address=<guest network> disabled=no list=Guest

<other IPs and networks>

And the DHCP pools too:
/ip dhcp-server config
set store-leases-disk=5m
/ip dhcp-server network
add address=<internal network>/<mask> comment="default configuration" dhcp-option="" \
    dns-server=<set the internal ip of the router here> gateway=<set the internal ip of the router here> netmask=<mask> ntp-server="" \
    wins-server=""
add address=<guest network>/<mask> dhcp-option="" dns-server="" gateway=<set the internal ip of the router here> \
    ntp-server="" wins-server=""

Set the dns:
/ip dns
set allow-remote-requests=yes cache-max-ttl=1w cache-size=2048KiB \
    max-udp-packet-size=4096 servers=<isp dns>
/ip dns static
add address=<isp dns> disabled=no name=router ttl=1d


Add this to the firewall to allow established connections:

/ip firewall filter
add action=accept chain=input connection-state=established disabled=no \
    in-interface=ether1-gateway

You have to add a nat rule for the guest and primary wifi networks to use the WAN port:

/ip firewall nat
add action=masquerade chain=srcnat disabled=no out-interface=ether1-gateway \
    src-address=<internal network>/<mask>
add action=masquerade chain=srcnat disabled=no out-interface=ether1-gateway \
    src-address=<guest network>/<mask>

Add a route to have access to the outside world

/ip route
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=<isp gateway> scope=30 \
    target-scope=10