【发布时间】:2021-03-01 10:25:19
【问题描述】:
我有一个带有 Raspberry Pi OS lite 的 Raspberry Pi 3B,我想将 Pi 用作 WLAN 热点和服务器,并在 eth0 上使用静态 IP (169.254.1.100)。
因此,我安装了 dnsmasq 和 hostapd 并编辑了以下文件:
我编辑了 /etc/dnsmasq.conf:
# DHCP-Server aktiv für WLAN-Interface
interface=wlan0
# DHCP-Server nicht aktiv für bestehendes Netzwerk
no-dhcp-interface=eth0
# IPv4-Adressbereich und Lease-Time
dhcp-range=192.168.1.100,192.168.1.200,255.255.255.0,24h
# DNS
dhcp-option=option:dns-server,192.168.1.1
我添加到/etc/dhcpcd.conf
interface wlan0
static ip_address=192.168.1.1/24
我编辑了 /etc/hostapd/hostapd.conf:
interface=wlan0
ssid=PI_WLAN
channel=1
hw_mode=g
ieee80211n=1
ieee80211d=1
country_code=AT
wmm_enabled=1
auth_algs=1
wpa=2
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
wpa_passphrase=somePassword
我正在启动 WLAN
> sudo hostapd -dd /etc/hostapd/hostapd.conf
WLAN 仅在 eth0 不是静态的情况下创建,但当 IP 为静态时 DHCP 无法启动且 WLAN 不工作。
即使为 eth0 禁用了 DHCP,我如何才能为 WLAN0 启用 DHCP?
亲切的问候, 沃尔夫冈
【问题讨论】:
标签: raspberry-pi wifi static-ip-address