2

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

user2925298
  • 79
  • 1
  • 2
  • 9

1 Answers1

3

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
IAmAliYousefi
  • 1,132
  • 3
  • 21
  • 33
  • This seems like the closes answer I have found but still short of what to do next. Should I create both files or 1? All I want is to have the `ifcfg-eth0` which used to work simple by editing ONBOOT to 'yes'. Now I can't find this file. I did what you asked but still have no internet connection – samayo Dec 20 '16 at 19:23