在 CentOS 里,“mount 网卡”这个说法并不准确,因为网卡(network interface)不是块设备,不能用 mount 命令挂载。你可能是想实现以下几种常见需求之一:
CentOS 中“让网卡生效”通常叫 启用网卡,不是 mount。
# 查看网卡
ip addr
# 启用网卡(例如 eth0)
nmcli device connect eth0
# 或
ifup eth0
nmcli connection modify eth0 connection.autoconnect yes
或编辑配置文件:
vi /etc/sysconfig/network-scripts/ifcfg-eth0
确保有:
ONBOOT=yes
nmcli connection modify eth0 \
ipv4.method manual \
ipv4.addresses 192.168.1.100/24 \
ipv4.gateway 192.168.1.1 \
ipv4.dns 8.8.8.8
应用配置:
nmcli connection up eth0
如果你是想 “把多张网卡绑在一起”:
nmcli connection add type bond ifname bond0 bond.options "mode=active-backup"
nmcli connection add type bond-slave ifname eth0 master bond0
nmcli connection add type bond-slave ifname eth1 master bond0
如果你是想 “挂载到 bridge”:
nmcli connection add type bridge ifname br0
nmcli connection modify eth0 master br0
如果你其实是想 通过网络访问磁盘,那才用 mount:
mount -t nfs 192.168.1.10:/data /mnt
iscsiadm -m discovery -t sendtargets -p 192.168.1.10
iscsiadm -m node --login
mount /dev/sdb1 /mnt
✅ 网卡不能 mount
✅ 网卡用的是:
ifup / ifdownnmcli/etc/sysconfig/network-scripts/如果你能具体说一下:
我可以给你 精确命令。