apt-get install hostapd
hostapd -v >hostapd v1.0
DAEMON_CONF="/etc/hostapd/hostapd.conf"
This is the path to the hostapd daemon configuration file. interface=wlan0
Wireless card network interface driver=nl80211
The network card driver - nl80211 works fine for hostapd, I see no reason to change, and they say that it works in most cases. ssid=CRWiFi
The name of the access point, so-called. SSID hw_mode=g
The mode of operation of the network card is 801.11b / g / n. In fact - there should always be g there, even if the card is capable of n, to adjust the mode n you have to change something, look further: #ieee80211n=1 # n #ht_capab=[HT40-][SHORT-GI-40] # n
channel=6
Wireless channel - from 1 to 13. For best performance, 1, 6 or 11 channels are recommended. wpa=2
WPA version wpa_passphrase=11111111
Wireless point password wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP auth_algs=1
The following option sets MAC address blocking. I don’t know how to set it up yet, and the thing is pretty useless, but everyone says that without blocking this option should be set to zero - which I did: macaddr_acl=0
interface=wlan0 driver=nl80211 ssid=CRWiFi hw_mode=g #ieee80211n=1 # n #ht_capab=[HT40-][SHORT-GI-40] # n channel=6 wpa=2 wpa_passphrase=11111111 wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP auth_algs=1 macaddr_acl=0
# /etc/init.d/hostapd start # /etc/init.d/hostapd stop # /etc/init.d/hostapd restart
Let me remind you - also in Debian, you can use commands like service hostapd start, which is easier to write. auto _ iface _ inet static address 192.168..1 netmask 255.255.255.0 gateway 192.168..1
We save and restart our network interface, on which DHCP is configured: ifdown ifup
We check the status, check the settings with those that should be: ifconfig
nano /etc/resolv.conf
nameserver 127.0.0.1 nameserver 8.8.8.8 nameserver 8.8.8.4
chattr +i /etc/resolv.conf
nameserver 127.0.0.1 nameserver 8.8.8.8 nameserver 8.8.4.4
groupadd -r dnsmasq useradd -r -g dnsmasq dnsmasq
apt-get install dnsmasq service dnsmasq stop
echo "">/etc/dnsmasq.conf
# dnsmasq dnsmasq user=dnsmasq group=dnsmasq ## # DNS. - . ## # DNS - DNS, 0. # DNS - , . port=53 # . . cache-size=1000 # DNS homeserver, user-pc - # , , ... domain-needed # - , DNS- bogus-priv # DHCP DNS . interface=wlan0 # , : except-interface=ppp0 # , ppp0, dhcp-authoritative. ## # DHCP. - . ## # : # DHCP-, # # 12h , - 12 . # , 12m - 12 , . dhcp-range=192.168.51.50,192.168.51.150,12h # . MAC IP: dhcp-host=11:22:33:44:55:66,192.168.51.60 # . MAC, hostname, IP . # -, =) : dhcp-host=11:22:33:44:55:66,fred,192.168.51.60,45m # IP- MAC-: dhcp-host=11:22:33:44:55:66,ignore # - , ! # , - . # , - # , IP- # , IP . dhcp-authoritative
# , DNS. # IPv4-only. # 1.2.3.4 5.6.7.8! alias=1.2.3.4,5.6.7.8 # 1.2.3.x 5.6.7.x? ! alias=1.2.3.0,5.6.7.0,255.255.255.0 # 192.168.0.10->192.168.0.40 10.0.0.10->10.0.0.40? alias=192.168.0.10-192.168.0.40,10.0.0.0,255.255.255.0 # , Spamhaus , - . # . Dnsmasq - # . . # , , . - , # . # dnsmasq , # . bind-interfaces # ! DNS, - # , , . # , ? address=/vk.com/127.0.0.1 # ! "It works!" # , . # , ? =D # , , DNS, # , . # , ? # dnsmasq DNS-: # /etc/hosts DNS-. # KMS Microsoft Office # -, # , . # hosts? ! ! addn-hosts=/etc/banner_add_hosts # , hosts. # c hosts, , , ? # . no-hosts # , - . # , MAC- IP-. # , , - # , MAC . # - MA:CA:DD:RE:SS:00,MA:CA:DD:RE:SS:01,12.34.56.78 dhcp-host=11:22:33:44:55:66,12:34:56:78:90:12,192.168.0.60 # lease c hostname bert. dhcp-host=bert,192.168.0.70,infinite # - " ". # - , . # DHCPDISCOVER . dhcp-ignore=tag:!known # DHCP-. , address range. dhcp-lease-max=640 #640 # - 100, . # . DHCP # : script add MA:CA:DD:RE:SS:00 12.34.56.78 hostname( ) ( ) # script del MA:CA:DD:RE:SS:00 12.34.56.78 hostname( ) ( ) dhcp-script=/bin/echo # - . =D # NTP- . - , -. dhcp-option=42,192.168.51.1
service dnsmasq start
Source: https://habr.com/ru/post/188274/
All Articles