Linux系统Centos没有网卡eth0配置文件的解决方法

资讯 2024-06-24 阅读:101 评论:0
Linux系统Centos没有网卡eth0配置文件的解决方法LinuxCentos does not have a solution for the webcaeth0 configuration file大家都知道linux系统一般作为服...
美化布局示例

欧易(OKX)最新版本

【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   全球官网 大陆官网

币安(Binance)最新版本

币安交易所app【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

火币HTX最新版本

火币老牌交易所【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

Linux系统Centos没有网卡eth0配置文件的解决方法

LinuxCentos does not have a solution for the webcaeth0 configuration file


大家都知道linux系统一般作为服务器来用,而且很多情况的设置都是需要通过字符界面修改配置文件来设置。比如说配置网卡IP是修改/etc下面的 ifcfg-eth0,如果配置文件没有了怎么办呢?下面以Centos系统为例,解决如果没有网卡配置文件!

Everyone knows that the linux system is usually used as a server, and in many cases settings need to modify the configuration file via a character interface. For example, the configuration of the network card IP is an ifcfg-eth0 below/etc, and what if the configuration file is not available? Here, for example, the Centos system solves the absence of the config file!


1.jpg


临时解决办法

Interim solution

1、大家都知道linux下面设置ip是 ifconfig 命令

1. Everyone knows that ifconfig command is set below linux

通过下面命令即可临时设置IP地址。

The IP address can be temporarily set by the following command.

ifconfig  设备名 IP 地址 (ifconfig eth0  192.168.1.117)

Ifconfig & nbsp; device name IP address (ifconfig eth0 & nbsp; 192.168.1.117)


2.jpg


2、设置好之后马上生效,不需要重启网卡服务(千万别重启网卡服务,不然刚刚设置的又没有了)ifconfig即可查看当前网卡的IP地址。

2. When set, it will become effective without the need to reboot the Internet card service (it is not necessary to reboot the Internet card service, which has just been installed) ifconfig will be able to access the IP address of the current Internet card.


3.jpg


永久解决办法方法/步骤2

Permanent solution approach/step 2

1、以上介绍的是临时解决办法,如果要彻底解决需要生成一个网卡配置文件才行

1. The above is an interim solution, which requires the generation of a network card configuration file if it is to be completely resolved

复制设置配置文件

Copy Settings Profile

一般来说如果没有网卡eth0配置文件,你到网卡配置目/etc/sysconfig/network-scripts/下面都会有一个 ifcfg-lo 回环接口配置文件,拷贝一份

In general, if you do not have a webcaeth0 configuration file, you will have an ifcfg-lo backlink configuration file, copy one, from the webcard configuration/etc/sysconfig/network-scripts/down.



2、拷贝了一个lo配置文件之后,把文件IP地址和参数改一下改成eth0保存即可啦

After copying a lo profile, change the IP address and parameters to eth0 for preservation.


6.jpg


3、编写配置文件

3. Preparation of profiles

通过上述方法复制的文件不完整,可以通过vi编辑输入补全。或者直接手动输入设置,具体详细参数参考如下图列表

The files that are copied through the above method are incomplete and can be edited for completion via vi. Alternatively, the settings can be entered manually. The detailed parameters are referred to in the chart list below.

特别提醒一下

It's a special reminder.

如要设置mac地址,可以先ifconfig查看一下,可以看到mac地址的

If you want to set up a Mac address, you can check it ifconfig first. You can see the Mac address.


7.jpg


4、重启网络服务

4. Restarting web services

设置好网卡配置之后,需要把网络服务重启一下。输入如下命令

After setting up the network card configuration, you need to restart the network service. Enter the following command.

service network restart

如果没有提示任何错误则表示设置格式基本没有问题哈

If no error is hinted, it means there's no problem with the formatting.


8.jpg


5、如果MAC地址设置错误的话,会提示下面信息。

5. If the MAC address is set wrong, the following information is given.

可以先ifconfig查看一下,可以查看正确的MAC地址,当然你也可以直接把mac地址设置那一栏去掉可以。

If config first, you can check the correct MAC address, and of course you can set the Mac address straight off the bar.


9.jpg


美化布局示例

欧易(OKX)最新版本

【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   全球官网 大陆官网

币安(Binance)最新版本

币安交易所app【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

火币HTX最新版本

火币老牌交易所【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址
文字格式和图片示例

注册有任何问题请添加 微信:MVIP619 拉你进入群

弹窗与图片大小一致 文章转载注明

分享:

扫一扫在手机阅读、分享本文

上一篇:linux 没有 eth0 下一篇:MANA币今日行情
发表评论
平台列表
美化布局示例

欧易(OKX)

  全球官网 大陆官网

币安(Binance)

  官网

火币(HTX)

  官网

Gate.io

  官网

Bitget

  官网

deepcoin

  官网
热门文章
  • 2017年比特币行情走势

    2017年比特币行情走势
    当年比特币行情分析。【小蚂蚁和以太坊】20 17年,比特币持续走强,价格上涨,创下新的历史新高。今年,比特币作为全球范围内的投资对象受到关注和讨论。【比特币信息网络】20 17上半年,比特币价格突破1000美元关口,随后持续上涨,引起了投资者的关注。投资者对比特币的未来充满期待,并希望获得巨大的利益。ZajXXGV0【虚拟货币下跌】随着比特币价格的不断上涨,市场上出现了一场争论。一些人认为比特币泡沫即将破裂,警告投资者谨慎参与。另一方面,其他人确信比特币的价格可能会上涨。oS...
  • 正在阅读:MetaMask-以太坊钱包(浏览器插件)使用教程MetaMask-以太坊钱包(浏览器插件)使用教程

    正在阅读:MetaMask-以太坊钱包(浏览器插件)使用教程MetaMask-以太坊钱包(浏览器插件)使用教程
    简介:MetaMask 是一款浏览器插件钱包,不需下载安装客户端,只需添加至浏览器扩展程序即可使用,非常方便。它是很多支持 ETH 参投的 ICO 项目推荐使用的钱包之一。Introduction: MetaMask is a wallet of ˂a href=http://dl.pconline.com.cn/sort/104.html" target="_blank"crass="cmsLink" browser, not to download and i...
  • Coinbase:财富100强企业过去一年的Web3采用率增长39%

    Coinbase:财富100强企业过去一年的Web3采用率增长39%
    随着比特币、以太坊等主流加密货币在web2世界的认可度变得越来越高,许多web2传统公司也积极拥抱web3,加速采用和开发区块链产品的速度和应用层面。With ˂a style= "max-width": 90%" href=https://m.php.cn/zt/21172.html" target="_blank" bitcoin, ˂a style="color:#f60; text-decoration: unde...
  • 美国可以使用什么加密货币交易所_前10名比特币交易平台名单

    美国可以使用什么加密货币交易所_前10名比特币交易平台名单
    美国可以使用什么加密货币交易所?What is an encrypted currency exchange that the United States can use?随着加密货币的普及,加密货币交易所也越来越多。对于美国的加密货币交易者而言,选择一个可靠、安全且易于使用的交易所是十分重要的事情。那么,美国可以使用哪些加密货币交易所呢?以下是前10名比特币交易平台名单:The choice of a reliable, secure, and easy-to-use...
  • 2015年宝马3系二手车价格多少钱

    2015年宝马3系二手车价格多少钱
    爱你一生不变心6558 2022-04-28 13:20:03 二手车能不能买主要看车况,如果车况好就可以考虑,车况不好价格再低也别考虑,像2015款宝马3系目前行情价是在18.32万这样,如果低...
标签列表