VM克隆centos7后ip设置
内容纲要
获取mac地址
ip addr
配置70-persistent-ipoib.rules 文件
vim /etc/udev/rules.d/70-persistent-ipoib.rules
# 配置内容
ACTION=="add", SUBSYSTEM=="net", DRIVERS=="?*", ATTR{type}=="32", ATTR{address}=="mac地址", NAME="mlx4_ib3"
配置ifcfg-ens33
vim /etc/sysconfig/network-scripts/ifcfg-ens33
# 配置内容
BOOTPROTO="static"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="ens33"
UUID="27424c8f-44c9-4df1-a636-1a64f3f94794"
DEVICE="ens33"
ONBOOT="yes"
IPADDR=ip
GATEWAY=网关
DNS1=dns服务器
NETMASK=子网掩码
HWADDR="mac地址"
重启网络服务
service network restart
若失败则输入一下命令
systemctl stop NetworkManager
systemctl disable NetworkManager
systemctl start network.service
共有 0 条评论