Here is what the problem was. Connection to hidemyass is done by hma-vpn.sh script, you have to change
#!/bin/sh
cat <<EOEO >> /tmp/hma-ipcheck.txt
*******************************************
* *
* You are now connected to HMA Pro! VPN *
* *
*******************************************
Checking new IP address...
EOEO
nohup /tmp/hma-ipcheck.sh >/dev/null 2>&1 >
rm /tmp/hma-routeup.sh
EOF
to
#!/bin/sh
cat <<EOEO >> /tmp/hma-ipcheck.txt
*******************************************
* *
* You are now connected to HMA Pro! VPN *
* *
*******************************************
Checking new IP address...
EOEO
vpn_gw=\$(ip route | grep tun0 | grep 0.0.0.0 | cut -d" " -f3)
route del -net 0.0.0.0 gw {your-original-default-gateway}
route del -net 0.0.0.0 gw \$vpn_gw
route del -net 0.0.0.0 netmask 128.0.0.0 gw \$vpn_gw
route del -net 128.0.0.0 netmask 128.0.0.0 gw \$vpn_gw
route add default gw \$vpn_gw
echo "nameserver 208.67.222.222">/etc/resolv.conf
nohup /tmp/hma-ipcheck.sh >/dev/null 2>&1 >
rm /tmp/hma-routeup.sh
EOF`enter code here`
This will change your default gateway to be the vpn server.
You can skip echo "nameserver 208.67.222.222">/etc/resolv.conf
if your dns are accessible through the vpn