更改Linux網卡名稱

轉載自:https://blog.csdn.net/yeziand01/article/details/88424624web

文章目錄

問題

系統:ubuntu 16.4
今天在配置hadoop兩塊網卡,配置完後,發現網卡1不是eth0而是enp0s3;網卡2不是eth1而是enp0s8
在這裏插入圖片描述shell

緣由

網上搜索發現的Ubuntu 16進行更新了,網絡接口的命名方式變了。ubuntu

解決方案

在網絡配置文件中,按新的命名方式配置。
sudo vim /etc/network/interfaces
原來想這樣配置:vim

#NAT interface
auto eth0
iface eth0 inet dhcp
# host noly interface
auto eth1
iface eth1 inet static
address 192.168.56.101
netmask 255.255.255.0
network 192.168.56.0
broadcast 192.168.56.255

改爲這樣配置markdown

#NAT interface
auto enp0s3
iface enp0s3 inet dhcp
# host noly interface
auto enp0s8
iface enp0s8 inet static
address 192.168.56.101
netmask 255.255.255.0
network 192.168.56.0
broadcast 192.168.56.255

本文同步分享在 博客「zy010101」(CSDN)。
若有侵權,請聯繫 support@oschina.cn 刪除。
本文參與「OSC源創計劃」,歡迎正在閱讀的你也加入,一塊兒分享。網絡

相關文章
相關標籤/搜索