Saturday, July 02, 2005

Wahoo ! Surfs Up! Of the wireless kind.

Let me start off by catching up where I left. So, I'm back home, been a month now, swarmped by work, but tackling it all with new zest and ethusiasm. Wonders of a vacation.
So I've been watching a lot of movies, listening to a lot of music, and working my ass off. Meanwhile, since I got sick of using a dial up connection, I got myself BSNL's Dataone 256kbps line. I think it rocks coz I invariably get 35-40kbps downstreams. Anyway, dowloading stuff wasnt my intention. I just wanted a fast, always ON internet lifestyle ; )

So, first I got this working on windows, no sweat at all. The router that they give can be configured to dial-up internally [PPPoE] with DHCP and DNS, so all you have to do is power it up and connect the LAN cable. No need to use the WAN miniport driver on Win. Then I thought I should try this on Linux.

A little googling around shows how to setup PPPoE in Linux. Well, you can do it without PPPoE. Here's one of my HOWTO articles : )
My config:
1 really old Toshiba Portege
1 Ethernet pcmcia adapter [ This toshiba didnt come with an inbuilt port]
1 WUSB 54g (802.11g) WiFi adapter
Red Hat 9 , with kernel 2.6.12 .

I just HAD to setup this bband over WiFi !
Of course I had another WiFi client (

On the Toshiba:
ifconfig - a : shows two interfaces

eth0 subet [192.168.1.x]
wlan0 subnet [10.0.0.x]

Most Linux distro's come with dhcp clients, so on the Toshiba I did dhclient eth0 and got a 192.168.1.x IP assigned.

The wlan interface is all yours to configure, so set it up as you like. In my case, the 11g drivers for linux are discontinued , thanks to Connexant for not providing the programmers manual for Prism GT. So anyway, I used ndiswrapper , and installed the WinXP driver for the dongle on linux. Fired it up for Ad-Hoc mode.

On the client side, started Wifi similarly and got associated instantly.
Now that I was through with WiFi, I only had to bridge these two interfaces on the Toshiba.
This can be a bitch, coz it involves iptables. The whole netfilter code in the mainstream kernels has caused several pre-releases since 2.6.11

So anyway, albeit its really powerful, I just wanted to get surfing.
So all I did was, enable IP forwarding,

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

Set up chains in the NAT.
iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT
iptables -A FORWARD -i eth0 -o wlan0 -j ACCEPT

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

and voila !

Surfs Up !

Of course you need to setup various firewalls along with this. I had configured the router firewall, plus if I used WiFi on Windows, I had another firewall burning hot. :)