Tuesday, September 7, 2010

Linksys WRT160N / Cisco E1000 Setup on Mac Mini running Snow Leopard 10.6.4

-Hook modem's ethernet cable to "internet" port on 160N and then hook the mac mini's ethernet cable to any one of the four ports of 160N.
-Turn the power on for both modem and Linksys. Push the "reset" pin on Linksys for 30 seconds, then release.
-Open the network preferences and wait for the "Linksys WRT160N" to be displayed in Location. It might take a while. If it does not come, reboot the system. It should also detect following settings under Ethernet:
IP address:
Subnet mask:
Sometimes, it does not show these and keeps showing local host IP of 169.x.x.x. Well try forcing the above mentioned settings manually (with "Configure iPv4" as manually). But ideally it should show these automatically.
-Open and browser (anything other than safari.. as it has some settings saving issues as seen later) and type URL:
-You will now be prompted for Username and password for admin (linksys admin). Type the user name "admin" (without quotes) and password "admin" (without quotes).
-It will open the Linksys configuration page.
-Goto "Setup" tab. Under this tab, choose the sub-tab of "Mac address clone". It should be displaying the Mac address of your network card. Click "Enabled" and click "Clone my PC's MAC". Then click "Save settings". (if you are on safari...you might see broken page at this stage. The only known antidote.. use chrome or FF for Linksys configuration). You are done with "Setup"
-Now click the tab "Wireless". It will open the default sub-tab of "Basic Wireless settings". If you see some other sub-tab opened, open "Basic wireless settings". Choose a network name (SSID) and write it where prompted. Make sure the other fields are:
Configuration View: Manual
Network Mode: Mixed
Channel Width: 20MHz only
SSID Broadcast: Enabled
(for those who do not want their SSID broadcasted, can disable it but will have to remember their Network Name as it will never show up under show networks on iPod, iPhone, iMac etc)
Then click on "save settings". You are done with "basic wireless settings".
-Now click the "Wireless Security" sub-tab under "Wireless" tab. Choose following settings:
Security Mode: WPA personal (or whatever you choose)
Passphrase: . Should be minimum 8 characters and max 63.
Key Renewal: 3600 seconds (or whatever you choose)

"Save Settings" and you are done with "Wireless Security"
- Now click the tab "Security" and sub-tab "Firewall". Have following settings:
SPI Firewall Protection: Enabled
Filter Anonymous Internet Requests: UNCHECKED (its checked by default). Please note that this setting might be ISP (internet service provider) dependent. Keeping it unchecked worked for me.
Filter IDENT (port 113): Checked
Web Filter: Nothing checked (you can later check whatever you want. This is initial router setup to get it working).
"Save Settings" and you are done installing the router.

You should now upgrade the router firmware.
-Goto linksys site http://homesupport.cisco.com/en-us/wireless/linksys
Enter model number (wrt160N). And then goto Downloads
Enter your hardware version.. mine was "version 3.0" as3 it had "wrt160N v3" written next to the model name at the bottom of my router.
Click on "Download" under "Firmware".
Please remember, this binary that we just downloaded is Windows/mac/Linux agnostic as its going to be installed on the Router and not on the PC/Mac.
- Again type this url in the browser"
- Click "Administration" tab and select "Firmware upgrade" subtab. Then just follow the instructions on this page and you are done installing the router.

Setting up Static IPs to always hardwired machines
Ok, so the world isn't perfect. Even though Linksys claims that any device connecting to its wifi network will be given a unique autogenerated DHCP IP address, I have personally ended in so many instances where I randomly see IP address conflicts between two devices like iPod-Touch and my Mac mini (especially true for devices like iPod touch which keep connecting/disconnecting from network as they sleep/awake). So what's the way out: Static IP address allocation. Well its not the most elegant solution but for my home network, where I have tight control over which devices are permanently hardwired and which are not, it works out perfect. Also, if you are doing this for something exotic like a nuclear missile silo, please think twice before putting a machine that fires a nuke onto a static IP. As this means all the hackers in the world can leisurely attack it once they have found it. In case of DHCP, there is a bit of solace(but not much) that it might get reassigned a new IP after each disconnection-reconnection from network.

