用了很多年Linux的我在升级Ubuntu 16.04之后竟然发现我的以太网卡的名字竟然不是eth0,变成了enp3s0,每次想要修改什么配置,
都要先ifconfig查一下网卡名,真是让我很郁闷!

去网上搜索一下才知道,这次的Ubuntu 16的更新幅度很大,当属systemd替换掉了initd来引导系统这个动作给用户带来的影响最大,
原来习惯service什么的来控制系统服务什么的,现在竟然被systemctl这个命令替换了(虽然service依旧可用)。systemd带来的另
外一个副作用(或者可以说是优点)就是网络接口的命名方式变了:

/*
 * Two character prefixes based on the type of interface:
 *   en — Ethernet
 *   sl — serial line IP (slip)
 *   wl — wlan
 *   ww — wwan
 *
 * Type of names:
 *   b<number>                             — BCMA bus core number
 *   c<bus_id>                             — CCW bus group name, without leading zeros [s390]
 *   o<index>[d<dev_port>]                 — on-board device index number
 *   s<slot>[f<function>][d<dev_port>]     — hotplug slot index number
 *   x<MAC>                                — MAC address
 *   [P<domain>]p<bus>s<slot>[f<function>][d<dev_port>]
 *                                         — PCI geographical location
 *   [P<domain>]p<bus>s<slot>[f<function>][u<port>][..][c<config>][i<interface>]
 *                                         — USB port number chain
 */

上面一段是systemd源码的注释,意思是:

  1. en代表以太网卡

  2. p3s0代表PCI接口的物理位置为(3, 0), 其中横座标代表bus,纵座标代表slot

GitHub 加速计划 / li / linux-dash
10.39 K
1.2 K
下载
A beautiful web dashboard for Linux
最近提交(Master分支:22 天前 )
186a802e added ecosystem file for PM2 4 年前
5def40a3 Add host customization support for the NodeJS version 4 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