1-Redhat Linux 6 更换完网卡之后修改网卡设置
Linux-》Linux下修改网卡网络配置信息
Linux-》Linux下修改⽹卡⽹络配置信息编辑/etc/sysconfig/network-scripts/ifcfg-eth0[root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0修改配置信息如下DEVICE=eth0 # ⽹卡名称HWADDR=00:0c:29:5f:a3:b0 #mac地址TYPE=Ethernet #⽹卡类型ONBOOT=yes #是否开机启动NM_CONTROLLED=yes #是否接受networkmanager的管理BOOTPROTO=static # static是静态IP,DHCP是动态IP分配IPV6INIT=no #是否IPV6USERCTL=no1IPADDR=172.16.210.91 # 静态IP地址NETMASK=255.255.255.0 # ⽹络掩码GATEWAY=172.16.210.254 # ⽹关地址基本没啥好讲的,每个⽹卡在/etc/sysconfig/network-scripts⽬录下会有⼀个⽂件对应,其实跟windows下⾯差不多,唯独有⼀点需要讲,就是DNS服务器设置linux下⾯DNS服务器地址有2个地⽅可以设置,分别是1、⽹卡配置⽂件 -- 就是上⾯的⽹卡配置⽂件⾥⾯通过加DNS1=x.x.x.x来指定DNS服务器顺序2、/etc/resolv.conf⽂件 -- 这个⽂件是即刻⽣效的,不需要重启⽹络服务。
每次⽹络服务重启(服务器重启同样)会读取⽹卡配置,如果⽹卡配置了DNS服务器地址,会⽤⽹络配置的DNS服务器地址覆盖这个⽂件⾥⾯的DNS服务器配置[root@localhost ~]# cat /etc/resolv.conf# Generated by NetworkManagernameserver 172.22.246.4[root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0[root@localhost ~]# service network restartRestarting network (via systemctl): [ 确定 ][root@localhost ~]# cat /etc/resolv.conf# Generated by NetworkManagernameserver 172.18.246.4[root@localhost ~]#但是要注意,如果⽹卡⾥⾯没有配置DNS服务器,那同样的,这个resolv.conf⽂件也会被覆盖,等于被清空。
linux网卡配置
单网卡绑定多个IP
有时,我们需要在一块网卡上配置多个IP,
例如,在上面的例子中,
shell命令:cp /etc/sysconfig/network-scripts/ifcfg-eth0 /ect/sysconfig/network-scripts/ ifcfg-eth0:1
2、mkswap /tmp/swap #创建swap文件
3、swapon /tmp/swap #激活swap文件
4、swapon -s #查看swap
5、修改/etc/fstab文件,增加以下内容,让系统引导时自动启动
vi /etc/fstab #在最后添加下面代码
/tmp/swap swap swap default 0 0
#修改localhost.localdomain为
:wq! #保存退出
shutdown -r now #重启系统
四、增加swap分区
在确定了服务器所需要使用的内存后,需要增加1024M的swap空间
具体操作:
1、dd if=/dev/zero of=/tmp/swap bs=1M count=1024M #创建1024M的文件块
2、vi /etc/sysconfig/network #编辑配置文件
HOSTNAME=
#修改localhost.localdomain为
:wq! #保存退出
3、vi /etc/hosts #编辑配置文件
127.0.0.1 localhost
NETMASK=255.255.255.192
GATEWAY=115.231.10.193
注:Linux重启网卡的方法# service network restart
Red_hat_linux_网卡及IP设置(详解)
Redhat Linux网卡及IP设置一、单网卡多IP例:将eht0 添加新地址eth0:11.拷贝/etc/sysconfig/network-scripts/ifcfg-eth0文件为ifcfg-eth0:12.修改其中DEVICE=eth0:13.根据需要修改IP地址(IPADD)和掩码(NETMASK),可以删除NETWORK、BROADCAST、HWADDR4.重启网络服务#service network restart::::::::::::::ifcfg-eth0::::::::::::::DEVICE=eth0BOOTPROTO=noneBROADCAST=125.97.5.255HW ADDR=00:0C:29:48:31:BAIPADDR=125.97.4.222NETMASK=255.255.254.0NETWORK=125.97.4.0ONBOOT=yesTYPE=EthernetUSERCTL=noPEERDNS=yes::::::::::::::ifcfg-eth0:1::::::::::::::# Please read /usr/share/doc/initscripts-*/sysconfig.txt# for the documentation of these parameters.TYPE=EthernetIPADDR=192.168.2.1DEVICE=eth0:1HW ADDR=00:0c:29:48:31:baBOOTPROTO=noneNETMASK=255.255.255.0ONBOOT=yesUSERCTL=noPEERDNS=yes二、多网卡绑定负载均衡一个IP地址1.编辑虚拟网络接口配置文件,指定网卡IP# cp /etc/sysconfig/network-scripts/ifcfg-eth0 ifcfg-bond02为接合设备创建一个网络脚本(例如:/etc/sysconfig/network-scripts/ifcfg-bond0),它和以下例子相似:DEVICE=bond0USERCTL=noONBOOT=yesBROADCAST=192.168.1.255NETWORK=192.168.1.0NETMASK=255.255.255.0GATEWAY=192.168.1.1IPADDR=192.168.1.102编辑用于eth0 和eth1 的/etc/sysconfig/network-scripts/ifcfg-ethX,因此这两个文件的内容都完全相同。
Linux下修改网卡的一些配置
Linux下修改网卡的一些配置1.修改主机名#hotnameSlyar2.修改IP地址(eth0为网卡名称)#ifconfigeth0192.168.1.5netmak255.255.255.03.修改默认网关(eth0为网卡名称)#routeadddefaultgw192.168.1.1deveth04.修改DNS#vim/etc/reolv.confLinu某命令行永久修改IP地址、网关和DNS。
5.修改IP地址首先检查一下你的主机网卡数量及名称,相关信息在/etc/yconfig/network-cript/下。
使用vim编辑你需要设置IP的网卡,这里我只能修改ifcfg-eth0,看图,不多解释,前面的状态是BOOTPROTO设置为DHCP时的写法。
vim/etc/yconfig/network-cript/ifcfg-eth0DEVICE=eth0##描述网卡对应的设备别名,例如ifcfg-eth0的文件中它为eth0BOOTPROTO=tatic#设置网卡获得ip地址的方式,可能的选项为tatic,dhcp或bootp,分别对应静态指定的ip地址,通过dhcp 协议获得的ip地址,通过bootp协议获得的ip地址HWADDR=00:0C:29:B5:B2:69#MAC地址IPADDR=12.168.1.5#IP地址NETMASK=255.255.255.0#子网掩码NETWORK=192.168.1.0#网络地址BROADCAST=192.168.0.255#广播地址NBOOT=ye#系统启动时是否设置此网络接口,设置为ye时,系统启动时激活此设备例:改IP地址:输入:#vi/etc/yconfig/network-cript/ifcfg-eth0,改完IP后保存退出。
再次输入:#ifconfig查看IP地址,但现在看到的IP地址并没有改变,这时需要重新启动网络设备,命令是:#ervicenetorkretart就重新启动网络设备了,再次输入:#ifconfig就可以看到自己改的IP地址了。
Redhat下无线网卡配置攻略
无线上网是近几年来网络发展的重点。
由于脱离了物理的线缆限制,无线上网已经成为众多家庭和办公环境的首选方式。
许多传统的基于有线局域网的环境也都在向无线迁移,这对于Linux下的驱动程序提出了很迫切。
众所周知,对于无线网卡这种新产物,Linux的驱动支持总是慢一拍,大多数网卡的驱动盘都是只有Windows的驱动,直到目前也很少有附加Linux 驱动的。
这对于Linux在国内的普及和发展造成了很大的障碍。
一、引言这两天根据实验室内部的需要,承担了改造现有网络,增加无线AP的工程。
由于本实验室长期从事Unix/Linux方面的研究和工程项目,有大量的Linux主机需要解决无线上网问题。
为此笔者一直在广泛的搜寻Linux下面可以支持无线网卡,也曾经在GOOGLE上查阅了无数资料,包括硬件厂商的、第三方开源支持的,等等。
但是这些资料看起来很多,但是实际上符合我的需求的可以说很少,主要有以下几个问题:1. 现有的叙述Linux下面无线网卡支持方案的文章,绝大多是讲使用ndis wrapper的方式。
这个软件包只支持2.6以上内核,对于内核版本2.4.20的根本不支持。
而实验室内大多数机器都在使用传统的RedHat 9.0,其内核恰恰用的是2.4.20,如果再需要换内核就比较麻烦了。
另外,它使用的重新利用WindowsXP驱动的方式,从里面分析二进制指令以转化成Linux驱动,但是目前转化率并不是100%完善,对windows xp的驱动也不是100%可用。
2. ndis wrapper需要重编译内核,这造成安装过程非常麻烦,另外很多已经在运行的应用是根本不允许再编译内核的。
因此,最好拿来驱动编出模块,直接加载就能用。
笔者认为驱动程序就是应该使用上尽量简化,比较反感需要重新编译内核的任何应用。
3. 所讲的无线网卡多是PCMICA、USB的,对于标准PCI的讲的相对较少。
而我们需要支持的大多数是PC机,使用PCI网卡是最方便的,也是最省钱的。
linux网卡修改参数(Linuxadaptertomodifyparameters)
linux网卡修改参数(Linux adapter to modify parameters)The Linux* driver for the Intel (R) PRO/1000 adapter series: Intel (R) network adapter User GuideSummarySupported adaptersSupported version of LinuxCompile and installCommand line argumentsSpeed and duplex configurationAdditional configurationUsing the Ethtool adapter testKnown problemsSupportSummaryThis document describes the Linux* underlying driver for the Intel (R) PRO/1000 adapter family, version 6.2.x. This driver supports both the 2.4.x and the 2.6.x kernel.Currently, this driver is supported only as loadable modules.Intel does not supply patches for kernel source code to allow static connections to drivers. For hardware requirements, see the attached documentation for the Intel PRO/1000 adapter. All of the hardware requirements listed are applicable to Linux.The following functionality is available in the supported kernel:Local VLANChannel combination (grouping)SNMPThe adapter packet is now implemented using the local Linux channel combination module. This is included in the supported Linux kernel. You can find the document about the channel combination from the Linux kernel source:/Documentation/networking/bonding.txtThis publication no longer supports driver information that was previously displayed in the /proc file system. Use ethtool (version 1.6 or update), lspci, or ifconfig to obtain this information.Return to topSupported adaptersThe following Intel network adapters are compatible with the drivers in this release:Controller adapter name board ID82544 Intel PRO/1000 XT server adapter A51580-xxx82544 Intel PRO/1000 XF server adapter A50484-xxx82545EM Intel PRO/1000 MT server adapter A92165-xxx,C31527-xxx82545EM Intel PRO/1000 MF server adapter A91622-xxx,C33915-xxx82546GB Intel PRO/1000 P dual port server adapter C6609-XF1182571EB Intel PRO/1000 PT dual port server adapter C57721-xxx82572EI Intel PRO/1000 PT server adapter D28777-xxx82572EI Intel PRO/1000 PF server adapter D28779-xxxTo determine whether the adapter is supported, find the motherboard ID number on the adapter. Look for labels with stripe code and 123456-001 format numbers (6 digit, hyphen, 3 digit number). Match this number to the above board number.To get more information about identifying adapters and network adapters for the latest Red Hat Linux*, access customer support.Return to topSupported version of LinuxThe Linux driver is available in the following release: Red, Hat, Enterprise, Linux (RHEL):RHEL 3-x86 (update 6)RHEL 3-EM64T (update 6)RHEL 4-x86 (Gold Edition)RHEL 4-EM64T (Gold Edition)SUSE, Linux, Enterprise, Server (SUSE):SLES9-SP3 (only EM64T)Return to topCompile and installThere are two ways to install E1000 drivers:Install from source codeInstall from DKMS RPMInstall from source codeTo compile the binary RPM* package for this driver, run'rpmbuild -tb < file name'.Tar.gz>'. Replace the file name.Tar.gz> with the actual file name of the driver.Note: to make the compiled version run correctly, it is very important that the current kernel is compatible with the version and configuration of the installed kernel source. If you have just recompiled the kernel, you should reboot the system and select the correct kernel to boot.Note: the RPM functionality has been tested only on Red, Hat, and SUSE publications.The basic driver tar file to the directory of your choice. For example, use'/home/username/e1000'or'/usr/local/src/e1000'.Unzip the archive, where <x.x.x> is the version number for the driver to compress the file:Tar zxf e1000-<x.x.x>.tar.gzSwitch to the driver SRC directory, where <x.x.x> is the driver's version number of the compressed file:CD e1000-<x.x.x>/src/Compile driver module:Make installThe binary file will be installed as:/lib/modules/< kernelversion >/kernel/drivers/net/e1000/e100.[k]oThe installation location listed above is the default location. They are not necessarily correct for certain Linux publications. For more information, see the ldistrib.txt file in the driver tar.Installation module:Insmod E1000 < value > >=< optionsNote: comparing the newer kernel with version 2.4, you may need to make the following changes to this command:Modprobe E1000 < value > >=< optionsAssign the IP address to the interface card with the following command, where <x> is the interface card number:Ifconfig eth<x> <IP address >Verify that the interface card is working properly. Enter the following command. The <IP address > is the IP address of another computer located on the same subnet as the tested interface card:Ping <IP address >Install from DKMS RPMOn the installation of CD, DKMS RPM is located at:\Linux\DKMS\base_driver\. Otherwise, cruise to the directory that contains the RPM you want to install. See the following table to determine the RPM for your Red Hat publication. In accordance with the following instructions to install or uninstall RPM.Note: you must install the DKMS (2 or higher) framework before attempting to install DKMS RPM. DKMS can be obtained from the following web site: /dkms/DKMS RPM offers to release of supported Linux, and named the e1000-< driver version >-< type >.noarch.rpm< driver version > and < type > vary due to the driver version used:< driver version > is the driver version number, such as: 6.2.xy< type > or "sb_dkms" (for packets containing source and binary), or "bo_dkms" (for packets containing only binary modules).The naming convention that contains the KDMS RPM is:"The name of the component >-< component version >-<type >.noarch.rpm例如: e1000-5.6.1-sb _ dkms.noarch.rpm: e1000 是组件名称5.6.1 是组件版本; sb; 而 _ dkms 是类型.注意: 如果已装有前一版本的必须先将其卸装, 再安装新的 rpm.要确定是否装有前一版本的 rpm rpm rpm - q, 输入 e1000.若要安装 dkms rpm, 使用此命令:rpm - > i < 文件名若要卸载 rpm, 使用此命令:rpm - e < > 软件包返回页首命令行参数使用下列选项参数的方法是将其以 modprobe 或 insmod 命令输入至命令行中, 使用的语法如下:modprobe e1000 [> = < < 选项 val1 >, < > val2,...)insmod e1000 [> = < < 选项 val1 >, < > val2,...)例如, 有两个英特尔 pro / 1000 pci 适配器时, 输入:insmod e1000 txdescriptors = 80128这为第一个适配器加载具有 80tx 的 e1000 驱动程序、为第二个适配器加载具有 128 tx 资源的 e1000 驱动程序.各个参数的默认值通常就是推荐使用的设置 (另行说明的除外).以下表格包含用于 insmod 和 modprobe 命令的参数和可能的值:参数名称有效范围/设置默认值说明autoneg(参见以下表格以了解各值)0x01 - 0x0f, 0x20 - 0x2f 0x2f 该参数是一个位屏蔽, 指定网卡所广告的速度和双工设置.使用该参数时, 不得指定 speed 和 duplex 参数.(仅在使用铜触点的英特尔适配器上受支持)双工 0 - 2 (1 = 0 = 自动协商, 半, 2 = 0 与链接伙伴均设为自动协商全) 定义数据允许的流向.可为单向或双向.如果 duplex, duplex, 则网卡将自动测试正确的双工模式.如果链接伙伴强制设置(全双工或者半双工) 默认设置为半双工.(仅在使用铜触点的英特尔适配器上受支持)flowcontrol 0 - 3 (0 = 无, 1 = 2 = 仅仅 rx, tx, rx & tx = 3) 从 eeprom 读入流量控制设置此参数控制对以太网 pause 帧的自动生成 (tx) 和响应 (rx).interruptthrottlerate 100 to 100000 (0 = 1 = 关闭, 动态 8000 此值代表控制器每秒种生成的最大的中断数量.interruptthrottlerate 是用于中断调节的另一个设置.动态模式使用试探式算法根据当前通信来负载调整interruptthrottlerate).interruptthrottlerate 不受基于英特尔 82542、82543、或 82544 的适配器的支持.注意: 当 e1000 以默认设置加载以及多个适配器同时使用时的使用量会非线性增大.若要限制 cpu, cpu 的使用量而不影响总体吞吐量, 依照下列加载驱动程序:insmod e1000.o interruptthrottlerate = 300030003000This sets the InterruptThrottleRate of the driver's first, second, and third instances to 3000 interrupts per second. The range of 2000 to 3000 interrupts per second is effective on most systems and is a good starting point, but the most valuable should be set up according to the platform. If the amount of CPU usage is not a problem, the RX_POLLING (NAPI) and the default driver settings are used.Note: InterruptThrottleRate takes precedence over the TxAbsIntDelay and RxAbsIntDelay parameters. In other words, shortening the absolute delay of receive and / or transmission does not force the controller to generate interrupts that are greater than Interrupt Throttle Rate (interrupt node flow rate).RxDescriptors adapters based on 82542 and 82544 are 80-25680-4096 for all other supported adapters256 this value specifies the number of receive descriptors allocated by the driver. Increasing this value allows the driver to buffer more access to data packets, while causingmemory usage in the system.For the PCI adapter, each descriptor is 16 bytes.For the PCI Express adapter and the PCI Express adapter in packet splitting mode, each receive descriptor is 32 bytes.For PCI and PCI-X adapters, each descriptor is equipped with a receive buffer with a fixed memory of 2048 bytes. A giant frame, if it is longer than 2048 bytes, uses an equivalent number of 2048 characters memory area. For example, a 9000 byte MTU setting uses five 2048 byte memory regions from five descriptors. This is different from the behavior of previous drivers attempting to allocate contiguous memory regions larger than or equal to the MTU size. This also improves the memory efficiency of the E1000 driver.In the PCI Express adapter packet split mode, header buffer will be assigned a 256 byte into a receive buffer, and the buffer size of up to three pages. For example, a 9000 byte MTU setting memory buffer contains a header of 256 bytes and three page size to be used.Note: the page size is defined in the OS kernel. In the i386 system, thisNormally set to 4096 bytes. Systems based on Intel (R), EM64T, and Intel (R), R, have different page size definitions.RxIntDelay 0-65535 (0= off) 0, this value delays the generation of receive interrupts in 1.024 microseconds. If the amount oftraffic is adjusted for a specific network traffic, the CPU efficiency can be improved by reducing the received interruption. Increasing this value adds additional latency to frame reception, which can lead to lower TCP traffic throughput. If the system reports that the received packet is discarded, the value may be set too high, causing the driver to run out of the available receive descriptors.Note: in some network situations, setting RxIntDelay to values other than 0 causes the hang (stop transmission). If this occurs, a NETDEV WATCHDOG message is entered in the system event log. In addition, the controller resets itself to restore network connections. To avoid hanging up, make sure that RxIntDelay is set to zero.RxAbsIntDelay 0-65535 (0=) 128 this value is in 1.024 microseconds, limiting the delay in generating a receive interrupt. This value is useful only if RxIntDelay is nonzero. It ensures that the initial packet is generated within a certain period of time and is then interrupted. Appropriate fine-tuning, coupled with RxIntDelay, may improve communication throughput in a particular network state.(supported only on Intel 82540, 82545 and above adapters)The Speed, 0, 10, 100, and 10000 Speed mandatory line speeds are the specified values, at Gigabit units per second (Mbps). If the parameter is not specified or set to 0, and the link partner is set to automatic negotiation, the network card automatically detects the correct speed. When the speed is set to 10 or 100, duplex mode must also be set.(supported only on Intel adapters using copper contacts)TxDescriptors is based on Intel 82542 and 82544 with an adapter of 80-25680-4096 for all other supported adapters256 this value is the number of transport descriptors allocated by the driver. Increasing this value allows the driver to load more packets into the queue. Each descriptor is 16 bytes.Note: depending on the available system resources, you may refuse requests for more transport descriptors. In this case, use a lower number.TxIntDelay 0-65535 (0=) 64. This value delays the generation of transmission interrupts in the order of 1.024 microseconds. If the traffic volume is adjusted for specific network traffic, the CPU efficiency can be improved by reducing the transmission interruption. If the system reports that the transport packet is discarded, the value may be set too high, causing the driver to run out of the available transport descriptors.TxAbsIntDelay 0-65535 (0= off) 64This value, in 1.024 microseconds, limits the delay in generating a transmission interrupt. This value is useful only if TxIntDelay is nonzero. It ensures that the initial packet is generated within a certain period of time and then interrupts after being transmitted through the line. Appropriatefine-tuning, coupled with TxIntDelay, may improve communication throughput in a particular network state.(supported only on Intel 82540, 82545, and update adapters)The XsumRX 0-11 value '1' indicates that the driver will be the received packets (UDP and TCP two)Enable IP checksum and load to adapter hardware.Return to topSpeed and duplex configurationSpeed and duplex configuration are controlled by three key words. The three key words are Speed (speed), Duplex (duplex) and AutoNeg (automatic negotiation).If the network card uses the fiber interface, these key words will be ignored, and the fiber interface NIC is only 1000 Mbps full duplex links.For copper network cards, the key words match each other as follows:The default operation is auto negotiation. Card ads all supported speed and duplex combinations, and if link partners are set up for automatic negotiation, it will link with the fastest common speed and duplex mode.If Speed = 1000, only limited automatic negotiation is enabledand only AD 1000 Mbps (1000BaseT specification requires automatic negotiation).If Speed = 10 or 100,Then both Speed and Duplex must be set. Automatic negotiation is disabled and the AutoNeg parameter is ignored. Link partners must also be set mandatory.If you want more control over the automatic negotiation process, use the AutoNeg parameter. Use it to control which ad speed and duplex combinations are advertised in the automated negotiation process.You can specify parameters in decimal or sixteen hexadecimal values, as specified in the following table:Position: 76543210Speed (speed) (Mbps): not applicable, not applicable 1000 does not apply to 1001001010Duplex (duplex): full, half and halfSome examples of using AutoNeg:Modprobe E1000 AutoNeg=0x01 (restrict automatic negotiation to 10 and a half duplex)Modprobe E1000 AutoNeg=1 (the same as above)Modprobe E1000 AutoNeg=0x02 (limit automatic negotiation to 10 full duplex)Modprobe E1000 AutoNeg=0x03 (restrict automatic negotiation to 10, half duplex or 10 full duplex)Modprobe E1000 AutoNeg=0x04 (restrict automatic negotiation to 100 and a half duplex)Modprobe E1000 AutoNeg=0x05 (restrict automatic negotiation to 10, half duplex or 100 half duplex)Modprobe E1000 AutoNeg=0x020 (limit automatic negotiation to 1000 full duplex)Modprobe E1000 AutoNeg=32 (the same as above)Note: Speed and Duplex must not be specified when using this parameter.Do not use this parameter if the link partner is coerced to a specific speed and duplex mode. Use the previously mentioned Speed and Duplex parameters to force the adapter to the same speed and duplex mode.Return to topAdditional configurationConfigure drivers on different releasesConfigure network drivers to load correctly when the system is started, depending on the distribution version. Typically, the configuration process adds a row of alias (Bie Ming) rows in /etc/modules.conf or /etc/modprobe.conf, and edits other system startup scripts and / or configuration files. Many Linux distributions can be changed with these tools. To see the correct way to configure your network device for your system, see the documentation for your distribution. If you ask the driver or module name during this process, the name of the Red Hat Linux base boot program for the Intel PRO/1000 series adapter is e1000.For example, you two Intel PRO/1000 adapter (eth0 and eth1) to install the E1000 driver, and the speed and duplex set "10 / 100" and "/", the following will be added to the modules.conf:Alias eth0 E1000Alias eth1 E1000Options E1000 Speed=10100 Duplex=2,1View link messagesIf the distribution limit system message, the link message will not be displayed to the console. To see the link message at the console, enter the following command to set dmesg to 8:Dmesg -n 8Note: this setting is not saved across the boot.The giant frameEnable macro support by changing the MTU value to greater than the default 1500 bytes. Use the ifconfig command to increase the size of the MTU. Such as:Ifconfig eth<x> MTU 9000 upThis setting is not saved across the boot. You can change the permanent by adding the following exercise configuration in the file /etc/sysconfig/network-scripts/ifcfg-eth<x>:MTU = 9000/etc/sysconfig/network-scripts/ifcfg-eth<x>This sample is appropriate for Red Hat publishing; other publications may store this setting in a different location.Be careful:Intel, PRO/1000, MT, and those based on Intel's 82 million 542 thousand Mbit LAN controller do not support Mega frames.Using large frames at 10 or 100 Mbps will result in poor performance or lost links.To enable macro frames, increase the size of the MTU to more than 1500 at the interface.The maximum size of the macro frame is 9238 bytes, and the corresponding MTU is 9216 bytes in size.Enable Wake on LAN* (LAN wakeup, WoL)WoL is configured through the Ethtool* utility. All Red Hat versions after Red Hat 7.2 include Ethtool. For other Linux releases, download and installEthtool:/projects/gkernel from the following web site.For instructions on enabling WoL with Ethtool, visit the web site listed above.WoL will be enabled at the next shutdown or reboot. For this driver version, to enable WoL, you must load the E1000 driver when you shutdown or reboot your system.NAPIThe NAPI (Rx turn detection mode) is supported by the E1000 driver. NAPI enabled by default. To override the default setting, use the following compile time flag.To disable NAPI, specify this additional compile flag when compiling the driver module:Make CFLAGS_EXTRA=-DE1000_NO_NAPI installTo enable NAPI, specify this additional compilation flag when compiling the driver module:Make CFLAGS_EXTRA=-DE1000_NAPI installSee http://www.cyberus.ca/~hadi/usenix-paper.tgz for more information about NAPI.Return to topUsing the Ethtool adapter testThe Intel adapter comes with built-in self-test diagnostics such as I/O conflicts, memory failures, EEPROM operating performance, and basic transport / receive operations. This helps to determine if there is a hardware fault due to an adapter or cable connection. This test function is built into the adapter and accessed by the driver. Ethtool (version, 1.8.1, or update) is the interface used to diagnose, test, and result.Ethtool is an open source program that can be used as an interface to provide driver configuration and diagnostics, and to display statistical information.Ethtool can be obtained from the following web site:/projects/gkernel. See the ethtool man (manual) page for full information about usage.To call the diagnostic program from the ethtool, enter this command:Ethtool -t <EthX>Here, <EthX> is the name of the Ethernet device to be tested (for example, "eth0").Here is an example of the output of the diagnostic program:The test result is "pass"".Registration test (offline)... ByEEPROM test (offline)... ByInterrupt test (offline)... ByLoop test (offline)... ByLink test (offline)... ByBy default, a more comprehensive "offline" test suite is invoked. Any communication on the device will be temporarily interrupted during the test. The available diagnostic test suite is determined internally by NIC. The test run is determined by the ethtool command line parameter.Here are the common Intel adapter tests:The test name describes the test resultsRegisters, writes, reads, and confirms test types through the device registers of the adapter to make sure the function is normal. A test failure may indicate an adapter failureFIFO writes the type of test bit into the FIFO buffer of the adapter to ensure that the FIFO function is normal. Not all adapters have a FIFO buffer, so it might not appear in your test results. A test failure may indicate an adapter failureEEPROM this test runs when the adapter is equipped with this type of memory. It tests the readability and data integrity of EEPROM by checking and testing. A test failure may indicate an adapter failureInterrupt it to test the ability of the adapter to generate interrupts. This test sets the interrupt cause register and reads the interrupt settings register to verify that the adapter correctly stores the internal interrupt. A test failure may indicate an adapter failureThere are two internal loop tests: the MAC (media access controller) loop and the PHY (LAN controller) loop. None of these two tests required an external loop connection or transponder. These tests set the adapter to the appropriate loopback mode and send the packet back through the receiver's receive circuitry and logic. A test failure may indicate an adapter failureLink it to check if the adapter has established a link with its link partner. If this test fails, check the cable connection and link partner status.Return to topKnown problemsCompile driverThe following error may have occurred while trying to run make install to compile the driver:"Linux, kernel, source, not, configured - missing, version.h" (Linux kernel source is not configured - missing version.h)To solve this problem, create the version.h file by entering the Linux source tree and entering:Make include/linux/version.hSuSE LINUX Enterprise Server 9A warning message in the driver compilation processWhen you compile a driver on the SuSE LINUX Enterprise Server 9 installation, you may display the following or similar warnings. No need to worry about the news. The driver will load and work properly.The symbol /usr/src/< kernel version >-obj/< version of the dump file >/< kernel type >/Module.symvers is missing, the module will disable the CONFIG_MODVERSIONS.When loading the driver,Ignore warnings in syslog:Linux kernel (Linux kernel): < driver name, >:no, version, for, struct_module, found: (not found, struct_module): kernel tainted (kernel contamination).Linux kernel (Linux kernel): < driver name >: Unsupported module, tainting kernel. (unsupported module is polluting kernel)Cannot transfer traffic by UP or noapicIn the SUSE 9.3 default (UP) kernel configuration, the APIC is turned off while the MSI is open. MSI requires that the LOCAL_APIC be opened to work properly.This is a kernel configuration problem in SUSE 9.3. It does not exist in Intel (R), EM-64T, or SUSE 10.To make PCIe NIC work properly in the SUSE 9.3 UP kernel, you need to recompile the kernel with one of the following options:Disable or disable the CONFIG_X86_APIC_OFF in the kernel configuration. (this will open the UP kernel's APIC and MSI)Disable or disable the CONFIG_PCI_MSI in the kernel configuration. (this will disable APIC and MSI for the UP kernel.)Mega frame system requirementsMemory allocation failures were observed when large frames were run on a RAM 64MB (or less) Red Hat Linux system. If you wantto use huge frames, the system memory requirement may be greater than the minimum required 64 MB.Performance degradation when using macro framesIn some mega frame environments, throughput performance may be observed to decrease. If this happens, increasing the socket buffer size of your application and / or increasing the value of the /proc/sys/net/ipv4/tcp_*mem entry can be helpful. For more information, see the specific application manual and the text file/usr/src/linux*/Documentation/networking/ip-sysctl.txt.Macro frames on Foundry BigIron 8000 switchesThere is a known problem of using Jumbo frames when connecting to the Foundry BigIron 8000 switch. This is related to third party restrictions. If packet loss is detected, the MTU size is decreased.Multiple interface cards on the same Ethernet broadcast networkBecause of the default ARP behavior on the Linux, it is impossible to have a system on the two IP networks in the same Ethernet broadcast domain (non partitioned exchanger) behave as expected. All Ethernet interface cards are responsive to any IP communication assigned to the IP address of the system. This results in unbalanced amounts of received traffic.If you have more than one interface card on the server, or enter the following command, start ARP filtering:Echo 1 > /proc/sys/net/ipv4/conf/all/arp_filterThis method is valid when the kernel version is higher than 2.4.5,Note: this setting is not saved across the boot. However, you can permanently change this configuration by following one of the following methods:Add the next line to /etc/sysctl.conf:Net.ipv4.conf.all.arp_filter = 1In different broadcast domains (or in different switches),Or install interfaces on a switch to a VLAN on a partition.82541/82547 cannot link or slow down with some link partners82541/82547 and some switches have a known compatibility problem, that is, you can't create links or slow links with some link partners. In particular, these switches are known to be incompatible with 82541/82547:Planex FXG-08TEI-O Data ETG-SH8To solve this problem, you can edit the driver through the PHY host / auxiliary settings super power. Forcing the master modeor forcing the auxiliary mode will improve link time.# make CFLAGS_EXTRA=-DE1000_MASTER_SLAVE=<n>Here <n> =0 - hardware defaults1 - Master mode2 - auxiliary mode3 - Automatic master / auxiliaryDisable RX traffic control with ethtoolYou must disable automatic negotiation in the same command line before you can disable receive traffic control using ethtool. Such as:Ethtool, -A, ETH, autoneg, off, Rx, offReturn to top。
redhat系统更换网卡后不能激活网卡解决办法
redhat系统更换网卡后不能激活网卡解决办法redhat系统更换网卡后不能激活网卡解决办法
一。
问题环境与描述
VM虚拟机,更换网卡后不能激活网卡
二。
问题可能性分析
1.网卡名字变更了
2.i p地址不正确了
3.配置文件将网卡禁止了
三。
解决方法
首先打开终端,输入:Service network restart,以确定网卡无法激活
1.网卡名字变更的话
输入:dmesg | grep eth //检查网卡的具体名字,如下图可见网卡变成eth1了
2. 输入:setup修改网卡名称并配置ip
保存退出,输入:service network restart,重启网卡
3.如果依然激活不了,那么修改配置文件看网卡是否禁用。
输入:cd /etc/sysconfig/netword-scripts/
然后打开网卡配置文件,把ONBOOT设置为yes!!:如下图
然后重启网卡,这回可以启动成功,以上图片只做辅助说明只用,具体以你的设置和情况为准。
Linux网卡参数配置方法教程
Linux网卡参数配置方法教程在Linux 下如果想修改网卡的参数有很多种方法,第一种方法是修改/etc/network/interfaces 文件,这种方法可以在重启后依然有效;另外一种方法是使用ifconfig 指令,这种方法只能临时性的修改网卡参数,在重启后会失效。
接下来是小编为大家收集的Linux 网卡参数配置教程,希望能帮到大家。
Linux 网卡参数配置教程修改interfaces 文件interfaces 文件在/etc/network/ 文件夹下,是网络接口配置文件,里面包含了所有网络接口的配置信息。
interfaces 文件有自己的编写规则,其中以'#' 开头的行会被系统忽略,因此可以作为注释使用。
每个指令占一行,如果写不下可以用'\' 符号作为此行结尾,在下一行接着写命令。
文件由"iface","mapping","auto" ,"allow-" 和"source" 字段组成。
下面是一个例子:auto lo eth0allow-hotplug eth1iface lo inet loopbacksource interfaces.d/machine-dependentmapping eth0script /usr/local/sbin/map-schememap HOME eth0-homemap WORK eht0-workiface eth0-home inet staticaddress 192.168.1.1netmask 255.255.255.0up flush-mailiface eth0-work inet dhcpiface eth1 inet dhcp以"auto" 开头的行是用来确定物理网络接口将会被启动当ifup -a 指令被运行时(这个指令会在系统启动脚本中使用,因此开机时会自动启动以"auto" 开头设置的网卡)。
RedHat6网络相关设置
RedHat6网络相关设置目录1 图形界面修改主机名和IP (1)1.1 修改主机名 (1)1.2 修改IP (1)2 命令行界面 (3)2.1 修改ip (4)2.2 动态增加IP方法 (5)2.3 配置网卡是否可用和主机名 (6)3 IP设置问题汇总 (6)3.1 NetworkManager导致IP激活失败 (6)3.2 重启网卡失败问题 (7)3.3 虚拟机拷贝之后网卡无法激活的问题 (7)1 图形界面修改主机名和IP1.1 修改主机名在终端中输入system-config-network(非root用户使sudo system-config-network),出现如图1-1界面图1-1将图1-2中的主机名修改后,选择确定图1-2重启电脑即可。
1.2 修改IP在终端中输入system-config-network,出现如图1-1界面图1-1选择设备配置,如图1-2所示图1-2【名称】使网卡的名字,可以自定义,建议不动;【设备】是网卡的硬件名称,不能改动;【使用DHCP】不选,选中的话为动态分配IP;【静态IP】设置需要的IP,如10.10.5.200;【子网掩码】super5000系通一般为255.255.255.0;【默认网关IP】与静态IP对应,如果静态IP为10.10.5.200,网关IP为10.10.5.254;【On boot】选中,自启动;【Controlled by NetworkManager】不选中;设置完成后,图1-2选择【确定】,如图1-3所示:图1-3图1-3选择【保存】,后选择【保存并退出】,如图1-4所示;图1-4命令行输入:sudo service network restart重启网络服务即可。
如果是联想部分型号服务器,在安装操作系统的时候没有激活硬件网卡,需要额外增加网口的时候,service network restart命令行不起作用,重启电脑IP 即可设置完成。
linux 跟换主板后网卡配置
计算机中心所有的删除操作都要谨慎!删除需谨慎!要备份一、服务器故障报修,主板坏了,更换主板后,无法识别网卡,用命令ifconfig -a 查看只显示lo loopback 127.0.0.1,以及eth3,eth4,eth5等没有网卡的信息,如此的话,导致服务器和别的节点服务器都无法ping通系统加载网卡驱动后会去读一个文件,这个文件是一个缓冲文件,包含了网卡的mac地址,因为更换了主板,网卡的mac地址也变了,但是这个文件的mac地址还没变,还是之前坏了的主板的上面的网卡的MAC地址。
这样系统在加载网卡,读取这个文件的时候读取的是之前网卡的mac地址,和现在更换后主板后的网卡mac地址不一致导致混乱,所以就识别不了当前网卡;这个文件就是:/etc/udev/rules.d/70-persistent-net.rules (不同的系统可能文件不同)/etc/udev/rules.d/60-net.rules(不同的系统可能文件不同)(需要把这个文件重命名)重启服务器就可以解决了,重启后会重新生成这个文件;注意:有时候重启后还是出现以上情况,对比之前的文件,新的文件mac地址和name已经改变,name=eth0,和之前name=em1的名字不同;操作:ifconfig eth0 down然后编辑:vi /etc/sysconfig/network-scripts/ifcfg-eth0重启网卡:service network restart注意:更换主板后,ip mi的信息也变了,要在开机bios的BMC 网络管理模块更改成之前的ipmi地址首先要查看网卡的命令ifconfig –a|more禁用和启用网卡命令Ifup eth2 ifdown eth2修改好网卡配置vi/etc/sysconfig/network-scripts/eth2配置好重启网络服务Service network restart册除网卡缓存文件。
Linux、Windows下更换网卡后的网络重配置
Linux、windows 下更换网卡后的网络重配置我们在为安装了Redhat 的服务器更换网卡、主板或SPI板(集成网卡在主板或SPI 上)时,系统的网络配置信息有变,需要重新配置信息才能正常连通网络,因为redhat5 与redhat6的情况不一样,下面分别以这两种系统来举例说明:Redhat5:网卡更换前,只存在eth0:我们点击进入eth0可以看到eth0的网络配置信息如下:当我们更换网卡后,再进入网络可以看到已生成了一个eth0.bak文件:我们再点击进入eth0可以看到,原本的网络信息已不存在:点击eth0.bak可以看到,原本的网络信息在eth0.bak内:若想让网卡恢复原先配置,需要把eth0.bak内的信息重新写回eth0中并激活,重启网络即可:Redhat6:网卡更换前,只存在eth0:点击进入eth0,可以看到网络配置信息如下:更换网卡后,通过setup图开化界面还是只能看到存在eth0:点击进入eth0可以看到,原本的网络配置信息存在,但需要注意的是,现在网络不能连通,因为新加入的网卡已不是原本的eth0,我们通过ifconfig–a 验证如下,新加入的网卡为eth3:所以我们需要把原本eth0的信息写入eth3的配置文件ifcfg-eth3(需要自己创建),可以用下面两种方法操作:1.通过修改/etc/sysconfig/network-scripts/ifcfg-eth0文件:把ifcfg-eth0改名为ifcfg-eth3:并修改里面DEVICE名称为eth3:保存退出重启网络即可。
2.通过setup工具:在命令行输入setup,弹出图形化工具:选择Network configuration并选择New Device:选择Ethernet:新建网卡如下,其中的网络信息为更换网卡前的网络信息:保存并重启网络即可。
Windows下,更换网卡后,系统会自动将新的网卡信息重写到网络配置文件,并不需要我们做任何操作。
linux(Red Hat)网卡数据的配置方法
linux网卡数据(含路由)的配置方法在命令行可以配置网卡数据(含路由)并直接生效。
以下以网卡eth0为例。
1.在命令行进行配置(1)配置网卡IPifconfig eth0 172.16.80.31 netmask 255.255.255.0(2)配置网卡默认网关route add default gw172.16.80.4 dev eth0(3)增加路由1(主机路由)route add -host 172.16.81.91 netmask 255.255.255.0 gw172.16.80.254 dev eth0(4)增加路由2(网段路由)route add -net 192.168.71.0 netmask 255.255.255.0 gw 172.16.80.240 dev eth0(5)删除路由将“add”改为“del”(6)激活或去激活网卡(该网卡上配置的路由被同步激活或去激活)ifup/ifdown eth02.检查(1)检查已激活网卡ifconfig在输出信息中的网卡即是已激活的网卡。
(2)检查全部可用的网卡ifconfig –a在输出信息中的网卡即是所有可用的网卡(含激活和未激活网卡)。
(3)检查生效的路由route[root@PC1 ~]# routeKernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Iface192.168.71.0 172.16.80.240 255.255.255.0 UG 0 0 0 eth0172.16.80.0 * 255.255.255.0 U 0 0 0 eth0172.16.81.0 172.16.80.254 255.255.255.0 UG 0 0 0 eth0192.168.122.0 * 255.255.255.0 U 0 0 0 virbr0default 172.16.80.4 0.0.0.0 UG 0 0 0 eth0注意:上述命令行虽然创建或修改了网卡数据并能直接生效,但并没有保存到相关配置文件中,所以当系统重启后,这些网卡配置数据将不复存在。
LINUX 6.0双网卡绑定
双网卡绑定linux下双网卡绑定环境:rhel 6.01.新建/etc/sysconfig/network-scripts/ifcfg-bond0文件DEVICE=bond0ONBOOT=yesBOOTPROTO=staticIPADDR=192.168.0.23NETMASK=255.255.255.224GATEWAY=192.168.128.233USERCTL=no这里要主意,不要指定单个网卡的IP地址、子网掩码或网卡ID。
将上述信息指定到虚拟适配器(bonding)中即可。
2.更改/etc/sysconfig/network-scripts/ifcfg-eth0网卡属性DEVICE=eth0ONBOOT=yesBOOTPROTO=noneMASTER=bond0USERCTL=no3.更改/etc/sysconfig/network-scripts/ifcfg-eth1网卡的属性DEVICE=eth1ONBOOT=yesBOOTPROTO=noneMASTER=bond0USERCTL=no文章出处:DIY部落4#vi/etc/modules.d/dist.conf或vi/etc/modprobe.d/dist.conf编辑/etc/modules.d/dist.conf文件,加入如下一行内容,以使系统在启动时加载bonding模块,对外虚拟网络接口设备为bond0加入下列两行alias bond0bondingoptions bond0miimon=100mode=1说明:miimon是用来进行链路监测的。
比如:miimon=100,那么系统每100ms监测一次链路连接状态,如果有一条线路不通就转入另一条线路;mode的值表示工作模式,他共有0,1,2,3四种模式,常用的为0,1两种。
mode=0表示load balancing(round-robin)为负载均衡方式,两块网卡都工作。
LINUX服务器改网卡
Linux下调整网卡的工作模式现在的网卡一般都是10/100M/1000M自适应工作模式,在配置网卡参数时我们很少考虑它的工作模式,但是在路由器、交换机、代理服务器等通信量比较大的关键设备上,我们应该为它指定正确的工作模式,这样可以提高通信效率。
在Linux环境下,我们可以使用系统自带的工具mii-tool(这是专门设置网卡工作模式的命令)来配置网卡工作模式。
下面我们具体来谈一下它的使用方法。
1. 查看网卡的工作模式,输入命令:一,用mii-tool来调整#mii-tool -veth0: negotiated 100baseTx-FD,link okproduct info:Vendor 00:05:be,model 8 rev 0basic status: autonegotiation complete,link okbasic mode:autonegotiation enabled.Capabilities: ..............从以上信息中可以看出,这块网卡工作在100M全双工自适应模式下,“100BaseTx-FD”意为100M Full Duplex。
2. 更改网卡的工作模式,输入命令:#mii-tool -F media [interface]media可选的模式有100baseTx-FD、100baseTx-HD、10baseT-FD、10baseT-HD等。
Interface代表所选择的网卡,如eth0、eth1等,默认为eth0。
例如,设置网卡工作在10M半双工模式下,输入命令:#mii-tool -F 1000baseTx-FD eth23. 恢复网卡的自适应工作模式,输入命令:#mii-tool -r eth2二,用ethtool来调整ethtool ethX //查询ethX网口基本设置ethtool –h //显示ethtool的命令帮助(help)ethtool –i ethX //查询ethX网口的相关信息ethtool –d ethX //查询ethX网口注册性信息ethtool –r ethX //重置ethX网口到自适应模式ethtool –S ethX //查询ethX网口收发包统计ethtool –s ethX [speed 10|100|1000]\ //设置网口速率10/100/1000M [duplex half|full]\ //设置网口半/全双工[autoneg on|off]\ //设置网口是否自协商[port tp|aui|bnc|mii]\ //设置网口类型例如:查询eth0网卡的工作模式:[root@freesky ~]# ethtool eth0Settings for eth0:Supported ports: [ TP ]Supported link modes: 10baseT/Half 10baseT/Full100baseT/Half 100baseT/Full1000baseT/FullSupports auto-negotiation: YesAdvertised link modes: 10baseT/Half 10baseT/Full100baseT/Half 100baseT/Full1000baseT/FullAdvertised auto-negotiation: YesSpeed: 1000Mb/sDuplex: FullPort: Twisted PairPHYAD: 0Transceiver: internalAuto-negotiation: onSupports Wake-on: umbgWake-on: gCurrent message level: 0x00000007 (7)Link detected: yes例如:将网卡eth1设置为100M全双工、自动协商关闭# ethtool -s eth1 autoneg off speed 100 duplex full网卡模式修改后如果系统重启好就恢复原样了,为了保存我们修改好的设置有两种方面:一,ethtool设置可通过/etc/sysconfig/network-scripts/ifcfg-ethX文件保存,从而在设备下次启动时激活选项。
Redhat linux常用配置修改
Redhat linux常用配置文件修改方法
Linux中命令行修改配置一般重启后无效,一般修改配置文件后才能保证重启生效,而Linux配置文件一般都存放在/etc/目录下,这里介绍一些Redhat常用配置的配置配置文件的修改方法
1.修改网络配置vi /etc/sysconfig/network-scripts/ifcfg-eth0
这里可以修改网卡地址、ip地址、子网掩码和默认网关等信息
注意,eth0为第一块网卡,如果有多块网卡需要修改则修改eth1、eth2依次类推即可
修改完保存并推出后执行service network restart即可生效
2.修改DNS vi /etc/resolv.conf
在该配置文件里面添加nameserver空格DNSip地址保存后推出
执行service network restart即可生效
3.修改主机名vi /etc/sysconfig/network
修改完保存并推出后执行reboot重启计算机后方可生效
4.修改主机的默认运行级别vi /etc/inittab
将id:3:initdefaule:这一行的3改为1、2、5都可以,根据需要来改,改为0启动就关机,改为6会跑步重启,改为其他值则系统不能正常启动需要用光盘进救援模式修改回来才可以。
修改完保存并推出后执行init 6重启计算机计算机会以其他运行级别启动
查看当前运行级别命令runlevel
5.Linux启动时需要随机启动一些程序vi /etc/rc.d/rc.locale
修改完保存并退出执行shutdown -r重启计算机生效
6.随机启动时挂载生效vi/etc/fstab
修改后执行reboot重启计算机生效
这里先介绍这么多,以后继续介绍。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Redhat Linux 6 更换完网卡之后修改网卡设置
——PDZCL-秦汇丰例:
背景:用户有一台没有安装独立网卡DL580 G7,装的SUSE linux 、 Redhat linux 系统,SPI板上自带四个集成网卡(eth0、eth1、eth2、eth3),但是现在由于服务器有故障需要更换SPI板。
这时候就遇到了一个问题,更换完SPI板之后开机会看到多出来4个网卡(eth4、eth5、eth6、eth7),平且用ifconfig -a 命令能看到原有的四个网卡依然还在,也就是一共有8个网卡,当然新SPI板上的网卡对应系统下的网卡就是eth4~7,平且原有的网卡配置信息(IPADDR、GATEWAY、NETMASK)也没有同步到新产生的eth4~7里面,网络也不通。
解决方法:
需要更改/etc/udev/rules.d/70-persistent-net.rules 文件,把之前的老网卡的信息从配置文件中注释或者删除掉(下文采用“注释”,建议用此办法)
打开配置文件
[root@qinhf-server ~]# vim /etc/udev/rules.d/70-persistent-net.rules
会看到以下内容(这里由于篇幅原因,不再列出4块网卡的配置文件,假设用户原来只有1块网卡<eth0>,更换完之后在下面出现两个网卡信息<eth0、eth1>)
现在需要编辑这个文件,需要先按键盘上的Insert键,在命令行窗口左下角出现如下图的时候才能修改编辑
然后在“eth0” (也就是之前的旧网卡)对应的这一行的最前方的SUBSYSTEM 的面加一个“ #” ,这一行的字体就会从原来的彩色字体变为单一的蓝色字体,和下面的eth1一行会有明显的颜色对比。
(如下图)
然后把下面这一行的eth1 更改成eth0,最终效果如下:
然后按“ESC” ,输入:wq 保存退出
然后用init 6 命令重启服务器,新的网卡的配置文件会在重启服务器的时候自动指向原有的网卡配置文件。
Over。