服务器更换网卡不能通信等问题

1.服务器更换网卡(服务器开机网卡的灯是不亮的)
2.进系统进行网卡配置

复制代码
[root@bj ~]# cat /etc/udev/rules.d/70-persistent-net.rules 
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key. 
# PCI device 0x8086:0x1521 (igb)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1e:67:38:9b:23", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
# PCI device 0x8086:0x1521 (igb)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1e:67:38:9b:22", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
# PCI device 0x8086:0x1521 (igb)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1e:67:38:9b:21", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x1521 (igb)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1e:67:38:9b:24", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"
# PCI device 0x14e4:0x168e (bnx2x)
#SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0a:f7:5c:7a:50", ATTR{type}=="1", KERNEL=="eth*", NAME="eth4"(这是旧网卡的信息)
# PCI device 0x14e4:0x168e (bnx2x)
#SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0a:f7:5c:7a:52", ATTR{type}=="1", KERNEL=="eth*", NAME="eth5"(这是旧网卡的信息)
# PCI device 0x8086:0x10fb (ixgbe)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="90:e2:ba:00:1d:b0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth4" (这是新网卡的信息,
把网卡名称换成旧网卡的名称)
# PCI device 0x8086:0x10fb (ixgbe)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="90:e2:ba:00:1d:b1", ATTR{type}=="1", KERNEL=="eth*", NAME="eth5" (这是新网卡的信息,
把网卡名称换成旧网卡的名称)
注意,网卡换过一次就会在这个文件中添加一条记录,这里我们把更换掉的网卡给注释掉了
复制代码

 

3.修改网卡的配置文件,把网卡的mac地址给注释掉了
[root@bj ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth4

复制代码
DEVICE=eth4
#HWADDR=00:0a:f7:5c:7a:50  把网卡的mac地址给注释掉了
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
BRIDGE=cloudbr0
#IPADDR=
#NETMASK=
#GATEWAY=
#DNS1=
#DNS2=
复制代码

 


4.重启服务器(查看网卡是亮灯就成功连接到交换机)可以通信

posted @   扛把子修BUG  阅读(1718)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 25岁的心里话
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 按钮权限的设计及实现
点击右上角即可分享
微信分享提示