一、设置隐藏无线静态ip地址
1.用命令产生wpa_psk:wpa_passphrase “MT-WiFi” “@boozhong.com”
2.sudo nano /etc/network/interfaces
auto lo
iface lo inet loopback
iface eth0 inet dhcp
auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.0.30
netmask 255.255.255.0
gateway 192.168.0.2
wpa-scan-ssid 1
wpa-ap-scan 1
wpa-key-mgmt WPA-PSK
wpa-proto RSN WPA
wpa-pairwise CCMP TKIP
wpa-group CCMP TKIP
wpa-ssid "MT-WiFi"
wpa-psk 34f7016d83555ece6041b0ea2afb7939e95c74138c821003d710366d9d2fea90
3.sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
4.sudo nano /etc/resolv.conf
nameserver 61.177.7.1
nameserver 221.228.255.1
二、有线静态IP配置
1.备份原interfaces文件为interfaces_wifi.back
2.修改 /etc/network/interfaces
sudo vim /etc/network/interfaces
修改为:
auto lo
iface lo inet loopback
iface eth0 inet static
address 192.168.1.222
netmask 255.255.255.0
gateway 192.168.1.1
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
3.sudo service networking restart //sudo reboot
sudo ifconfig eth0 192.168.1.222 netmask 255.255.255.0
sudo route add default gw 192.168.1.1
sudo ifconfig eth0 up