You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

VMware中CentOS 6.9新增网卡无ifcfg-ethx文件问题咨询

回答你的CentOS 6.9网卡配置问题

Hey there, let's tackle your questions about the missing network config files and NIC bonding in CentOS 6.9 on VMware.

为什么添加新网卡后没有自动生成ifcfg-ethx配置文件?

There are a few common reasons this happens:

  • Network服务未自动触发配置生成: CentOS 6's network daemon doesn't automatically create ifcfg-* files for newly added network interfaces by default. Unlike newer RHEL/CentOS versions, it requires manual intervention or explicit detection triggers.
  • udev规则未更新: The 70-persistent-net.rules file (located at /etc/udev/rules.d/) maps MAC addresses to interface names. If your new VMware NIC's MAC isn't listed here, the system might not assign it an ethx name, or fail to generate a config. You can check this file with cat /etc/udev/rules.d/70-persistent-net.rules to see if the new NIC's MAC is present.
  • VMware硬件未被识别: Sometimes hot-adding a NIC in VMware doesn't trigger the OS to detect the new hardware immediately. You might need to reboot the VM, or reload the network module with modprobe e1000 (or the appropriate module for your VM's NIC type, like vmxnet3).
  • SELinux限制: If SELinux is in enforcing mode, it could block the automatic creation of config files. You can test this temporarily with setenforce 0, then check if the file appears. If it does, you'll need to restore the SELinux context with restorecon -R /etc/sysconfig/network-scripts/ instead of leaving SELinux disabled.

网卡绑定是否需要手动创建ifcfg-ethx文件?

Absolutely. For NIC bonding (teaming) in CentOS 6.9, you must manually create all required configuration files, including both the bond master interface and the slave NICs. Here's a quick breakdown of the steps:

  1. Create the bond master config file (e.g., ifcfg-bond0):

    vi /etc/sysconfig/network-scripts/ifcfg-bond0
    

    Add this content (adjust IP settings to match your network):

    DEVICE=bond0
    TYPE=Bond
    BONDING_MASTER=yes
    IPADDR=192.168.1.100
    NETMASK=255.255.255.0
    GATEWAY=192.168.1.1
    DNS1=8.8.8.8
    ONBOOT=yes
    BOOTPROTO=static
    BONDING_OPTS="mode=1 miimon=100"  # mode=1 is active-backup; adjust as needed
    
  2. Create config files for each slave NIC:
    For each NIC you want to add to the bond (e.g., eth1 and eth2), create their ifcfg-* files:

    vi /etc/sysconfig/network-scripts/ifcfg-eth1
    

    Add this content:

    DEVICE=eth1
    TYPE=Ethernet
    ONBOOT=yes
    BOOTPROTO=none
    MASTER=bond0
    SLAVE=yes
    

    Repeat this for your second slave NIC (e.g., ifcfg-eth2).

  3. Load the bonding module:
    Load it immediately with:

    modprobe bonding
    

    To make it persist across reboots, add a line to /etc/modules-load.d/bonding.conf (create the file if it doesn't exist):

    bonding
    
  4. Restart the network service:

    service network restart
    

You can verify the bond is working with cat /proc/net/bonding/bond0, which will show the status of the slave interfaces and bonding mode.

内容的提问来源于stack exchange,提问作者pasha ahmed

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 09:27:46