14
11
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?
UPDATE
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 ?
Have you tried with "Dummy net driver support" (Kernel driver) as module. I can not help you more than that because I do not know openSUSE. But I can see that there are errors reported from version 11 and higher when it is built with Yast. So be careful. – Diblo Dk – 2013-07-05T14:46:34.197
I can of course help you, if it can be done in the same ways (Kernel config, network setup) as in Gentoo, Debian or Ubuntu. – Diblo Dk – 2013-07-05T14:52:32.047
Any help will be appreciated. I am not using the Yast tools as such. The configurations were from a tutorial on Ubuntu. The file system and the configurations are almost the same. – adityap174 – 2013-07-05T15:42:54.553
What is your kernel version? – Diblo Dk – 2013-07-05T18:21:07.783
Kernel: x86_64 Linux 3.7.10-1.16-desktop – adityap174 – 2013-07-05T20:55:39.563
You must remember to tell what problems you have solved self so the answer may be updated. :) – Diblo Dk – 2013-07-06T14:34:46.367
Same question again: http://superuser.com/questions/639479/linux-share-wireless-connection-through-the-same-wireless-interface/639496#639496 And again: http://superuser.com/questions/649220/a-wifi-ap-with-a-single-nic/656574#656574
– imz -- Ivan Zakharyaschev – 2013-12-15T21:02:53.557