This is what I did:
I installed the hostapd and dnsmasq packages and then stopped the services and prevented them from starting on system start-up.
Then I added the following code and saved it as /etc/hostapd.conf
Now I added these lines to the file /etc/dnsmasq.conf
# Define interface
# Select driver
# Set access point name
# Set access point harware mode to 802.11g
# Set WIFI channel (can be easily changed)
# Enable WPA2 only (1 for WPA, 2 for WPA2, 3 for WPA + WPA2)
Now I created a file start.sh and saved the following code into it
# Bind to only one interface
# Choose interface for binding
# Specify range of IP addresses for DHCP leasses
I replaced all the ppp0 in the above file with eth0 which is my NIC card name.
# Configure IP address for WLAN
sudo ifconfig wlan0 192.168.150.1
# Start DHCP/DNS server
sudo service dnsmasq restart
# Enable routing
sudo sysctl net.ipv4.ip_forward=1
# Enable NAT
sudo iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
# Run access point daemon
sudo hostapd /etc/hostapd.conf
# Disable NAT
sudo iptables -D POSTROUTING -t nat -o ppp0 -j MASQUERADE
# Disable routing
sudo sysctl net.ipv4.ip_forward=0
# Disable DHCP/DNS server
sudo service dnsmasq stop
sudo service hostapd stop
To start the hotspot I run the script start.sh upon which I get the following message :
I am not able to create a hotspot like I previously did in Ubuntu 12.10 in the same system.
* Restarting DNS forwarder and DHCP server dnsmasq
dnsmasq: failed to create listening socket for 127.0.0.1: Address already in use
net.ipv4.ip_forward = 1
Configuration file: /etc/hostapd.conf
As I tried to rectify errors I found out the names of the NIC in my computer and found that while the above script was running there was a new NIC addition to my list of NIC names which was named "mon.wlan0" which disappeared the moment I killed the script by closing the terminal.
Please reply with a solution.