ip配置方法是编辑sudo nano  /etc/network/interfaces

树莓派默认配置

auto lo
iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

修改为静态ip的方法

1,老外的方法

sudo vi /etc/network/interfaces

To change to static IP address

cd /etc/networks

sudo nano interfaces

replace the line “iface eth0 inet dhcp” with

iface eth0 inet static
address 192.168.1.4
netmask 255.255.255.0
gateway 192.168.1.1

You should also take a look at the file /etc/resolv.conf
and check it has a nameserver entry (probably pointing at your default gateway) or direct to your ISP name servers.
nameserver 192.168.1.1

2.国内帖子

有些朋友一直在问如果配置网络,就简单写写吧,希望能帮助到大家
http://bbs.shumeipai.org/thread-158-1-1.html

1.配置ip地址

编辑sudo nano  /etc/network/interfaces

自动获取ip的配置:

auto eth0  
allow-hotplug eth0    
iface eth0 inet dhcp

手动配置ip:

auto eth0   
iface eth0 inet static        
address 192.168.1.7       
netmask 255.255.255.0        
gateway 192.168.0.254

2.配置DNS

编辑 sudo nano /etc/resolv.conf

domain lan
search lan
nameserver 192.168.1.1
nameserver 192.168.99.100

注:nameserver 后面的ip就是dns服务器,根据自己的运营商情况填吧

电脑与树莓派网线直连

http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=22716

方案1:

on your pc

address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.100

on your pi
/etc/network/interface

address 192.168.1.5
netmask 255.255.255.0
gateway 192.168.1.100

方案2:
Rpi
ip 172.16.1.1
mask 255.255.255.0
gateway 172.16.1.2  //172.16.1.1 works too

ubuntu
ip 172.16.1.21
sub 255.255.255.0
gateway 172.16.1.1 //172.16.1.10 works too

方案3:
That worked too.

Don't set the devices to be gateway for each other. All you need is something like this:

IP address of PC: 192.168.1.1
IP address of Rasperberry Pi: 192.168.1.2
Subnet mask on both: 255.255.255.0
Default gateway on both: 192.168.1.254

linux 配置静态IP的更多相关文章

  1. 详述Linux配置静态IP、设置DNS和主机名(一)

    Linux配置静态IP.设置DNS和主机名首先要找到配置文件,这是在Linux系统下进行工作的必须知道工作方式.后面一步步的跟着这个范例来进行配置相信你最终也会完成Linux配置静态IP.设置DNS和 ...

  2. Linux配置静态IP

    在一块SSD的CentOS配置静态IP 1. 配置静态IP #vi /etc/sysconfig/network-scripts/ifcfg-eth0   DEVICE="eth0" ...

  3. linux配置静态ip,关闭防火墙

    在vmware下安装centos6.5通过桥接方式访问外网,因此需要配置ip. 一.ip配置 1.1. 配置动态ip vi /etc/sysconfig/network-scripts/ifcfg-e ...

  4. Linux 配置静态Ip地址

    注:所有红色字体标注均为 Linux 的 操作命令 ! 1, 使用root账户登录系统 2, 可以先使用 ifconfig : 查看网卡信息   eth0 为默认的第一个网卡 , 如果有第二个就会显示 ...

  5. 【Linux杂记】Linux配置静态IP地址,修改主机名、host

    博主使用的系统是:乌班图16.04 1.设置静态IP方法如下: #sudo vim /etc/network/interfaces #修改如下部分: auto eth0//ipconfig命令查看网卡 ...

  6. VMWare虚拟机Centos 6.9中的 linux 配置静态ip地址上外网

    1.查看网络 # ifconfig 发现网络还没有配置,ping不通 2.修改网卡配置文件 # vim /etc/sysconfig/network-scripts/ifcfg-eth0 添加如下配置 ...

  7. Linux配置静态IP以及解决配置静态IP后无法上网的问题

    式一.图形界面配置

  8. Linux:Vmware安装linux虚拟机,桥接方式配置静态IP后重启网卡,提示:Error,some other host already uses address 10.252.252.21...

    问题: Vmware安装linux虚拟机,桥接方式配置静态IP后重启网卡,提示:Error,some other host already uses address 10.252.252.21... ...

  9. 【Linux】VMware虚拟机中如何配置静态IP

    此处详解如何在VMware虚拟机中配置静态IP. 上图是一个草图,大致说明下VMware网络情况.网段指某个IP范围,例如一栋小区楼和另一栋小区楼就不是一个网段 如果你在A小区,你女朋友在B小区,你想 ...

随机推荐

  1. PHP开篇之环境的搭建

    PHP开篇之环境的搭建 Wamp软件下载:http://www.wampserver.com/ 此时是2.5版本 下载下来一键安装. 安装有个主意 这里先不用管 或者smtp@qq.com 13643 ...

  2. spring结合时,web.xml的配置

    <!-- 1. web.xml配置 <context-param> <param-name>webAppRootKey</param-name> <pa ...

  3. CentOS下安装XAMPP详细教程

    现在php的集成运行环境越来越多,个人比较喜欢XAMPP,更新速度快,好用,安装便捷.windows下面的安装,就是下一步.下一步,没什么好说的,详细说一下linux下面的安装,这里以CentOS为例 ...

  4. Android 通过 Intent 传递类对象

    Android中Intent传递类对象提供了两种方式一种是 通过实现Serializable接口传递对象,一种是通过实现Parcelable接口传递对象. 要求被传递的对象必须实现上述2种接口中的一种 ...

  5. js团购倒计时

    客户端代码可以看: http://www.zhangxinxu.com/wordpress/2010/07/%E5%9B%A2%E8%B4%AD%E7%B1%BB%E7%BD%91%E7%AB%99% ...

  6. 【HDOJ】2388 Playground Hideout

    优先级队列直接AC. /* 2388 */ #include <iostream> #include <sstream> #include <string> #in ...

  7. Zookeeper安装和配置

    Zookeeper的安装和配置,可以配置成单机模式.伪集群模式.集群模式. 参考http://coolxing.iteye.com/blog/1871009 一. 单机模式 (1)zookeeper下 ...

  8. 代理服务器squid

    http://www.baidu.com/s?wd=squid%E4%BB%A3%E7%90%86%E6%9C%8D%E5%8A%A1%E5%99%A8&f=12&rsp=0& ...

  9. UNIX 网络编程第五章读书笔记

    刚看完 UNIX 第五章内容,我想按照自己的方式将自己获得的知识梳理一遍,以便日后查看!先贴上一段简单的 TCP 服务器端代码: #include <sys/socket.h> #incl ...

  10. JS将下拉框的disable变为able的方法

    在jquery中可以通过jqueryObj.attr("disabled","disabled")将页面中某个元素置为不可编辑或触发状态,但是在jquery的A ...