I am trying to create a WiFi hotspot or an access point on my Linux laptop. I am using Opensuse Kde 12.3.
I found out a software called
hostapd which lets you create hotspot but it requires two interfaces. One connected to the internet and the other on which you want to create the access point (tutorial here) . The problem I have is that I don't have Ethernet connection. The
wlan interface is being used to connect to the internet.
Is there any way to create the hotspot on the same interface that is connected to the Internet (like the software connectify does on Windows)? I was thinking of creating a virtual interface (like the one
airmon-ng creates to monitor wifi) and use it as the second interface. Is this possible?
Here's what i have been able to do up till now :
1) Create 2 interfaces ( one as station and the other as an access point )
iw phy phy0 interface add mySta type station iw phy phy0 interface add myAcc type __ap
2) Give them seperate Mac ID
ifconfig myAcc hw ether A4:17:FE:6E:00:53 ifconfig myAcc 192.168.27.1 up
3) start hostapd on the myAcc interface
4) start dnsmasq to provide ip address to the connecting devices
All of this works. Devices are able to connect to this network and obtain Ip Address. The next step is to provide ip masquerading
iptables --table nat --append POSTROUTING --out-interface mySta -j MASQUERADE iptables --append FORWARD --in-interface myAcc -j ACCEPT
But the mySta interface now fails to connect to the internet. It is able to obtain the Essid but it cannot obtain the ip address.
The command dhclient mySta doesn't show any message and after some time gives the error :
ls: cannot access /var/run/netconfig//mySta/: No such file or directory
Can someone figure out how to obtain the ip address ?