LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-01-2018, 04:32 PM   #1
holpot
LQ Newbie
 
Registered: Jan 2017
Posts: 4

Rep: Reputation: Disabled
nameserver not being picked up from ifcfg-em1, then em1 fails to connect when restart network


Hi, I hope someone can help, I've been at this for hours. I'm using RHEL6.9, and this machine has been so well behaved until a power outage last night.

It boots fine but I find a couple of weird things. A nameserver does not appear in /etc/resolv.conf, despite DNS1 being set in ifcfg-em1. Possibly unrelated but another new problem is that users (but not root) do not have XAUTHORITY set and cannot use xwindows (Error = No protocol specified. Display :0:0: unavailable"). Ypbind seems to be working fine.

I can ping external IP addresses, but it wont resolve names. I open resolv.conf and insert the nameserver line (double checked to match the other clients), then I do

service network restart

and I get
...
'Bringing up interface em1: Error: Connection Activation failed. [FAIL]
'Bringing up interface em12: Error: Connection Activation failed. [FAIL]

Everything then stops responding and it completely freezes.

Apparently there are no network problems that could cause this. And all our other machines are fine.

Thanks in advance.
 
Old 03-03-2018, 09:23 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
em12? em = "embedded". Do you really have 12 NICs built into your motherboard?

I suspect you have saved ifcfg-* (specifically em12 as a copy of em1) files in /etc/sysconfig/network-scripts. It is important to note that on start of networking ALL ifcfg-* files are processed even the copies you save that start with that naming. Therefore if you want to (and should) save a copy before changing a file you should prepend something to it rather than doing an append like you normally would for other files. e.g.
DO cp -p ifcfg-em1 orig-ifcfg-em1
NOT cp -p ifcfg-em1 ifcfg-em1.orig
Before going further make sure you don't have multiple ifcfg-em* files all referring to the same name.

By default RHEL6/CentOS6 use "NetworkManager" though a lot of people disabled that in favor of the older networking stack.
Run "chkconfig --list NetworkManager" to see if it is set to "on" for run levels. If so you're using NetworkManager on boot.

NetworkManager reads DNS entries out of the ifcfg-* files to create /etc/resolv.conf. If it did that there should be text in resolv.conf showing it was created by NetworkManager. It is important you only put the DNS entries in ONE ifcfg-* file because otherwise the next one might override what the first one did.

You can prevent NetworkManager from updating /etc/resolv.conf by making sure you've commented out or removed all DNS servers from the ifcfg-* files then simply create your resolv.conf with your favorite editor.

Basic options in resolv.conf:
Code:
search <domain1> <domain2>
<dns server 1>
<dns server 2>
You can add more or less search domains and/or DNS servers. There are other options available as well. "man resolv.conf" will give full details.

The "search" isn't required and just tells it to try appending the domains you list to any short name until it gets a match. e.g. if you had "search ralph.com billybob.com" then did ran a lookup command like "host", "dig" or "nslookup" for the short name "myserver" it would first try to see if myserver.ralph.com existed then if not would try to see if myserver.billybob.com existed. If not it would fail. Note that it stops on first match. You can of course always use fully qualified domain name (FQDN) in searches so doing a lookup for myserver.vickysue.com is valid even though you didn't specify vickysue.com in "search" option. However lookup of shortname "myserver" would fail if it only existed in domain vickysue.com.

Note: In NetworkManager the way it processes secondary IPs on a NIC changed. Previously you could create a file called "ifcfg-em1:1" to do that but in NetWorkManager it expects the secondary IP on same NIC to be in ifcfg-em1 itself along with the primary IP.
 
1 members found this post helpful.
Old 03-03-2018, 09:38 AM   #3
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Excellent explanation, MensaWater! Thank you very much.
Especially the bit about naming of ifcfg files. I learned that the hard way recently when the data center moved my server. I had configured the ifcfg files when I upgraded to a centos 7 (from centos 5) server, but backed up the ifcfg temporary file as ifcfg-eth0.bak. We had to power down for the move, and when the server restarted, it had the "temporary" IP address instead of the correct IP...took us a few minutes to figure out what happened. Fortunately, the data center tech knew what to look for.

I also appreciate the explanation of how the DNS servers get into /etc/resolv.conf...that bit of "magic" was bothering me 'cause I didn't understand.

I continue to learn about the many differences between RHEL/CentOS 7 and RHEL/CentOS 5...
 
Old 03-03-2018, 11:45 AM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Quote:
Originally Posted by scasey View Post
I continue to learn about the many differences between RHEL/CentOS 7 and RHEL/CentOS 5...
Glad I could help. I'm confused by that comment though. Your first post said 6.9 not 7. 7 also uses NetworkManager but it is quite different overall because it uses a 3.x kernel unlike the 2.6.x 5 & 6 used. It also uses systemd rather than init and firewalld is a front end for setup for iptables.
 
Old 03-03-2018, 12:41 PM   #5
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by MensaWater View Post
Glad I could help. I'm confused by that comment though. Your first post said 6.9 not 7. 7 also uses NetworkManager but it is quite different overall because it uses a 3.x kernel unlike the 2.6.x 5 & 6 used. It also uses systemd rather than init and firewalld is a front end for setup for iptables.
Oh, sorry. I'm not the OP...didn't mean to confuse you. We've not heard back from the OP yet.
 
Old 03-03-2018, 01:34 PM   #6
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Quote:
Originally Posted by scasey View Post
Oh, sorry. I'm not the OP...didn't mean to confuse you. We've not heard back from the OP yet.
It's OK - I should have checked to see if you were the OP.
 
  


Reply

Tags
nameserver, network



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Red Hat 7 on Dell server. Can't get p2p1 and em1 to be connected to different subnets at the same time. matthewst Linux - Networking 2 04-22-2016 02:28 PM
[SOLVED] need help writing script for eth0 or em1 devices rootaccess Linux - General 6 01-06-2013 08:10 AM
[SOLVED] [Fedora 15] em1 has disappeared after system update Flang3r Linux - Newbie 5 10-27-2011 07:48 AM
Fedora 13 Network Interface fails to connect after starting network manager crazy eddy Linux - Networking 2 06-15-2010 09:47 AM
Network restart fails with NIC BCM5706 using bnx2 driver linux@rossillo.net Linux - Networking 2 08-15-2007 01:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration