12.10 Wireless hotspot configuration and internet browsing - question

Posted by Indian on Ask Ubuntu See other posts from Ask Ubuntu or by Indian
Published on 2012-11-04T11:53:04Z Indexed on 2012/11/05 5:14 UTC
Read the original article Hit count: 275

Filed under:
|
|
|

In our campus we have a leased line connection from a service provider, which has an external IP W.X.Y.Z. This connection is distributed from the server several sub-networks / subnets as follows:

  1. Faculty: 172.33....../ 255.255.0.0
  2. Administration: 172.34......./255.255.255.0
  3. Students: 172.35...../255.255.216.0

A student has a laptop with a fixed IP address 172.35.23.123 / 255.255.216.0 where the IP address is on the ethernet port. The gateways for internet access are 172.31.1.1 and 172.31.1.2. Further the student has a wireless port which is inaccessible in the hostel area. The OS of the student is Ubuntu 12.10.

The student in the possession of an android phone on which he wishes to install specific software and therefore wishes to activate the internet therein. The student has already attempted the Wireless hotspot solution which works for 12.04 but has not been successful.

Various instructions on the internet have helped the student to do the following

Installation of dhcp server and hostapd:

sudo apt-get install isc-dhcp-server
sudo apt-get install hostapd

File: /etc/network/interfaces

auto lo
iface lo inet loopback
auto wlan0
iface wlan0 inet static
address 10.10.0.1
netmask 255.255.255.0
dns-nameservers 172.31.1.1 172.31.1.2 

File: /etc/dhcp/dhcpd.conf

subnet 10.10.0.0 netmask 255.255.255.0 { 
range 10.10.0.2 10.10.0.4;
option routers 10.10.0.1; 
option domain-name-servers 172.31.1.1 172.31.1.2; 
default-lease-time 6000; 
max-lease-time 72000; 
} 

File: /etc/hostapd/hostapd.conf

interface=wlan0
driver=nl80211
ssid=my_hotspot
channel=1
hw_mode=g
auth_algs=1
wpa=3
wpa_passphrase=1234567890
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
rsn_pairwise=CCMP

File: /etc/default/hostapd

RUN_DAEMON=”yes”
DAEMON_CONF=”/etc/hostapd/hostapd.conf”
DAEMON_OPTS=”-dd”

File: /etc/default/isc-dhcp-server

INTERFACES=”wlan0”

File: /etc/rc.local

iptables -t nat -A POSTROUTING -s 10.10.0.0/16 -o eth0 -j MASQUERADE
exit 0

After all the configuration, the computer is restarted. The student can see that the hotspot named “my_hotspot” is available. The hotspot also awards an address to the android phone. The student will now be able to browse the internet.

© Ask Ubuntu or respective owner

Related posts about wireless

Related posts about 12.10