Strategy: Ok, so the strategy is move the always hardwired machines to static ip addresses. Keep the devices needing wifi connectivity like macBookPro, anyother laptops, iPods, iPads, iPhones etc on DHCP.

Approach: So, this brings us to the obvious questions.
  • 1) What are the range of available Static IP addresses to choose from.
  • Ans1) Choose from the range of through Then from through 192.168.254

  • 2)Is there a range of IP addresses that I should stay away from as it will be used by DHCP to generate
  • Ans2) The range that is used by DHCP to auto-generate IP addresses for devices connecting to the network is : through
  • Please note that this range is the default setting, that allows some 50 devices to connect and get autogenerated DHCP addresses. You can change the default setting by going to and the clicking Administration. Of course, any change in default settings also means you the Static IP available range also changes proportionally.

Parting Shot: This tutorial does not explain how to set static ip addresses for OSX. Google will help here.

Setting Up Mac Address Filtering
OK, I admit, I am bit paranoid when it comes to security. Now I am no expert but I try to do my bit and at least not leave the door open to intruders if not fortify and barricade it (thats squarely the domain of experts). Setting up Mac address filtering enables only the devices with particular mac address to be connected to the network. This is great for home networks.
Goto -> Wireless -> Wireless Mac Filter
Choose Enabled. Then choose "Permit PCs listed below to access the wireless network".
Then enter the MAc addresses of the devices that will be accessing the network.

Happy Browsing :)

Sunday, August 29, 2010

Using Perl CPAN on Mac OSX

Some of my notes on CPAN usage in Snow Leopard:

  • CPAN comes preinstalled in Snow Leopard. No new install needed and in fact not recommended unless something is broken or you know what you are doing.
  • Always login into CPAN via sudo or root (sudo is the recommended option): sudo perl -MCPAN -e "shell"
  • Its recommended to set FTP into passive mode so as to avoid having any troubles due to CPAN not being able to download from repositories via ftp. Create a file ~/.bash_login and add this to it: export FTP_PASSIVE=1
  • You can install any CPAN modules like this (here I am installing XMLWriter module) from CPAN prompt:install XML::Writer

Tuesday, August 17, 2010

Adding resume support to iPhone SDK downloads

Checklist on how to enable resume in Apple downloads

1) Download and install Firefox (if it isn't already installed)

2) Download and install Firefox add-on "Cookie Exporter" 1.5 or higher from here:


3) Goto Prefernces->Privacy and clean up all cookies

4)Login to your account at iPhone developer account at http://developer.apple.com (using Firefox with cookie exporter add-on already installed) and start the SDK download. Then cancel the download (yes, start the download and after it has started downloaded, cancel it). Also copy the download link.

5) Export the cookies via the installed add-on. Choose any file name for exported cookes, the default cookies.txt worked fine for me.

6)On terminal, type this (please note, I am limiting the bandwidth used to 10kBps. You can either drop the whole --limit-rate option and it will take up entire available bandwidth or choose some other bandwidth per your suitability.) :

wget --limit-rate=10k --tries=inf --server-response --continue --load-cookies cookies.txt https://developer.apple.com/iphone/download.action?path=%2Fios%2Fios_sdk_4.0.2__final%2Fxcode_3.2.3_and_ios_sdk_4.0.2.dmg

If it still complains about not being able to authenticate, use --no-check-certificate option as below

wget --limit-rate=10k --tries=inf --server-response --continue --load-cookies cookies.txt --no-check-certificate https://developer.apple.com/iphone/download.action?path=%2Fios%2Fios_sdk_4.0.2__final%2Fxcode_3.2.3_and_ios_sdk_4.0.2.dmg

If it still does not work, well its time to get a coconut or make a pilgrimage to Tirupati…. keep the Big Bro happy :)