Linux网卡命名enp3s0说明

来源:互联网 发布:手机淘宝在线客服 编辑:程序博客网 时间:2024/06/06 02:39

用了很多年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

原创粉丝点击