标签 interface 下的文章

我们虚拟机之前的网卡配置是交给 init的 networking 服务来管理的, 具体配置不同系统系统可能不一样。 比如 Debian/Ubuntu系列操作系统配置在 /etc/network/interfaces文件中, 而Redhat/CentOS系列操作系统配置在 /etc/sysconfig/network-scripts/ifcfg-XXX 网卡配置中。

但是如果我们希望所有网卡通过 DHCP 动态获取IP地址, 那我们就需要在对应的网卡配置中, 配置动态获取功能。 例如 Ubuntu

# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

allow-hotplug eth0
iface eth0 inet dhcp

allow-hotplug eth1
iface eth1 inet dhcp

- 阅读剩余部分 -