查看: 86|回覆: 0

[Debian] Debian 中 allow-hotplug 与 auto 的区别(转)

[複製鏈接]

3

主題

0

回帖

0

積分

热心网友

金币
0
閲讀權限
220
精華
0
威望
0
贡献
0
在線時間
0 小時
註冊時間
2012-2-8
發表於 2021-7-6 15:24:00 | 顯示全部樓層 |閲讀模式

转自:https://blog.starryvoid.com/archives/299.html

Debian 中 allow-hotplug 与 auto 的区别冷不丁没注意还真是小坑了一下,所以在此记录


1、allow-hotplug 与 auto 的理论区别

auto

在系统启动的时候启动网络接口,无论网络接口有无连接 (插入网线)。如果该接口配置了 DHCP,则无论有无网线,系统都会去获取 DHCP。并且如果没有插入网线,则等该接口超时后才会继续 DHCP。

allow-hotplug

只有当内核从网络接口检测到热插拔事件后才会启动该接口。如果系统开机时该接口没有插入网线,则系统不会启动该接口。系统启动后,如果插入网线,系统会自动启动该接口。

2、allow-hotplug 与 auto 的简单说明

auto

配置这个命令,仅仅是用于开机启动时启动网络接口,如果不配置重启自动不会启动网络接口,就直接导致远程登录失败。

allow-hotplug

配置这个命令,是为了保证端口状态及时更新,或者避免由于手动操作导致的重启 network 失败。

3、interface 中的具体使用

auto lo
  iface lo inet loopback
allow-hotplug eth0
  iface eth0 inet dhcp
auto eth1
  iface eth1 inet static
    address 192.168.1.100
    netmask 255.255.255.0
    gateway 192.168.1.1

4、参考链接

https://wiki.archlinux.org/index.php/Network_configuration_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)

http://wiki.ubuntu.org.cn/Ubuntu%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97



来源:https://www.cnblogs.com/arci/p/14977135.html
回覆

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即注册

本版積分規則

相关侵权、举报、投诉及建议等,请发 E-mail:qiongdian@foxmail.com

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部