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!
临时解决办法
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、设置好之后马上生效,不需要重启网卡服务(千万别重启网卡服务,不然刚刚设置的又没有了)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.
永久解决办法方法/步骤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.
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.
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.
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.
注册有任何问题请添加 微信:MVIP619 拉你进入群
打开微信扫一扫
添加客服
进入交流群
发表评论