初始网络设置。固定一个有线ip:
auto lo iface lo inet loopback iface eth0 inet static address 192.168.1.111 netmask 255.255.255.0 gateway 192.168.1.1 allow-hotplug wlan0 iface wlan0 inet manual iface default inet dhcp
插上了无线网卡,固定无线网卡的ip,两者不能同时设置,不然会sb。。。
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet static
wpa-ssid XiaoQiang-Afei
wpa-psk abcd123456
address 192.168.1.112
netmask 255.255.255.0
network 192.168.1.1
iface default inet dhcp
重启network:
/etc/init.d/networking restart
此时发现上不了外网,不知道为什么,用route发现木有默认的route项,手动加入,总感觉很坑。。。
sudo route add default gw 192.168.1.1
