我张贴的问题以前就如何设置静态IP地址的RPI和最终想通了,与一些其他国家一道,认为答案是改变wpa-roam
以wpa-conf
指向时/etc/wpa_supplicant/wpa_supplicant.conf
,但为什么这会起作用?
即当我在/etc/network/interfaces
文件中有此内容时:
auto lo
iface lo inet loopback
auto wlan0
iface wlan0 inet static
address 192.168.0.3
netmask 255.255.255.0
gateway 192.168.0.1
broadcast 192.168.0.255
network 192.168.0.0
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
假设/etc/wpa_supplicant/wpa_supplicant.conf
已正确配置,则此方法无效。
这是来自iwconfig
以下方面的相关输出:
wlan0 unassociated Nickname:"<WIFI@REALTEK>"
Mode:Managed Frequency=2.437 GHz Access Point: Not-Associated
Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Power Management:off
Link Quality:0 Signal level:0 Noise level:0
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
以及来自ifconfig
:
wlan0 Link encap:Ethernet HWaddr ec:1a:59:64:3a:36
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:847 errors:0 dropped:1029 overruns:0 frame:0
TX packets:759 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:677394 (661.5 KiB) TX bytes:133345 (130.2 KiB)
但是,一切都奇迹般地开始工作,一旦你改变wpa-roam
到wpa-conf
和运行sudo /etc/init.d/networking restart
。您什么时候使用wpa-roam
,什么时候使用wpa-conf
?