not able to find ifcfg-enp0s3 in /etc/sysconfig/network-scripts?

user2925298 picture user2925298 · May 1, 2016 · Viewed 7.5k times · Source

i want to change the IP Address of my centos7 vm which i have created in virtual box. im able to see the nic cards if i do "ifcfg". but when i go to the path /etc/sysconfig/network-scripts the nic cards are not available. can anyone help me how to change the ip in centos7. i even tried with command "setup"

nic cards

list in network-scripts

Setup command

Answer

Ali Yousefi Sabzevar picture Ali Yousefi Sabzevar · May 1, 2016

Create ifcfg-enp0s3 and ifcfg-enp0s8 files manually. The samples are /usr/share/doc/initscripts-*/examples/networking/. However if you use static IP address, essential items are here:

TYPE=Ethernet
BOOTPROTO=none
NAME=enp0s3
DEVICE=enp0s3
ONBOOT=yes
IPADDR=192.168.100.3
NETMASK=255.255.255.0

Or if you prefer to use DHCP :

TYPE=Ethernet
BOOTPROTO=dhcp
NAME=enp0s3
DEVICE=enp0s3
ONBOOT=yes