Как создать wifi точку доступа
Posted: 04 Nov 2020, 12:54
Есть нетбук с ethernet портом wi fi картой нужно сделать так чтобы с нетбука раздавался wi fi сигнал
Code: Select all
# iw list | grep "Supported interface modes" -A 8
Supported interface modes:
* IBSS
* managed
* AP
* monitor
* P2P-client
* P2P-GO
Code: Select all
su
toor
cd /tmp
# https://slackbuilds.org/repository/14.2/network/hostapd/
# https://w1.fi/releases/
wget -P /tmp -q --show-progress https://slackbuilds.org/slackbuilds/14.2/network/hostapd.tar.gz
tar -xf hostapd.tar.gz && rm -f hostapd.tar.gz
wget -P /tmp/hostapd -q --show-progress https://w1.fi/releases/hostapd-2.9.tar.gz
cd /tmp/hostapd
./hostapd.SlackBuild
cd ..
txz2xzm hostapd-2.9-x86_64-1_SBo.tgz hostapd-2.9-x86_64-1_SBo.xzm
rm hostapd-2.9-x86_64-1_SBo.tgz && rm -rf /tmp/hostapd
cp hostapd-2.9-x86_64-1_SBo.xzm $MODDIR
activate $MODDIR/hostapd-2.9-x86_64-1_SBo.xzm
Code: Select all
#!/bin/bash
# https://github.com/lwfinger/rtl8188eu
cd /tmp
git clone https://github.com/aircrack-ng/rtl8188eus.git
cd /tmp/rtl8188eus/
make && make install
VER=`lynx --source https://github.com/aircrack-ng/rtl8188eus | egrep 'href="#rtl8188eus' | cut -d "#" -f2 | cut -d '"' -f1`
mkdir -p /tmp/$VER/lib/modules/`uname -r`/kernel/drivers/net/wireless /tmp/$VER/etc/modprobe.d
install -p -m 644 8188eu.ko /tmp/$VER/lib/modules/`uname -r`/kernel/drivers/net/wireless
echo 'blacklist r8188eu' > "/tmp/$VER/etc/modprobe.d/realtek_blacklist.conf"
cd ..
dir2xzm /tmp/$VER /tmp/$VER.xzm
rm -rf /tmp/rtl8188eus /tmp/$VER
mv /tmp/$VER.xzm $MODDIR/rtl8188eus-v539-k`uname -r`-$(arch).xzm
activate $MODDIR/$VER.xzm
Code: Select all
chmod +x /etc/rc.d/rc.ip_forward && /etc/rc.d/rc.ip_forward start
Code: Select all
if [ -d /sys/class/net/wlan0 ]; then
iptables -A FORWARD -i eth0 -o wlan0 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sleep 5 && ifconfig wlan0 10.0.0.1 netmask 255.255.255.0 up
[ -x /etc/rc.d/rc.hostapd ] && sh /etc/rc.d/rc.hostapd start &
fi
Code: Select all
# https://wiki.gentoo.org/wiki/Hostapd
# Driver (others options: hostap or madwifi)
driver=nl80211
# the interface used by the AP
interface=wlan0
# "g" simply means 2.4GHz band
hw_mode=g
# the channel to use
channel=1
# limit the frequencies used to those allowed in the country
ieee80211d=1
# the country code
country_code=RU
# 802.11n support
ieee80211n=1
# QoS support, also required for full speed on 802.11n/ac/ax
wmm_enabled=1
# the name of the AP
ssid=WiFi on Linux
# 1=wpa, 2=wep, 3=both
auth_algs=1
# WPA2 only
wpa=2
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
wpa_passphrase=12345678
Code: Select all
interface=wlan0
bind-interfaces
dhcp-option=2,255.255.255.0
dhcp-option=3,10.0.0.1
dhcp-option=6,10.0.0.1,8.8.8.8
dhcp-range=10.0.0.2,10.0.0.254,12h
server=8.8.8.8
server=1.1.1.1
no-hosts
no-resolv
log-queries
log-facility=/var/log/dnsmasq.log
Code: Select all
chmod +x /etc/rc.d/rc.dnsmasq && /etc/rc.d/rc.dnsmasq start
Code: Select all
[device]
wifi.scan-rand-mac-address=no
[ifupdown]
managed=false
[connection]
wifi.powersave=0
[main]
plugins=keyfile
[keyfile]
unmanaged-devices=mac:d0:37:45:43:bf:33;mac:xx:xx:xx:xx:xx:xx
Code: Select all
/etc/NetworkManager/NetworkManager.conf
#
# See NetworkManager.conf(5) for more information on this file
[main]
plugins=keyfile
dhcp=dhclient
#dhcp=dhclient
[keyfile]
#hostname is deprecated. It now lives in /etc/hostname.
#hostname=porteus
[device]
wifi.scan-rand-mac-address=no
[ifupdown]
managed=false
[connection]
wifi.powersave=0
[main]
plugins=keyfile
[keyfile]
unmanaged-devices=mac:d0:37:45:43:bf:33