%EC%97%90%EC%84%9C%20%EB%84%A4%ED%8A%B8%EC%9B%8C%ED%82%B9%20%EC%8B%9C%EC%8A%A4%ED%85%9C%EC%9D%84%20%EB%8B%A4%EC%8B%9C%20%EC%8B%9C%EC%9E%91%ED%95%B4%EC%95%BC%20%ED%95%A9%EB%8B%88%EB%8B%A4..png)
현재 Debian 8.5를 실행하는 BeagleBone Black을 WiFi 액세스 포인트로 구성하려고 합니다. 사용된 프로그램은 hostapd
과 입니다 dnsmasq
. 저는 큰 진전을 이루었습니다. 원칙적으로 액세스 포인트는 의도한 대로 작동하지만(액세스 포인트에 연결하여 Lighty가 호스팅하는 웹사이트에 액세스할 수 있습니다) 약간의 문제가 있습니다. 재부팅 후 dnsmasq
wlan0에 주소가 없다고 불평하므로 연결할 수 없습니다.
발췌 /var/log/syslog
:
Jun 24 12:01:03 arm dnsmasq[487]: warning: interface wlan0 does not currently exist
Jun 24 12:01:03 arm dnsmasq-dhcp[487]: DHCP, IP range 192.168.3.20 -- 192.168.3.200, lease time infinite
Jun 24 12:01:53 arm dnsmasq-dhcp[487]: DHCP packet received on wlan0 which has no address
위에서 설명한 대로 네트워킹 시스템을 다시 시작하면 /etc/init.d/networking restart
모든 것이 제대로 작동합니다. 다시 시작 dnsmasq
하거나 전화해도 ifup wlan0
문제가 해결되지 않습니다. 로그에 따르면 일종의 타이밍 문제(예: dnsmasq가 시작된 후 USB WiFi 스틱이 인식되는 등)가 있는 것으로 추측되지만 실제로 극복하는 방법을 모르겠습니다. allow-hotplug wlan0
추가 했지만 /etc/network/interfaces
아무것도 변경되지 않았습니다.
/etc/network/interfaces를 제외하고:
auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.3.1
내 /etc/dnsmasq.conf
것은 매우 기본적입니다.
# Disable DNS
port=0
interface=wlan0
no-dhcp-interface=eth0
dhcp-range=interface:wlan0,192.168.3.20,192.168.3.200,infinite
편집하다:
달리기 ifconfig wlan0 192.168.3.1
도 효과가 있습니다.
답변1
dnsmasq가 다시 시작되어야 하는지 확인하는 if-up 스크립트를 생성할 수 있습니다.
/etc/network/if-up.d/dnsmasq:
#!/bin/sh
[ "$IFACE" != "lo" ] || exit 0
restartDnsMasq() {
if [ -d /run/systemd/system ]; then
systemctl reload --no-block dnsmasq >/dev/null 2>&1 || true
else
invoke-rc.d dnsmasq restart >/dev/null 2>&1 || true
fi
}
# Find out if dnsmasq is configured to run on a single interface
interface=$(cat /etc/dnsmasq.conf | grep interface | awk -F '=' '{print $2}')
if [ "x${interface}" = "x" ]; then
# all interfaces
logger DnsMasq not configured for any particular interface, restarting because $IFACE came up.
restartDnsMasq
else
if [ "${interface}" = "$IFACE" ]; then
# The interface that dnsmasq is running on is being brought up
logger DnsMasq configured for interface ${interface}, restarting because $IFACE came up.
restartDnsMasq
else
logger DnsMasq configured for interface ${interface}, not restarting because $IFACE came up.
fi
fi