• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Can't setup network connections on CentOS 7

Im configuring a virtual machine with CentOS 7 installed, minimal installation. The thing is that I want to be able to comunicate with the virtual machine through SSH, for doing stuff from Windows, and copying files from host to guest, I dont need internet access in the centos system.
I configured as bridged the adapter in virtualbox, and static IP address in this file:
/etc/sysconfig/network-scripts/ifcfg-enp0s3

Here is the content of the file:
http://1drv.ms/1PcsU6y

Also, I uninstalled Network Manager as I read somewhere that is better to disable it while editing and using the ifcfg-enp0s3 file.

This is the output of "systemctl status network.service":
1- http://1drv.ms/1INHc0Q
2- http://1drv.ms/1INHftB

I dont know what else to do, I tried everything. I dont want to create another virtual machine, I've done a lot in this one. Also, the network connection was working when I last used it like three months ago. Now, magically it stopped working.
 
Your local IP shouldn't be a 200.x.x.x, it should probably be something in a local subnet. (192.x.x.x or 172.x.x.x or 10.x.x.x.) (Unless your system is connected directly to the internet... but that's a terrible idea!)

The output from systemctl indicates the MAC address of the VM has changed. You'll need to update the ifcfg- file with the new one. (HWADDR line.)

I'd also check with "ifconfig -a" to make sure that "enp0s3" is still the correct ID for your VM's NIC. (If the NIC MAC changed, chances are the UUID changed and it's not necessarily enp0 anymore.)

Also, your ifcfg file is... long. I'd trim it down to the basics. If you can use DHCP (VirtualBox NAT or bridged to your LAN) then for basic IPv4 connectivity, it just needs to be three lines:

DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes

https://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-networkscripts-interfaces.html

Even for IPv6, you can leave out the UUID and HWADDR lines and the PEER* stuff - unless you're actually running a DNS server...

KISS - Keep. It. Simple. Sven. (I'm from Minnesota. See also: Sven and Ole jokes.)
 
Last edited:
Your local IP shouldn't be a 200.x.x.x, it should probably be something in a local subnet. (192.x.x.x or 172.x.x.x or 10.x.x.x.) (Unless your system is connected directly to the internet... but that's a terrible idea!)

The output from systemctl indicates the MAC address of the VM has changed. You'll need to update the ifcfg- file with the new one. (HWADDR line.)

I'd also check with "ifconfig -a" to make sure that "enp0s3" is still the correct ID for your VM's NIC. (If the NIC MAC changed, chances are the UUID changed and it's not necessarily enp0 anymore.)

Also, your ifcfg file is... long. I'd trim it down to the basics. If you can use DHCP (VirtualBox NAT or bridged to your LAN) then for basic IPv4 connectivity, it just needs to be three lines:



https://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-networkscripts-interfaces.html

Even for IPv6, you can leave out the UUID and HWADDR lines and the PEER* stuff - unless you're actually running a DNS server...

KISS - Keep. It. Simple. Sven. (I'm from Minnesota. See also: Sven and Ole jokes.)

ifconfig command not found it tells me 🙁
I changed the MAC address in virtualbox because this machine is a clone of another machine, so I thought would be better to change it so I dont have two systems with same mac address. I updated with the new one in HWADDR.
Would it be possible to use static IP?, I dont want to use DHCP, I think that the IP of the system will change each time I power on the machine. Will be easier that way.
I will trim it down.
That guide you posted, is for CentOS 6.5 I think, I see things like eth0, whilst now in CentOS 7 they use enp0s3 for example.
 
Last edited:
I was curious since you were getting a missing ifconfig and thought it was another of Linux's GD missing packages or something (i.e. please run yum install random-ip-tool-name-here and then all necessary dependencies for half a day) but it's not as hairy; ifconfig has been deprecated in favor of just 'ip' so you can do as you would with ifconfig using ip.

edit- hehe, ifconfig is an optional package now:

I miss the ifconfig routine, it is not provided by default so I installed it.

yum install net-tools
 
Last edited:
I was curious since you were getting a missing ifconfig and thought it was another of Linux's GD missing packages or something (i.e. please run yum install random-ip-tool-name-here and then all necessary dependencies for half a day) but it's not as hairy; ifconfig has been deprecated in favor of just 'ip' so you can do as you would with ifconfig using ip.

edit- hehe, ifconfig is an optional package now:

Here is the ip addr output:
http://1drv.ms/1S1Wt0B
What can I do?
 
I think I did it. SSH connection with Putty works, and I was able to send files with PSCP to my virtual machine. I will start the machine tonight and see if it works again.
 
Back
Top