假设我们要修改网卡名为mybridge
实现步骤如下
1、# vim /etc/modprobe.conf
找到alias eth0 vmxnet
将eth0改为你想要的网卡名称
例:
alias mybridge vmxnet
2、修改配置文件
# mv /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-mybridge
# vim /etc/sysconfig/network-scripts/ifcfg-mybridge
修改
DEVICE=eth0
为
DEVICE=mybridge
3、去除内存中的网卡模块
modprobe -r vmxnet
4、重新加载网卡模块
modprobe mybridge(等同于modprobe vmxnet)
5、重启网络服务
# service network restart
我的效果:
mybridge Link encap:Ethernet HWaddr 00:0C:29:A0:95:18
inet addr:192.168.1.196 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fea0:9518/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:23536 errors:0 dropped:0 overruns:0 frame:0
TX packets:12993 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:27554530 (26.2 MiB) TX bytes:1363088 (1.2 MiB)
Interrupt:67 Base address:0x2024