Thursday, July 26, 2007

WinXP : Creating a wireless home network to share internet

A lot of people complained that I was too pro Linux. Here is a nifty way to create a ad-hoc wireless network at home and share internet over it using WinXP.

System : WinXP Pro/HP Media Center Desktop (any laptop/desktop with wifi card will do)
Broadband : BSNL 2 MBps ADSL
Connection type : Internet connected via pppoE(our internet gateway via ethernet)
and a wireless LAN adapter

Other Devices on the network : Nokia N80, Hp tablet pc, HP centrino laptop with ubuntu/fc6


Rich DeMuro, Senior Editor at Cnet.com, shows you how to do in this nice video
Creating an ad-hoc wireless internet sharing network

As they say, videos are better than step-by-step howtos, do message me if the above doesn't work for you.


Happy surfing.

*Updated: I just realized that Rich missed out how to assign IPs in case of WinXP to the devices. Follow these steps -
1. Assign a static IP 192.168.0.1 subnet 255.255.255.0
to the host's Wireless interface
(Control Panel > Network Conn. > Wireless network Connection > Properties > Internet Protocol(TCP/IP) > Properties)

2.Once the ad-hoc network is up, in all the client devices assign the following in a similar way as above
static IP 192.168.0.x where range of x is (2, 254)
subnet 255.255.255.0
Gateway 192.168.0.1
DNS 192.168.0.1


***updated March 29/2008
A lot of folks found this hard to configure. I wasn't expecting that. The entire purpose was to make this tutorial dead easy. Here is the summary:

1. wireless interface on XP
ip address: 192.168.0.1
subnet mask: 255.255.255.0

2. Your other network ethernet interface on XP, do nothing..you obviously will get ip, dns etc automatically from your isp (assuming, this is what is connecting you to the internet)

3. Enable internet sharing (as shown in video or WinXp pro users, check here)

4.On N80:
Phone ip address: 192.168.0.3
subnet: 255.255.255.0
default gatway: 192.168.0.1
primary dns: 192.168.0.1

(note: how the N80 gw and dns is same as the ip of wireless interface)

Purpose: We don't have a wireless router but are connected to internet via some ethernet port. We have a wifi card on the system, and we want to create an ad-hoc wifi spot at home, connecting other wireless devices to the internt using the wifi port on the pc. Packets will be routed via this wifi interface to the LAN/ethernet that connects us to internet. phew..

If you own a nokia N80, instructions are here .
For WinXp pro users, check here for an easier alternative

Tuesday, July 24, 2007

Ubuntu : Creating a wireless home network to share internet without router

System : Ubuntu Feisty/Centrino HP laptop
Broadband : BSNL 2 MBps ADSL
Connection type : Internet connected via pppoE on eth0 (our internet gateway)
wireless adapter eth1

Other Devices on the network : Nokia N80, Hp tablet pc, HP Desktop (with a wifi card)

Aim : To create an ad-hoc wireless network using the wifi card and share internet. Eth0 is connected directly to internet. Eth1 will be used to interface with the other devices in the network by creating the ad-hoc wireless network.

Basic Steps:
  1. Create an ad-hoc wireless network
  2. Bridge eth0 <----> eth1 and allow packet forwarding
  3. Assign IP statically or dynamically to clients on the network.

Creating an ad-hoc connection

1. From shell
# sudo iwconfig eth1 essid "WirelessNetworkName" mode Ad-Hoc key s:***********

where **************** is the WEP key in ASCII. Replace eth1 with the interface of your wireless card.

2. Your adhoc network should be up and your devices can start connecting to it. They still cannot start accessing the internet.


Sharing internet

Note: Type all the following commands in a root terminal, DO NOT use sudo.

1. Start by configuring the network card that interfaces to the other computers on you network:

# ifconfig ethX ip

where ethX is the network card and ip is your desired server ip address (Usually 192.168.0.1 is used) eth1 in our case.

2. Then configure the NAT as follows:

# iptables -t nat -A POSTROUTING -o ethX -j MASQUERADE

where ethX is the network card that the Internet is coming from

# echo 1 > /proc/sys/net/ipv4/ip_forward

3. Install dnsmasq and ipmasq using apt-get:

# apt-get install dnsmasq ipmasq

4. Restart dnsmasq:

# /etc/init.d/dnsmasq restart

5. Reconfigure ipmasq to start after networking has been started:

# dpkg-reconfigure ipmasq

6. Repeat steps 1 and 2.

7. Add the line "net.ipv4.ip_forward = 1" to /etc/sysctl.conf

# gedit /etc/sysctl.conf

8. # sudo iwconfig eth1 essid "WirelessNetworkName" mode Ad-Hoc key s:***********


