Answer the question
In order to leave comments, you need to log in
How to set up Hostapd + Dhcpd for a couple of clients?
I configured this subject with configs:
hostapd.conf
interface=wlan0
driver=nl80211
ssid=KPEBETKA
channel=6
hw_mode=g
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=vi776bnh
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
ctrl_interface_group=0
macaddr_acl=0
preamble=1
wmm_enabled=1
ieee80211n=1
ht_capab=[HT40-][HT40+][SHORT-GI-20][SHORT-GI-40][TX-STBC][RX-STBC1][DSSS_CCK-40][LDPC]
ddns-update-style none;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.2 192.168.1.254;
option routers 192.168.1.1;
option domain-name-servers 192.168.0.1;}
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
iface wlan0 inet static
address 192.168.1.1
netmask 255.255.255.0
auto wlan0
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i wlan0 -j ACCEPT
Answer the question
In order to leave comments, you need to log in
The problem, as it turned out, is in the kernel. Rolling back to an earlier version helped.
And if so:
#!/bin/sh
# Включаем форвардинг пакетов
echo 1 > /proc/sys/net/ipv4/ip_forward
# Разрешаем трафик на loopback-интерфейсе
iptables -A INPUT -i lo -j ACCEPT
# Разрешаем доступ из внутренней сети наружу
iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
# Включаем NAT, 10.0.0.0 это внутренняя сеть.
iptables -t nat -A POSTROUTING -o eth0 -s 10.0.0.0/24 -j MASQUERADE
# Разрешаем ответы из внешней сети
iptables -A FORWARD -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
# Запрещаем доступ снаружи во внутреннюю сеть
iptables -A FORWARD -i eth0 -o eth1 -j REJECT
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question