zoukankan      html  css  js  c++  java
  • Raspberry Pi3 ~ 配置网络

    Rpi3 有两个网卡 一个无线wlan 一个有线 eth0

    无线的只需要在右上角的那个配置里面添加就行

    有线的需要设置下静态IP、dns、等

    在raspbain图形化界面里面 设置 Network Perferences

    取消勾选 Auto matically configure empty options

    然后配置

    IP Address 192.168.3.169

    Router   192.168.3.1

    DNS Servers  61.153.177.196

    重启下Rpi 3  即可

    使用命令配置  这里参考的是 这篇博文

    1、配置mac地址

    sudo ifconfig eth0 down hw ether xx:xx:xx:xx:xx:xx  
    sudo ifconfig eth0 up


    将上面两行代码复制进/etc/rc.local即可开机自动更改。

    单独运行上面两行即可修改mac地址

    2、设置IP与静态网关等

    备份/etc/network/interfaces文件,并修改如下:

    1)注释掉

    iface eth0 inet dhcp 

    2)添加以下几行

        # The loopback interface  
         auto lo  
         iface lo inet loopback  
         auto eth0  
         iface eth0 inet static  
         #your static IP  
         address 192.168.3.169   
         #your gateway IP  
         gateway 192.168.3.1  
         netmask 255.255.255.0  
         #your network address "family"  
         network 192.168.3.0  

    其中network由IP决定,其最终结果为IP地址最后一位改为0

    4)配置DNS服务器

    在:/etc/resolv.conf中添加一条

    nameserver  61.153.177.196


    结束

    若提示以下错误:

    pi@raspberrypi:~$ ping 10.10.10.34  
    connect: Network is unreachable

    解决方法 可以在/etc/rc.local中在ifconfig eth0 up后面加

    /etc/init.d/networking restart &
  • 相关阅读:
    f2fs源码解析(五) node管理结构梳理
    没有什么好神秘的: wait_on_page_bit
    write_back 浅浅分析
    f2fs解析(六)
    转载软件需求文档标准格式
    转载 如何设计一个优秀的数据库
    转载 MySQL创建表的语句 示例
    equals和==的区别 (Java基础)
    转载 【Linux】Linux中常用操作命令
    windows 注册表
  • 原文地址:https://www.cnblogs.com/einstein-2014731/p/5439297.html
Copyright © 2011-2022 走看看