Upload
fanof-ecd
View
2
Download
0
Embed Size (px)
DESCRIPTION
Software access point
Citation preview
7/24/2015 Software access point - ArchWiki
https://wiki.archlinux.org/index.php/Software_access_point 1/5
Relatedarticles
Networkconfiguration
Wirelessnetworkconfiguration
Adhocnetworking
Internetsharing
SoftwareaccesspointFromArchWiki
AsoftwareaccesspointisusedwhenyouwantyourcomputertoactasaWiFiaccesspointforthelocalnetwork.Itsavesyouthetroubleofgettingaseparatewirelessrouter.
Contents
1Requirements1.1WiFidevicemustsupportAPmode1.2WirelessclientandsoftwareAPwithasingleWiFidevice
2Overview3WiFiLinkLayer4Networkconfiguration
4.1BridgeSetup4.2NATSetup
5Tools5.1create_ap5.2RADIUS
6Troubleshooting6.1WLANisveryslow6.2NetworkManagerisinterfering
7Seealso
Requirements
WiFidevicemustsupportAPmode
Youneedanl80211(http://wireless.kernel.org/en/developers/Documentation/nl80211)compatiblewirelessdevice,whichsupportstheAPoperatingmode(http://wireless.kernel.org/en/users/Documentation/modes).Thiscanbeverifiedbyrunningiw listcommand,undertheSupported interface modesblockthereshouldbeAPlisted:
$ iw list
Wiphy phy1... Supported interface modes: * IBSS * managed * AP * AP/VLAN * WDS * monitor
7/24/2015 Software access point - ArchWiki
https://wiki.archlinux.org/index.php/Software_access_point 2/5
* mesh point...
WirelessclientandsoftwareAPwithasingleWiFidevice
CreatingasoftwareAPisindependentfromyourownnetworkconnection(Ethernet,wireless,...).ManywirelessdevicesevensupportsimultaneousoperationbothasAPandaswireless"client"atthesametime.UsingthatcapabilityyoucancreateasoftwareAPactingasa"wirelessrepeater"foranexistingnetwork,usingasinglewirelessdevice.Thecapabilityislistedinthefollowingsectionintheoutputofiw list:
$ iw list
Wiphy phy1... valid interface combinations: * #{ managed }
7/24/2015 Software access point - ArchWiki
https://wiki.archlinux.org/index.php/Software_access_point 3/5
TheactualWiFilinkisestablishedviathehostapd (https://www.archlinux.org/packages/?name=hostapd)package(availableintheofficialrepositories).ThepackagehasWPA2support.
Adjusttheoptionsinhostapdconfigurationfileifnecessary.Especially,changethessidandthewpa_passphrase.SeehostapdLinuxdocumentationpage(http://wireless.kernel.org/en/users/Documentation/hostapd)formoreinformation.
/etc/hostapd/hostapd.conf
ssid=YourWiFiNamewpa_passphrase=Somepassphraseinterface=wlan0_apbridge=br0auth_algs=3channel=7driver=nl80211hw_mode=glogger_stdout=-1logger_stdout_level=2max_num_sta=5rsn_pairwise=CCMPwpa=2wpa_key_mgmt=WPA-PSKwpa_pairwise=TKIP CCMP
Forautomaticallystartinghostapd,enablethehostapd.service.
Warning:Thewirelesschannelsallowedforaccesspointoperationdifferaccordingtogeography.Dependingonthewirelessfirmware,youmayhavetosettheregioncorrectlytouselegalchannels.Donotchooseanotherregion,asyoumaybeillegallydisturbingnetworktraffic,affectingwirelessfunctionalityofyourowndeviceandotherswithinitsreach!TosettheregionseeWirelessnetworkconfiguration#Respectingtheregulatorydomain.
Note:IfyouhaveacardbasedonRTL8192CUchipset,installhostapd-8192cu(https://aur.archlinux.org/packages/hostapd-8192cu/)AURintheAURandreplacedriver=nl80211withdriver=rtl871xdrvinthehostapd.conffile.
Networkconfiguration
Therearetwobasicwaysforimplementingthis:
1. bridge:createanetworkbridgeonyourcomputer(wirelessclientswillappeartoaccessthesamenetworkinterfaceandthesamesubnetthat'susedbyyourcomputer)
2. NAT:withIPforwarding/masqueradingandDHCPservice(wirelessclientswilluseadedicatedsubnet,datafrom/tothatsubnetisNATtedsimilartoanormalWiFirouterthat'sconnectedtoyourDSLorcablemodem)
Thebridgeapproachissimpler,butitrequiresthatanyservicethat'sneededbyyourwirelessclients(like,DHCP)isavailableonyourcomputersexternalinterface.Thatmeansitwillnotworkifyouhaveadialupconnection(e.g.,viaPPPoEora3Gmodem)orifyou'reusingacablemodemthatwillsupplyexactlyoneIPaddresstoyouviaDHCP.
7/24/2015 Software access point - ArchWiki
https://wiki.archlinux.org/index.php/Software_access_point 4/5
TheNATapproachismoreversatile,asitclearlyseparatesWiFiclientsfromyourcomputerandit'scompletelytransparenttotheoutsideworld.Itwillworkwithanykindofnetworkconnection,and(ifneeded)youcanintroducetrafficpoliciesusingtheusualiptablesapproach.
Ofcourse,itispossibletocombineboththings.Forthat,studyingbotharticleswouldbenecessary.Example:Likehavingabridgethatcontainsbothanethernetdeviceandthewirelessdevicewithanstaticip,offeringDHCPandsettingNATconfiguredtorelaythetraffictoanadditionalnetworkdevicethatcanbeppporeth.
BridgeSetup
Youneedtocreateanetworkbridgeandaddyournetworkinterface(e.g.eth0)toit.Youshouldnotaddthewirelessdevice(e.g.wlan0)tothebridgehostapdwilladditonitsown.
SeeNetworkbridge.
Tip:Youmaywishtoreuseanexistingbridge,ifyouhaveone(e.g.usedbyavirtualmachine).
NATSetup
SeeInternetsharingfordetails.
Onthatarticle,thedeviceconnectedtotheLANisnet0.Thatdevicewouldbeinthiscaseyourwirelessdevice(e.g.wlan0).
Tools
create_ap
Thecreate_ap(https://bbs.archlinux.org/viewtopic.php?pid=1269258)scriptcombineshostapd(https://www.archlinux.org/packages/?name=hostapd),dnsmasqandiptablestocreateaBridged/NATedAccessPoint(availableintheAURcreate_ap(https://aur.archlinux.org/packages/create_ap/)AUR).
RADIUS
See[1](https://me.m01.eu/blog/2012/05/wpa2enterprisefromscratchonaraspberrypi/)forinstructionstorunaFreeRADIUS(http://freeradius.org/)serverforWPA2Enterprise.
Troubleshooting
WLANisveryslow
Thiscouldbecausedbylowentropy.Considerinstallinghaveged.
7/24/2015 Software access point - ArchWiki
https://wiki.archlinux.org/index.php/Software_access_point 5/5
NetworkManagerisinterfering
hostapdmaynotwork,ifthedeviceismanagedbyNetworkManager.Youcanmaskthedevice:
/etc/NetworkManager/NetworkManager.conf
[keyfile]unmanaged-devices=mac:
Seealso
RouterHostapd:TheLinuxWaytocreateVirtualWiFiAccessPoint(http://nims11.wordpress.com/2012/04/27/hostapdthelinuxwaytocreatevirtualwifiaccesspoint/)tutorialandscriptforconfiguringasubnetwithDHCPandDNS(http://xyne.archlinux.ca/notes/network/dhcp_with_dns.html)
Retrievedfrom"https://wiki.archlinux.org/index.php?title=Software_access_point&oldid=382821"
Category: WirelessNetworking
Thispagewaslastmodifiedon18July2015,at18:14.ContentisavailableunderGNUFreeDocumentationLicense1.3orlaterunlessotherwisenoted.