Assigning IPs
1 .Either assign static IPs to the clients eg. 192.168.0.x
2. Or run a dhcp server on the host.

Note : In some devices like my Nokia N80, assigning static IPs could be tricky. Hence, dhcp is the best way to go.

We are done....
Now, all your devices can access internet without any need for an additional hub/switch/router.
Enjoy surfing,

tip: To revert back,
comment the "net.ipv4.ip_forward = 1" in /etc/sysctl.conf and
type "/etc/init.d/ipmasq stop"

Ubuntu : Setting up your broadband

System : Ubuntu Feisty
Broadband : BSNL 2 MBps ADSL
Connection type : pppoE

To get your broadband up and running, follow these steps -

1. Run "pppoeconf" as root via shell
2. Specify details like your ethernet interface, username, password, firewall etc.
3. Run "pon dsl-provider".

Voila !!, internet works now. Enjoy surfing..

4. To switch off the connection, type "poff -a"

Fedora Core 6 : Setting up your broadband

System : FC6 (Zod)
Broadband : BSNL 2 MBps ADSL
Connection type : pppoE

To get your broadband up and running, follow these steps -

1. Run "adsl-setup" as root via shell
2. Specify details like your ethernet interface, username, password, firewall etc.
3. Finally a summary as given below will be generated

** Summary of what you entered **

Ethernet Interface: eth0
User name: AnojSundar
Activate-on-demand: No
DNS addresses: Supplied by ISP's server
Firewalling: NONE
User Control: yes
Accept these settings and adjust configuration files (y/n)? y
Adjusting /etc/sysconfig/network-scripts/ifcfg-ppp0
Adjusting /etc/ppp/chap-secrets and /etc/ppp/pap-secrets
(But first backing it up to /etc/ppp/chap-secrets.bak)
(But first backing it up to /etc/ppp/pap-secrets.bak)

Congratulations, it should be all set up!

Type '/sbin/ifup ppp0' to bring up your xDSL link and '/sbin/ifdown ppp0'
to bring it down.
Type '/sbin/adsl-status /etc/sysconfig/network-scripts/ifcfg-ppp0'
to see the link status.

**


3. Type "/sbin/ifdown ppp0" to get the link up
4. Type "adsl-connect /etc/sysconfig/network-scripts/ifcfg-ppp0"
You'll find a similar message when you execute the above command.
Using interface ppp0
Connect: ppp0 <--> /dev/pts/4
CHAP authentication succeeded: Authentication success,Welcome!
CHAP authentication succeeded
local IP address 59.94.97.11
remote IP address 59.94.96.1
primary DNS address 218.248.240.79
secondary DNS address 218.248.240.135


Voila !!, internet works now. Enjoy surfing..

Wednesday, July 04, 2007

Accessing net in protected environments case 1


Over the next few months, I'll discuss cases where people use dumb ways to restrict internet access in corporate or training pcs.

place: SISL Delhi
description: SAP Training institute
type of restriction: IE content advisor restrictions
effectiveness scale: 2/10

Method: As an admin, just include certain website URLs in IE content advisor, that you would want your clients to access. Rest all URLs are blocked. This method seems to be infallable as only ie is the onl browser one has, installed on the pc.

Solution : To overcome this restriction, all you need is an alternate browser like opera or firefox. The tricky part is how? To download you'll have to download it off oepra.com or download.com but how to access these URLs in the first place.
Another alternate is to bring it in an USB or CD and install it (too time consuming)

: What if you don't have admin rights to your pc ? Generally opera installs without need for admin rights, which is supercool. Else, we will cover it in future case studies.


1. open cmd and ping google.com
2. If it works, then you are in luck. No need to sniff or configure proxies for your browser
3. Using ftp program, connect and get the download file
4. we are done. Happy surfing using Opera.

Assumption:
We assume, cmd is activated for normal users
ftp program is installed and available to use
You can install Opera or any other 3rd party apps

Friday, June 29, 2007

iPhone is here....

The wait for the miracle device is almost over. At 6 PM 29th June, which is just a day away from now , AT & T stores worldwide will open the iPhone to the world.
The handful of lucky souls who managed to get their hands on the exclusive wonder child of Steve jobs, had pretty nice things to say about it. Be it design, ease of use, features, style,... the iPhone has almost everything great going for it.

Recently Apple announced iPhone's capability of reading Office documents and hinted the possibility of accessing exchange mails on the device. Support of iTunes ringtones, and the inclusion of glass screen over the normal plastic LCDs, make it more desirable (less scratches and amazing ringtones)

