最新消息:建议使用非IE内核浏览本站博客,以便得到更好体验。比如360极速浏览器火狐等浏览器。

CentOS添加网卡

命令代码 李展滢 1876浏览 0评论

在CentOS6下,添加网卡之后,先去查看网卡的mac地址。

cat /sys/class/net/eth1/address

接下来编辑/etc/udev/rules.d/70-persistent-net.rules(应该会自动生成),加上一行eth1相关的信息。

# 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 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:32:9c:6b", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:32:9c:75", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

最后新建/etc/sysconfig/network-scripts/ifcfg-eth1,(如果自动有了就无需新建)并输入以下代码,

DEVICE=eth1
IPADDR=IP地址
NETMASK=子网掩码
GATEWAY=网关
ONBOOT=yes

最后重启网络或者重启服务器即可。

转载请注明:宿居博客 » CentOS添加网卡

您必须 登录 才能发表评论!