树莓派环境:raspberry list 3B+
已经通过修改 /etc/dhcpcd.conf 使树莓派能通过网线连接公司网络 修改 1: /etc/dhcpcd.conf
内容: interface eth0 fallback static_eth0 static ip_address=192.168.1./24 static routers=192.168.1. static domain_name_servers=192.168.1.* 8.8.8.8
修改 2: /etc/resolv.conf
Generated by resolvconf nameserver 192.168.1.* nameserver 8.8.8.8
经过以上修改,已经在公司通过有线网络,让树莓派能上网。 考虑到回到家也使用有线网络,连接上树莓派,让 PC 端通过 xshell 远程连接上树莓派,而不是把显示器拔了接到树莓派上。 因此动手修改: /etc/dhcpcd.conf 添加一个 interface eth0 fallback static_eth0 static ip_address=192.168.123./24 static routers=192.168.123. static domain_name_servers=192.168.123.* 8.8.8.8
但是实际这样修改以后,树莓派不能通过网线上网。 于是咨询各位,怎么修改 dhcpcd.conf 和 resolv.conf 使其接上有线就可以上网(就公司和家里两条线路)
还有一种给树莓派设定 wifi 的操作是,通过命令,使树莓派扫描周边网络,然后命令选择网络,输入密码,就可以直接连接上网,不用配置 wifi 的配置文件。但是现在我搜索不到这个文章,求告知。