Wednesday, January 21, 2009

connect office networks with vpn on linux

-install licensed cisco vpn client on windows os to check if it works fine.
-copy the *.pcf file which is the configuration file.
-on your linux install vpnc
-run following to get the value for [decrypted enc_GroupPwd]
cisco-decrypt [value of enc_GroupPwd from the *.pfc]
-now edit /etc/vpnc/default.conf with values from pfc file
IPSec gateway [Host]
IPSec ID [GroupName]
IPSec secret [decrypted enc_GroupPwd]
Xauth username [your username for vpn connection]
-now run "sudo vpnc", it would ask for password key and once set runs as a background process
-to disconnect type "vpnc-disconnect"

Sunday, January 18, 2009

Register and create your website - all for free

DOMAIN REGISTRATION AND DNS FOR FREE
-Open account on freedns.afraid.org
-I did not have any domain registered. once logged in, click the "registry" to choose your domain eg. mooo.com and click on it. Ensure that the domain is public.
-Now you are creating a subdomain from the available domains. Select type A, type your subdomain eg. I did bhupendra. Your external ip would already be captured. Hit save and you are done.

SETTING UP LOCAL SITE
-I have a laptop running fedora 10 configured to netgear wireless router and had to make few changes as follow:
#router changes ------------------------------------------------------------------------------
-keep router as DHCP for devices attached to the network eg. my laptop however I reserved 192.168.1.2 for my laptop
-enable port forwarding for http on port 80 from my router to
192.168.1.2
-both the above steps can vary depending on your router however most of the basic router do come with these features. Also be sure to upgrade your firmware just to get best security and features.
#laptop changes-------------------------------------------------------------------------------
-system should be aware of the network ip address. I removed the dhcp setting for my wlan0 and set static ip of 192.168.1.2 with subnet mask of 255.255.255.0 as specified by my router.
-open system-config-firewall and enable http/80 which is disabled by default
-install apache. yum install httpd httpd-tools
-edit /etc/httpd/conf/httpd.conf to remove welcome page include and/or comment entries in /etc/httpd/conf.d/welcome.conf
-create /var/www/html/index.html to serve your custom welcome page
-"apachectl start" to start your apache.

TEST
-goto http://localhost to verify if your apache is up and default index.html is picking up
-goto http://192.168.1.2 or http://yournetworkip to see if your static ip for network is all ok
-goto http://bhupendra.mooo.com to check if your external domain is working

A WORD FOR IMPATIENT
If you are impatient like me, just take a break go out for a smoke or something. And even after few hours things dont work, get a manual for your router which I did and found about a NAT filtering option which is a firewall on the router which was blocking the port forwading. I changed the NAT filtering from secured to open and things began to work.

EXTERNAL IP ALWAYS CHANGES? no probs
-download script to update the external ip from http://freedns.afraid.org/scripts/freedns.clients.php
-I use http://freedns.afraid.org/scripts/dnsactual.sh.txt simple and clean. Just download the script, remove txt, give permission of your default user on linux and add crontab entry to schedule it to run say 5 min or more as per your ip lease expiry.

THE DOWNSIDE AS I SEE IT........
http://freedns.afraid.org/faq/#16
alternative: If you want your site to be google seo friendly then register a domain (not free) and set the domain in your freedns account. you can then create subdomain on the registered domain instead of using it off the available freedns public domains.