Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I recenty read about the Windows option for creating an access point, that will run on the same physical device, as the machine. So that I can connect my other devices to that network, and have access to internet as well.

I know that I can use 2 wifi cards to do the trick, by configuring dhcp and creating a bridge, but how can I accomplish this with one card?

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

This creates a wlan1 virtual interface using the same physical device as an existing wlan0 interface :

iw dev wlan0 interface add wlan1 type station

Alternatively, you can specify the physical device (linux tends to call them "wiphy") by hand:

iw phy phy0 interface add wlan1 type station

Then run hostapd as usual on wlan1. hostapd will handle changing the type of wlan1 to AP mode, and may add another virtual interface in monitor mode if your kernel or driver does not support some features.

Be sure to disable DFS or anything that might change the frequency: Linux does not support channel hoping on two different channels if your hardware cannot support it. Running an AP station and a non-AP station at the same time is not supported by all card/drivers. You can use iw phy0 info and see the requirement on interface configurations for your card. Running a recent enough kernel and/or hostapd is also advisable.

Then, use your internet sharing method of choice. NAT is evil but works everywhere, bridging as is will not work because the original AP will filter on incoming MAC, even if there is no security enabled. Some clever tricks with ARP proxying can also be used.

share|improve this answer
    
This does solve the problem, but how can i assign the ip for the connected machines? I have tried dhcp-server3 along with editing of ip-tables, but that just messed up the whole linux, so i had to reinstall. –  Bartlomiej Lewandowski Jan 20 '13 at 20:20
add comment

Current versions of Fedora (and I suspect by now most distributions) use NetworkManager, the command nm-online should put you online if possible. Check there are no other problems (too feeble signal, access point has filtered your MAC, bad setup of the AP, the selected channel is crowded, ...).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.