Friday, July 27, 2007

Nokia N80 : Assigning static IPs



In one of the articles I mentioned, assigning static IP to N80 is a little tricky. Here is where I show you how to do so. Nokia has concealed this highly useful option and the following steps will show you how to locate it and assign static IP settings to your wonderful phone.

1. Goto Menu > Tools > Settings > Connection > Access point
2. Select the desired access point and edit
3. Configuration settings of your acess point is displayed. Now Go to Options > Advanced Settings.
4. Advanced settings menu opens. Select IP v4 Settings.
5. In IP v4 settings, select the Phone IP Address (default : automatic)
6. In this screen, you can assign ip address, gateway, subnet mask etc.
7. If you wish to revert back to automatic IP, type 0.0.0.0 as the IP address.
8.In the IP v4 settings screen, you can also assign a primary and secondary DNS manually.

Note : Static IP assignment is needed only when your wireless network doesn't support a dynamic IP assignment (no DHCP)

Win XP : Internet Sharing the easy way

Assumptions : As in previously covered articles, your host has 2 ethernet adapters - 1 connected to the internet and another (wireless one) connected to rest of the devices on your network on an ad-hoc wireless network created.

Follow these steps if you have Windows XP Pro or Media Center Edition. This automatically configures internet sharing and automatic IP assignment to clients (dhcp).

Note : Your ad-hoc wireless network should be up and running prior to doing this. Let us start..




1. Select Network Setup Wizard either from Control Panel or from Control Panel > Network Connections














2. Network Setup Wizard opens, Keep clicking on next till the following screen shows up.















3. Select the first option as you are the host and all the other devices are on the network are going to access the internet through you. Click Next


















4. Select the ethernet port directly connected to the internet. In my case its the PPPOE connection. In many of your cases, Local Area Connection would be the preferred choice.
Click Next












5. Select the port/connection that connects to rest of the devices on your network. In our case, we have used the Wireless LAN to create an ad-hoc network and connect to other devices on the network.
Click Next














6. Enter your host computer's name and description.
Click Next














7. Enter a Workgroup name. When you chose later to switch on file and printer sharing, the workgroup settings are a must.
Click Next












8. If you also wish to use the network to share files and printer, chose the first option. If you only want to share internet, select the second option.
In my case, I want to share files on the network as well.
Click Next.





9. Summary of all your selections are displayed. Afer verifying them, click Next



10. The Wizard starts configuring your home network. Sit back and relax for a while.





11. We are almost done. Windows will ask you how you wish to configure the clients not running XP. Select the last option and click Next.





12. Congrats. You have successfully configured your home network. Internet will be shared among all your clients connected to your pc via the ad-hoc wireless network.
Click Finish.




Observe in your client machine (Centrino Laptop/Ubuntu in our case) all network settings are auto configured - IP, DNS, Gateway et. Filesharing is also on with the host (192.168.0.1)

Hope you liked the above tutorial. Happy Surfing !!


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