LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   network.service (https://www.linuxquestions.org/questions/linux-newbie-8/network-service-4175616700/)

nordsense 10-31-2017 03:14 AM

network.service
 
Hello and thank you for viewing my thread. I don't now what I'm doing.

I have installed CentOS 7.4.1708 onto my VPS, updated to the latest kernel and attempted to install WHM/cPanel. During the installation I received a colorful red message that said

cPanel does not support NetworkManager enabled
systems. The installation cannot proceed.
Please consult your system documentation to
remove NetworkManager, replacing it with the network.service


I then removed NetworkManager and attempted to
Code:

systemctl start network.service
I got a message saying "Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details."

After entering systemctl status network.service I got this output

Code:

● network.service - LSB: Bring up/down networking
  Loaded: loaded (/etc/rc.d/init.d/network; bad; vendor preset: disabled)
  Active: failed (Result: exit-code) since Mon 2017-10-30 23:30:43 EDT; 20min ago
    Docs: man:systemd-sysv-generator(8)
  Process: 7765 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)

I have googled here and there and found some solutions. Creating a ifcfg-enp0s3 file in /etc/sysconfig/network-scripts directory is one solution. Is this a viable idea? I am also wondering how I can still connect to my vps if I uninstalled the program that was managing my connections (NetworkManager).

If you do not know the solution to this problem but have a good resource for understanding CentOS networking better please feel free to post that too.


Thanks

ferrari 10-31-2017 03:59 AM

You could configure a network interface config file (/etc/sysconfig/network-scripts/ifcfg-***) by hand as explained here
https://wiki.centos.org/FAQ/CentOS7#...b1ff9954bec881

This CentOS 6 guide should still be relevant for manual network configuration as well...
http://www.serverlab.ca/tutorials/li...work-settings/

ferrari 10-31-2017 04:04 AM

BTW, make sure that network.service is enabled as well, so that it is active at boot
Code:

systemctl enable network.service
Explicit cPanel doucumentation on the steps required for network configuration...
https://documentation.cpanel.net/dis...etwork+Manager

nordsense 10-31-2017 05:00 AM

Quote:

Originally Posted by ferrari (Post 5775523)
BTW, make sure that network.service is enabled as well, so that it is active at boot
Code:

systemctl enable network.service
Explicit cPanel doucumentation on the steps required for network configuration...
https://documentation.cpanel.net/dis...etwork+Manager


Thank you the cPanel documentation did it even though I do not know what it was I was doing. Editing the ifcfg-eth0 and ifcfg-eth0:0 THEN enabling AND starting (What's the difference?) network.services seemed to do fix the problem of:

network.service - LSB: Bring up/down networking
Loaded: loaded (/etc/rc.d/init.d/network; bad; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2017-10-30 23:30:43 EDT; 20min ago
Docs: man:systemd-sysv-generator(8)
Process: 7765 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)

But now I can no longer SSH to my server. Was I suppose to configure a network interface file before I stopped networkmanager and switched over to network.service? The cPanel directions did not state that. There is one thing I did notice my ifcfg-eth0 and ifcfg-eth0:0 files did not contain a NM_CONTROLLED value that was according to the cPanel instructions suppose to be set to no "NM_CONTROLLED=no". So I added this to both eth0, eth0:0, and ifcfg-lo.

So I turned off network manager, edited the configuration files according to that documentation then enabled and started network.service but that left me unable to ssh to my server (currently vnc). Any ideas? Would configure a network interface file do anything?


Thanks

ferrari 10-31-2017 08:31 PM

Have you checked to see if there is an SSH server listening on port 22 (or whatever you configured it on)? Are you trying to reach it by a particular IP address, and is it still the same?

Code:

ip address

ferrari 10-31-2017 08:41 PM

Simply starting a .service unit won't create the symlinks to get the unit started at boot.

From the systemctl man page
Quote:

enable NAME...
Enable one or more unit files or unit file instances, as specified on the command
line. This will create a number of symlinks as encoded in the "[Install]" sections of
the unit files. After the symlinks have been created, the systemd configuration is
reloaded (in a way that is equivalent to daemon-reload) to ensure the changes are
taken into account immediately. Note that this does not have the effect of also
starting any of the units being enabled. If this is desired, either --now should be
used together with this command, or an additional start command must be invoked for
the unit. Also note that, in case of instance enablement, symlinks named the same as
instances are created in the install location, however they all point to the same
template unit file.

nordsense 10-31-2017 10:23 PM

1 Attachment(s)
Quote:

Originally Posted by ferrari (Post 5775769)
Have you checked to see if there is an SSH server listening on port 22 (or whatever you configured it on)? Are you trying to reach it by a particular IP address, and is it still the same?

Code:

ip address

I have checked the sshd file and nothing has changed there and it is "allowed" through SELlinux. I have been searching the internet to try to find a command to check if the ssh port is open in iptables but can not find out how to do this. I thought I had CSF installed but I guess not. When I type in IP address I get the output of the attached picture. I am still trying to ssh to the same IP address and from the same IP address.

ferrari 10-31-2017 10:55 PM

Your config files (ifcfg-eth0 and ifcfg-eth0:0) don't match the network device node name present (ens3)!

nordsense 10-31-2017 11:07 PM

Quote:

Originally Posted by ferrari (Post 5775793)
Your config files (ifcfg-eth0 and ifcfg-eth0:0) don't match the network device node name present (ens3)!

So to fix this I would have to change the name of the configuration files (ifcfg-eth0 ifcfg-eth0:0) to match the device node name? If this is correct where do I find the device node name and when I find it do I simply change the name of ifcfg-eth0 file and ifcfg-eth0 file to the name of this device node or do more changes have to be made in the configuration file itself?

ferrari 10-31-2017 11:22 PM

The network device node name(s) can be got via ifconfig...
Code:

/sbin/ifconfig -a
although that command has been deprecated in favour of the ip command eg
Code:

ip link
Code:

ip address

ferrari 10-31-2017 11:23 PM

If the relevant interface is ens0, then the matching configuration file naming would be ifcfg-ens0

nordsense 10-31-2017 11:34 PM

So I have to change:

ifcfg-eth0 to ifcfg-lo

and

ifcfg-eth0:0 to ifcfg-ens3 ???

nordsense 11-01-2017 12:02 AM

I changed ifcfg-eth0 to ifcfg-ens3 but am still not able to SSH

ferrari 11-01-2017 12:18 AM

Quote:

So I have to change:

ifcfg-eth0 to ifcfg-lo

and

ifcfg-eth0:0 to ifcfg-ens3 ???
No!

Show the output of
Code:

ip a

nordsense 11-01-2017 01:19 AM

1 Attachment(s)
This is the output of ip a


All times are GMT -5. The time now is 07:28 PM.