LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Centos 7: failed to bring up/down networking: configure interface for a trunk interfa (https://www.linuxquestions.org/questions/linux-newbie-8/centos-7-failed-to-bring-up-down-networking-configure-interface-for-a-trunk-interfa-4175550117/)

nskalis 08-07-2015 05:54 AM

Centos 7: failed to bring up/down networking: configure interface for a trunk interfa
 
hi guys,

The switch configured on the server (Centos 7) is configured as trunk for VLAN#115,2014. I have loaded

Code:

# lsmod | grep 8021q
# modprobe 8021q

I would like to configure an IP address on the server using the VLAN#115 Performing the following configuration:

ifcfg-em1
Code:

TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
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=em1
UUID=c0c4d851-d762-4301-8c20-d6128aee5261
DEVICE=em1
ONBOOT=yes

ifcfg-em1.115
Code:

TYPE=Ethernet
BOOTPROTO=none
IPADDR=172.31.141.242
PREFIX=24
GATEWAY=172.31.141.1
DEFROUTE=yes
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=em1.115
UUID=c0c4d851-d762-4301-8c20-d6128aee5261
DEVICE=em1.115
VLAN=yes
ONBOOT=yes

I ended up being not able to restart the network service. The error message appearing is :

Code:

Failed to start LSB: Bring up/down networking.
Could you please advise ? What am doing wrong ?

jpollard 08-08-2015 07:17 AM

I think you need "BOOTPROTO=none" to be changed to "BOOTPROTO=static" for ifcfg-em1.115

I know "none" used to work for static IP numbers, but that use was being changed to "static" in CenOS 6 though both worked. I believe there is a plan to be able to add other methods in the future, and using static makes it clear what is being done.

I'm not sure about whether the base interface can remain uninitialized (never tried that). If it doesn't start (and since there is no IP numbers there, it can't be initialized), you might try "onboot=no" for ifcfg-em1.

nskalis 08-08-2015 07:56 AM

thanks jpollard. your comment made sense. i just tried. but with no luck.
with ONBOOT=yes "journalctl -xn" says "Unit network.service has failed."
with ONBOOT=no "journalctl -xn" says "(warn) Activation failed for connection em1"

nskalis 08-08-2015 08:02 AM

the following did the trick:

Code:

systemctl stop NetworkManager
systemctl disable NetworkManager


jpollard 08-08-2015 08:22 AM

Quote:

Originally Posted by nskalis (Post 5402864)
the following did the trick:

Code:

systemctl stop NetworkManager
systemctl disable NetworkManager


That by itself would not work... without NetworkManager (or networks) you don't have a network being initialized.

enabling networks in addition would allow it to work.

moleski 09-24-2017 09:49 AM

Quote:

Originally Posted by jpollard (Post 5402870)
That by itself would not work... without NetworkManager (or networks) you don't have a network being initialized.

enabling networks in addition would allow it to work.

This thread and this final post, although old, were helpful to me this week.

After a yum update all, I had centos-release-7-4.1708.el7.centos.x86_64 and kernel-3.10.0-693.2.2.el7.x86_64.

Network.services failed to load during boot: "Failed to start LSB: Bring up/down networking."

The reason for that failure was that "Determining IP information for eth0... failed."

And the reason that IP information for eth0 failed was that something mangled the addresses for my server, gateway, and DNS servers in /etc/sysconfig/network-scripts/ifcfg-eth0. The definition of BOOTPROTO was changed from "static" to "dhcp", and all of the IP addresses were stripped out of ifcfg-eth0.

In my case, I chose to work with NetworkManager rather than network.services (or a combination of both).

I disabled cloud-init, which kept rewriting /etc/sysconfig/network-scripts/ifcfg-eth0 on each boot by creating /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with this single line in it:

network: {config: disabled}

Because I turned off network.services, I set "NM_CONTROLLED=yes" for both ifcfg-eth0 and ifcfg-eth1.

The Apache daemon still failed to start. It seemed to be a timing issue during the boot process. I created /etc/NetworkManager/dispatcher.d/22-httpd as shown below. The system calls it when NetworkManager thinks it is open for business.

Code:

#!/bin/sh
# This is a NetworkManager dispatcher script to turn http on
# when the network is ready.  MXM
# /etc/NetworkManager/dispatcher.d/22-httpd
# https://wiki.archlinux.org/index.php/NetworkManager#Network_services_with_NetworkManager_dispatcher

if [ "$2" = "up" ]; then
        systemctl start httpd
fi

if [ "$2" = "down" ]; then
        systemctl stop httpd
fi

exit 0



All times are GMT -5. The time now is 08:53 PM.