树莓派
来源:互联网 发布:最新美化照片软件 编辑:程序博客网 时间:2024/06/05 03:17
1. interfaces中参数的含义
参见:https://unix.stackexchange.com/questions/128439/good-detailed-explanation-of-etc-network-interfaces-syntax
layer 2 options:
auto
– Start the interface(s) at boot. That’s why the lo
interface uses this kind of linking configuration.
allow-hotplug
– Start the interface when a "hotplug" event is detected. In the real world, this is used in the same situations as auto
but the difference is that it will wait for an event like "being detected by udev hotplug api" or "cable linked".
Layer 3 options:
inet static
– Defines a static IP address.
inet manual
– Does not define an IP address for an interface. Generally used by interfaces that are bridge or aggregation members.
inet dhcp
– Acquire IP address through DHCP protocol.
2. auto与allow-hotplug的区别
参见:http://blog.csdn.net/xkq_lyx/article/details/17079849
/etc/network/interfaces文件中一般用auto或者allow-hotplug来定义接口的启动行为。
auto
在系统启动的时候启动网络接口,无论网络接口有无连接(插入网线),如果该接口配置了DHCP,则无论有无网线,系统都会去执行DHCP,如果没有插入网线,则等该接口超时后才会继续。
allow-hotplug
只有当内核从该接口检测到热插拔事件后才启动该接口。如果系统开机时该接口没有插入网线,则系统不会启动该接口,系统启动后,如果插入网线,系统会自动启动该接口。也就是将网络接口设置为热插拔模式。
一般修改了网络配置文件后,会用以下命令重新启动网络
# /etc/init.d/networking restart
但从squeeze开始,此命令会有如下提示:
Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces … (warning).
Reconfiguring network interfaces…done.
如果设置接口为auto,虽然会有如此提示,但接口仍然会正确的启动。
如果接口设置为allow-hotplug则没有这么走运了,网络接口不会正确启动。这种情况下必须使用如下命令启动网络接口:
#ifup <interface_name>
看来大多数情形下,网络接口还是用auto方式比较省心。
- 树莓派
- 树莓派
- 树莓派
- 树莓派
- 树莓派
- 树莓派
- 树莓派
- 树莓派
- 树莓派
- 树莓派
- 树莓派
- 树莓派
- 树莓派
- 树莓派
- 树莓派
- 树莓派
- 树莓派
- 树莓派
- SSMA 整合
- ES6学习笔记-ES6的概念
- 一些好的网站记录(PART 2)
- MySql避免重复插入记录方法(ignore,Replace,ON DUPLICATE KEY UPDATE)
- Microservice架构模式简介
- 树莓派
- pthread_create未定义
- sqoop2安装配置
- 基本权限 ACL
- PHP设计12306.cn (转载)
- redis整理
- C++ const 指针与指向const的指针
- spring mvc集成shiro权限控制
- 一个Eigen库使用时的出现的问题(complex的头文件兼容性)