So, is the iPhone infallible?
Is it the most perfect phone ever?
Should the likes of Nokia and Motorola feel intimaded and run for covers?

Well, to start off, it seems to be way cellphones were always meant to be.
For people in the US, going for AT & T could be only deterrent as far as I can think of. The lack of 3G could be a major drawback, but support for Wifi and the spawn of thousands of Wifi hotspots which are coming up in major cities all over the world, should be enough to satisfy the needs of users for the time being . Who knows, iPhone might accelerate this Wifing proccess further.

It's very clear that iPhone is targeted at a much wider user base, one of the reasons which Apple PR states in support of its lack of 3G module. Places like India and China could prove to be the biggest markets for Apple.

And for Nokia, Motorola and Sony Ericssons.., they now have a tough task on their hands, and they better put on their thinking hats, and come up with something, or else like the iPods, the iPhone is here to rule for years to come.

More news tomorrow when the iPhone comes out. Till then keep your fingers crossed . You might just get your hands on one of these if you are in luck, so start queuing outside your nearest AT & T store before its too late ..;)

Monday, May 14, 2007

Azureus Java Hotspot Bug

I have been using ubuntu for a few weeks not and have really enjoyed using it. A few glitches still need to be sieved out but still its a wonderful distro.

DEBUG::Mon May 14 22:11:20 SGT 2007::com.aelitis.azureus.core.versioncheck.VersionCheckClient::constructVersionCheckMessage::351:
Plugin 'azbpupnp' reported excessive info string 'howardsky-pc/11,MARCUSTAN: marcus:/3.0,VECTOR: Sridhar:/3.0,U0606145: AdminNUS:/3.0,HOWARDSKY-PC: Howardsky:/4.0,U0408648: Lim:/3.0,IBM-R51: AdminNUS:/3.0,nus-pc/11,TONYER: Tony:/3.0,KARISH-PC: karish:/4.0,LENOVO-7E809734: Thilina:/3.0,U0303074: sianchun/1.0,COFFEE: Sun Coffee:/3.0'
VersionCheckClient::getVersionCheckInfo::103,VersionCheckClient::getExternalIpAddress::138,AZMyInstanceImpl::readExternalAddress::207,AZMyInstanceImpl::getExternalAddress::336,AZInstanceImpl::encode::47,AZInstanceManagerImpl::sendMessage::348,AZInstanceManagerImpl::sendMessage::330,AZInstanceManagerImpl$request::::1213,AZInstanceManagerImpl::sendRequest::1172,AZInstanceManagerImpl::search::661,AZInstanceManagerImpl$4::runSupport::241,AEThread::run::69
#
# An unexpected error has been detected by Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0xb485a172, pid=15344, tid=3084807056
#
# Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing)
# Problematic frame:
# C [libglibjni-0.4.so+0x9172]
#
# An error report file with more information is saved as hs_err_pid15344.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
Aborted

This above bug is really troublesome. I installed Azureus through add/remove. It worked like a charm for a few minutes and then suddently crashed. After that, I started receiving this message, and Azureus would fail to start. The reason is that the packages in repos are still old and won't work with jre 1.5 and higher.

The fix is very simple. Download the Azureus2.jar from the
latest Azureus 2.5 Release [2.5.0.4].
Replace it in /usr/share/java/


and it starts working again ;)

Sunday, April 29, 2007

Ubuntu Feisty 7.4 vs Fedora Core 6 Part 1


Recently I tested the new Ubuntu Feisty and was tempted to compare it with my trusty old FC6. Here are my observations.
1. Download: Ubuntu came in a feature rich 700 MB iso whereas the FC6 was a 3.2 + GB iso.
That was the only version apart from the 5 CD isos for FC. Both were downloaded off the nearest mirror which was in the university itself, hence really fast downloads.
With ubuntu, I spent another few hours or so downloading the extra packages, which wasn't the case in FC.
Remarks : Ubuntu's slick compilation of packages in the 700 MB iso is good for the normal users but for power users who want their servers and development tools, FCs 3.2 GB, satisfies all.
Result: Tie Ubuntu 1 FC 1
2. Installation: Both came with a graphical installation and seemed very similar. Ubuntu had an additional option of migrating windows accounts to ubuntu, which may not be a much useful feature for home users. It also didn't give me an option to import my fedora user accounts to ubuntu, which was disappointing. FC6 installation gave you more options to customise and choose the packages, the bootloaders etc, whereas ubuntu installation was click and configure everything default.
Feisty's simple installation reaches well with new linux users but the power users would still expect more customisation options.
Remarks: Ubuntu's live cd, no frills installation targets the new users who might find FC6 installation a bit more overwhelming. Again no losers.
Result: Ubuntu 2 FC 2