树莓派,呵呵。

初始网络设置。固定一个有线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

 

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据