Search This Blog

Showing posts with label wireless. Show all posts
Showing posts with label wireless. Show all posts

Sunday, December 25, 2011

verizon router dhcp getting a fixed IP address

I am currently using Verizon DSL to connect to the internet. So, I have

laptop -> router -> internet

A minor irritation with this set up is that the router can potentially assign different IP addresses whenever I do a reboot or something akin to /etc/init.d/networking restart. For example today it can be 192.168.1.58, tomorrow it could be 192.168.1.68 etc.,

I currently have

$ifconfig
eth0 Link encap:Ethernet HWaddr 00:15:c5:19:9c:1a
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:17

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:6790 errors:0 dropped:0 overruns:0 frame:0
TX packets:6790 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:773105 (754.9 KiB) TX bytes:773105 (754.9 KiB)

wlan0 Link encap:Ethernet HWaddr 00:13:02:9e:cc:1b
inet addr:192.168.1.21 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::213:2ff:fe9e:cc1b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7486622 errors:0 dropped:0 overruns:0 frame:0
TX packets:4833561 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2650697959 (2.4 GiB) TX bytes:608573891 (580.3 MiB)

To have the same IP address, say 192.168.1.78, every time the computer is booted

1) Add the following lines to /etc/dhcp/dhclient.conf

alias {
interface "wlan0";
fixed-address 192.168.1.78;
option subnet-mask 255.255.255.255;
}

2) restart the network

sudo /etc/init.d/networking restart

Now you should see

$ifconfig
eth0 Link encap:Ethernet HWaddr 00:15:c5:19:9c:1a
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:17

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:6790 errors:0 dropped:0 overruns:0 frame:0
TX packets:6790 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:773105 (754.9 KiB) TX bytes:773105 (754.9 KiB)

wlan0 Link encap:Ethernet HWaddr 00:13:02:9e:cc:1b
inet addr:192.168.1.21 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::213:2ff:fe9e:cc1b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7486678 errors:0 dropped:0 overruns:0 frame:0
TX packets:4833604 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2650705479 (2.4 GiB) TX bytes:608589238 (580.3 MiB)

wlan0:0 Link encap:Ethernet HWaddr 00:13:02:9e:cc:1b
inet addr:192.168.1.78 Bcast:0.0.0.0 Mask:255.255.255.255
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Note the new wlan:0 interface which is always assigned to 192.168.1.78.

Saturday, March 22, 2008

accessing wpa wireless networks

This article explains accessing a wireless connection with WPA TKIP encryption using a Dell Inspiron E1505 laptop running Debian Etch. The final network connection is going to look like

ISP <---> wrt54g router <---> Dell Inspiron E1505 laptop

where ISP is the Internet Service Provider such as roadrunner, comcast etc., (and in my case "clarity connect").

The main steps involved are
  1. configure the router
  2. Install the necessary software packages on the Debian machine
  3. encrypt the password (if necessary)
  4. add a network stanza in /etc/network/interfaces
  5. restart the network

The information about the wireless card can be found by using
sudo lspci --vv
In this case, we have
0b:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG Network Connection (rev 02)
The router is configured as shown below.





The SSID stands for "Service Set Identifier". It is basically the name of the wireless network. In this example, it is set to "Raju_and_Satish". Change the SSID according to your network.

A list of available networks and their SSIDs can be obtained by using
iwlist scan

As can be seen from snapshot 2, the router is configured to use TKIP as its WPA encryption algorithm.

The "WPA Shared Key" (snapshot 2) is the place holder for setting a password to the network. Since the password is usually a bunch of ASCII characters, it is also referred as a "passphrase". In this example, the password for the network is "strongpassword". Change it according to your network.


Install the necessary software by using the apt-get command. I have installed
  • firmware-ipw3945
  • ipw3945-modules-2.6-686
  • ipw3945-modules-2.6.18-6-686
  • ipw3945d
  • wpasupplicant
I am not sure if all the above packages are needed for the network configuration, but I know that they are sufficient. If anyone knows a leaner version of the necessary packages, please let me know and I will update this list.


The next step is to generate an encrypted string known as the pre-shared key (PSK) from the ASCII password and the SSID. This can be achieved using the wpa_passphrase command.
$wpa_passphrase Raju_and_Satish strongpassword
network={
ssid="Raju_and_Satish"
#psk="strongpassword"
psk=604d8887badd597a8647f65b98c3c504ad29ba352211033adfed01cd8c3034a0
}

After this, add the following stanza to the /etc/network/interfaces.

# wireless setup
auto eth2
iface eth2 inet dhcp
wpa-conf managed
wpa-ssid Raju_and_Satish
wpa-key-mgmt WPA-PSK
wpa-psk 604d8887badd597a8647f65b98c3c504ad29ba352211033adfed01cd8c3034a0

Replace the wpa-ssid, wpa-psk with the values corresponding to your network configuration.

Then restart the network connections by doing
$sudo /etc/init.d/networking restart

Now the network should be up and running. Its status can be tested by using host, ping commands.

$host www.google.com
www.google.com CNAME www.l.google.com
www.l.google.com A 216.239.51.104
www.l.google.com A 216.239.51.99

$ping -c3 www.google.com
PING www.l.google.com (216.239.51.99) 56(84) bytes of data.
64 bytes from 216.239.51.99: icmp_seq=1 ttl=242 time=40.7 ms
64 bytes from 216.239.51.99: icmp_seq=2 ttl=242 time=40.9 ms
64 bytes from 216.239.51.99: icmp_seq=3 ttl=242 time=39.6 ms

--- www.l.google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 10124ms
rtt min/avg/max/mdev = 39.616/40.437/40.985/0.635 ms

Followers