V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
xingshu1990
V2EX  ›  问与答

如何修改文件 使公司和家里的有线网络都能连接上树莓派

  •  
  •   xingshu1990 · Jun 23, 2020 · 896 views
    This topic created in 2134 days ago, the information mentioned may be changed or developed.

    树莓派环境: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 的配置文件。但是现在我搜索不到这个文章,求告知。

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1510 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 16:49 · PVG 00:49 · LAX 09:49 · JFK 12:49
    ♥ Do have faith in what you're doing.