vmware虚拟机添加新网卡后,/etc/sysconfig/network-scripts/下无配置文件ifcfg-xxxx

 

https://www.cnblogs.com/su-han/p/5485343.html

centos8

# cat ifcfg-ens37
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="dhcp"
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="ens37"		#修改
#UUID="d1dfb5eb-1967-4f2d-87c7-2023ece60696"	##注释掉
DEVICE="ens37"	#修改
ONBOOT="yes"

 

pts]# cat ifcfg-ens37
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
#BOOTPROTO="dhcp"
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="ens37"
#UUID="d1dfb5eb-1967-4f2d-87c7-2023ece60696"
DEVICE="ens37"
IPADDR=192.168.1.200
NETMASK=255.255.255.0
#GATEWAY=192.168.1.1
ONBOOT="yes"
[root@localhost network-scripts]# 

重启网络执行

nmcli networking off && nmcli networking on 
ifdown ens37 && ifup ens37 
nmcli con down ens37 && nmcli con up ens37 

 

#cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth1
#vim /etc/sysconfig/network-scripts/ifcfg-eth1
HWADDR=00:0C:29:17:29:66  #修改为eth1的mac地址
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=no
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=eth1                         #修改为eth1
#UUID=93285a79-5ad6-4d55-ae5a-b417ce7f4d31 #注释掉
ONBOOT=yes
#service network restart

 

 

你可能感兴趣的:(linux)