个人interfaces设置
vim /etc/network/interfaces
#allow-hotplug eth0
auto eth0
iface eth0 inet static
address 192.168.0.11
netmask 255.255.255.0
network 192.168.0.1
broadcast 192.168.0.255
gateway 192.168.0.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 192.168.0.1 #DNS一定要对,不然无法上外部网。
dns-search exc.com
# The wireless interface
auto wlan0
iface wlan0 inet static
address 192.168.0.12
netmask 255.255.255.0
network 192.168.0.1
broadcast 192.168.0.255
gateway 192.168.0.1
wpa-ssid "XXXXXX" #无线名称
wpa-psk "XXXXXXXXXXXXXXX" #无线密码
dns-nameservers 192.168.0.1 #DNS一定要对,不然无法上外部网。
#无线开关指令
echo 1 > /sys/class/rfkill/rfkill0/state #开启
echo 0 > /sys/class/rfkill/rfkill0/state #关闭
阅读(3830) | 评论(0) | 转发(0) |