(1)进入控制面板的网络和共享中心,更改适配器设置:
进入有网的连接,进行网络共享:共享后被共享的网络 IP默认为了
(2)设置串口IP:
sudo ifconfig eth0 192.168.137.100 netmask 255.255.255.0
设置后Jupyter Notebook需要重新进入192.168.137.100
如下所示:
(3)配置网关:
1.进入vim进行编辑:sudo vi /etc/network/interfaces
进入后按 “ i ”(insert)进行编辑
2.将网关设置为:
# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfa
auto eth0
iface eth0 inet static
address 192.168.137.100
netmask 255.255.255.0
gateway 192.168.137.1
source-directory /etc/network/interfaces.d
编辑完成后切换为英文输入法按 “ CTRL+C ” 然后按 “ :wq! ”退出编辑
(4)进入vim配置DNS: vi /etc/resolv.conf
vim的操作和(3)配置网关一样
将文件改为:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameserv
nameserver 127.0.0.53
nameserver 114.114.114.114
nameserver 114.114.115.115
search mshome.net
(5)重启网络 : /etc/init.d/networking restart
(6)连接测试: ping www.163.com
或者ping对应的 IP 也可:ping 222.134.66.175
(7)下载库文件测试: pip install imageio
参考博文:https://blog.csdn.net/qq_23379273/article/details/84111510
https://blog.csdn.net/zkf0100007/article/details/89785853