我认为可以使用 pound 和 dnsmasq 重定向无线接入点的所有请求,但我肯定犯了一个错误。这里是 /etc/dhcpcd.conf
interface wlan0
static ip_address=192.168.42.1/24
static domain_name_servers=191.168.42.1
nohook wpa_supplicant
这里 /etc/dnsmasq.conf
interface=wlan0 # Use the require wireless interface - usually wlan0
dhcp-range=192.168.42.2,192.168.42.20,255.255.255.0,24h
address=/#/192.168.42.1
这是 /etc/pound/pound.cfg
User "www-data"
Group "www-data"
#RootJail "/chroot/pound"
## Logging: (goes to syslog by default)
## 0 no logging
## 1 normal
## 2 extended
## 3 Apache-style (common log format)
LogLevel 1
## check backend every X secs:
Alive 30
## use hardware-accelleration card supported by openssl(1):
#SSLEngine "<hw>"
# poundctl control socket
Control "/var/run/pound/poundctl.socket"
######################################################################
## listen, redirect and ... to:
## redirect all requests on port 8080 ("ListenHTTP") to the local webserver (see "Service" below):
ListenHTTP
Address 192.168.42.1
Port 80
Service
Redirect "http://192.168.42.1:8080/roomtemp.htm"
End
End
在我的浏览器中我确实可以访问http://192.168.42.1:8080/roomtemp.htm但如果我写其他内容,则不会显示任何内容。我的客户端将 192.168.42.1 作为 DNS 服务器,这是理所当然的。我做错了什么?
答案1
我忘记启用 pound 了,这是在 /etc/default/pound 中完成的