博客
关于我
linux下 其他网口转eth0
阅读量:671 次
发布时间:2019-03-15

本文共 985 字,大约阅读时间需要 3 分钟。

用了dell的机器,装了 6.5 x86后,ifconfig看了一下网络接口,发现没有eth0,只有p4p1,虽然只是一个名字的不同,但是不习惯,下面说一下修改过程。

1、创建或者修改ifcfg-eth0

[root@localhost network-scripts]# cat /etc/sysconfig/network-scripts/ifcfg-eth0DEVICE=eth0TYPE=EthernetONBOOT=yesNM_CONTROLLED=yesBOOTPROTO=noneHWADDR=F8:BC:12:60:99:86     //网卡物理地址IPADDR=192.168.10.200        //ipPREFIX=24GATEWAY=192.168.10.1         //网关DNS1=192.168.10.1            //dnsDEFROUTE=yesIPV4_FAILURE_FATAL=yesIPV6INIT=noNAME="System eth0"

如果有ifcfg-p4p1,或者其他古怪的接口,直接mv到用户的根目录下,当作备份。记得以前,dns都是放在/etc/resolv.conf中的,并且是nameserver 192.168.10.1这样的格式。centos 6.5可以这样设置真不知道。

2、创建或者修改70-persistent-net.rules

[root@localhost rules.d]# cat /etc/udev/rules.d/70-persistent-net.rules# PCI device 0x10ec:0x8168 (r8169) (custom name provided by external tool)SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="f8:bc:12:60:99:86", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

我装的centos 6.5里面,是没有这个文件的,是我自己加上去的。

如果不重启电脑,而只是重启网络的话,是可以上网的,但是名字不会变过来。
重启电脑后,ifconfig名字才会变是eth0

转载地址:http://rfxmz.baihongyu.com/

你可能感兴趣的文章
No module named ‘MySQLdb‘错误解决No module named ‘MySQLdb‘错误解决
查看>>
No new migrations found. Your system is up-to-date.
查看>>
No qualifying bean of type XXX found for dependency XXX.
查看>>
No qualifying bean of type ‘com.netflix.discovery.AbstractDiscoveryClientOptionalArgs<?>‘ available
查看>>
No resource identifier found for attribute 'srcCompat' in package的解决办法
查看>>
no session found for current thread
查看>>
no such file or directory AndroidManifest.xml
查看>>
No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android
查看>>
NO.23 ZenTaoPHP目录结构
查看>>
no1
查看>>
NO32 网络层次及OSI7层模型--TCP三次握手四次断开--子网划分
查看>>
NOAA(美国海洋和大气管理局)气象数据获取与POI点数据获取
查看>>
NoClassDefFoundError: org/springframework/boot/context/properties/ConfigurationBeanFactoryMetadata
查看>>
node exporter完整版
查看>>
Node JS: < 一> 初识Node JS
查看>>
Node JS: < 二> Node JS例子解析
查看>>
Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime(72)
查看>>
Node 裁切图片的方法
查看>>
Node+Express连接mysql实现增删改查
查看>>
node, nvm, npm,pnpm,以前简单的前端环境为什么越来越复杂
查看>>