Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

[SOLVED] Can't autoconnect to wired net using NetworkManager

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
8 posts • Page 1 of 1
Author
Message
sirlark
Guru
Guru
User avatar
Posts: 344
Joined: Mon Oct 25, 2004 11:41 am
Location: Limerick, Ireland

[SOLVED] Can't autoconnect to wired net using NetworkManager

  • Quote

Post by sirlark » Fri Nov 02, 2012 8:45 pm

Hi all,

I run a desktop machine at home as a day-to-day work machine, media server etc. It is connected to my ADSL router by an ethernet cable, and both router and PC are always on. Previously, I used /etc/conf.d/net to configure and bring up my wired network device automatically during boot. But recently I installed NetworkManager mainly because it's the only thing I've ever to get my particular USB 3G modem working in Linux, and also becasue it's make turning the VPN to my office network on and off easy. Since I installed NetworkManager though, when the machine boots, it has an empty /etc/resolv.conf, with a single comment line saying the non-existent contents were set by dhcpcd. The NetworkManager try applet believes I'm connected, and indeed I can ping the router, but obviously DNS doesn't work. Only when I disconnect and reconnect does NetworkManager populate /etc/resolv.conf and then everything works. Also, I get some error messages during boot relating to /etc/conf.d/net, listed below; The eth0 connection is available to all users, and NetworkManager is in the default runlevel, so to my understanding eth1 should come up automatically should start automatically

The error messages on boot

Code: Select all

/etc/init.d/../conf.d/net: line 7: default via 192.168.37.1: command not found
/etc/init.d/../conf.d/net: line 9: 192.168.37.2/24: No such file or directory
The file in question (/etc/conf.d/net)

Code: Select all

#Generated by NetworkManager
###### Global Configuration ######

###### Connection Configuration ######
#----------------------------------
dns_servers_eth1="192.168.0.2 208.67.222.222 208.67.220.220"
routes_eth1= "default via 192.168.0.2" 
auto_eth1="true"
config_eth1= "192.168.0.2/24" 
enable_ipv6_eth1="false"
#----------------------------------
dns_domain="MASKED"
#----------------------------------
module_eth="!plug"
It seems the spaces are causing the issue, but NetworkManager is creating the file, not me... Also why is dhcpcd trying to run on eth1 when I start and wiping my /etc/resolv.conf?
Last edited by sirlark on Fri Nov 09, 2012 10:42 am, edited 1 time in total.
Adopt an unanswered post today
Top
sirlark
Guru
Guru
User avatar
Posts: 344
Joined: Mon Oct 25, 2004 11:41 am
Location: Limerick, Ireland

  • Quote

Post by sirlark » Sat Nov 03, 2012 5:04 am

I've fixed the issues in my /etc/conf.d/net (it was the spaces). I also then modified the connection and saved it in the NetworkManager tray applet, and it doesn't modify the file... I don't know where those comments came from originally? Maybe a cut 'n paste? Anyway, the point is that the error messages at boot have disappeared, but the problem about dhcpcd running and clobbering the resolv.conf is still there.
Adopt an unanswered post today
Top
khayyam
Watchman
Watchman
User avatar
Posts: 6227
Joined: Thu Jun 07, 2012 2:45 am
Location: Room 101

  • Quote

Post by khayyam » Sat Nov 03, 2012 12:15 pm

sirlark wrote:the error messages at boot have disappeared, but the problem about dhcpcd running and clobbering the resolv.conf is still there.
sirlark ...

set dhcpcd not to request DNS, resolv.conf will then be untouched:

Code: Select all

modules_eth0="dhcpcd"
dhcp_eth0="nodns"
best ... khay
Top
sirlark
Guru
Guru
User avatar
Posts: 344
Joined: Mon Oct 25, 2004 11:41 am
Location: Limerick, Ireland

  • Quote

Post by sirlark » Sat Nov 03, 2012 3:49 pm

Thanks, just a quick question though... I notice you suggest disabling dchp on eth0, although eth0 isn't the issue. I've disabled dns on eth1, to no effect. Are you thinking that dhcp on eth0 is clobbering resolv.conf?
Adopt an unanswered post today
Top
khayyam
Watchman
Watchman
User avatar
Posts: 6227
Joined: Thu Jun 07, 2012 2:45 am
Location: Room 101

  • Quote

Post by khayyam » Sat Nov 03, 2012 4:52 pm

sirlark wrote:Thanks, just a quick question though... I notice you suggest disabling dchp on eth0, although eth0 isn't the issue. I've disabled dns on eth1, to no effect. Are you thinking that dhcp on eth0 is clobbering resolv.conf?
sirlark ... well, the above is just an example, I wasn't disabling dhcp but setting it so than no DNS is requested from the dhcp server.

Whatever interface is using dhcp then without "nodns" the resolv.conf will be effected, so if you want dhcp on both interfaces, but no DNS, then:

Code: Select all

modules="dhcpcd"
dhcp_eth0="nodns"
dhcp_eth1="nodns"
or similarly ... don't request NIS, NTP, DNS, don't send the hostname, and release the licence.

Code: Select all

dhcp_eth0="release nontp nonis nosendhost nodns"
best ... khay
Top
sirlark
Guru
Guru
User avatar
Posts: 344
Joined: Mon Oct 25, 2004 11:41 am
Location: Limerick, Ireland

  • Quote

Post by sirlark » Tue Nov 06, 2012 3:15 pm

Hi Khay,

I now have the following in /etc/conf.d/net, but still have the same problem.

Code: Select all

dns_servers_eth1="192.168.0.2 208.67.222.222 208.67.220.220"
routes_eth1="default via 192.168.0.1" 
auto_eth1="true"
config_eth1="192.168.0.2/24" 
enable_ipv6_eth1="false"
dns_domain="MASKED"
module_eth="!plug"
dhcp_eth1="nodns nontp nonis"
dhcp_eth0="nodns nontp nonis"
Also, I note that one of my boot messages is

Code: Select all

 * Starting DHCP Client Daemon ...                                        [ ok ]
So dhcp is still being initiated by the rc scripts somewhere, instead of from NetworkManager. Despite the prohibition of "nodns" my /etc/resolv.conf is still being clobbered.

Is there some current documentation for /etc/conf.d/net you could point me too?
Adopt an unanswered post today
Top
khayyam
Watchman
Watchman
User avatar
Posts: 6227
Joined: Thu Jun 07, 2012 2:45 am
Location: Room 101

  • Quote

Post by khayyam » Tue Nov 06, 2012 4:45 pm

sirlark wrote:I now have the following in /etc/conf.d/net, but still have the same problem.

Code: Select all

dns_servers_eth1="192.168.37.2 208.67.222.222 208.67.220.220"
routes_eth1="default via 192.168.37.1" 
auto_eth1="true"
config_eth1="192.168.37.2/24" 
enable_ipv6_eth1="false"
dns_domain="volundr.dyndns.org"
module_eth="!plug"
dhcp_eth1="nodns nontp nonis"
dhcp_eth0="nodns nontp nonis"
sirlark ... note that here eth1 is not configured via dhcp so the 'dhcp_eth1=' serves no purpose. Also, 'module_eth=' will likewise do nothing as 'eth' is not an interface. I'm not sure if this is a case of NetworkManager just not understanding the required constructs or if this is the result of subsequent manual edits, but the logic should follow the following: global, ie, 'modules=' (note 'modules' not 'module'), or per interface, ie, 'modules_${IFACE}, 'dhcp_${IFACE}, config_${IFACE}, etc.

I'm not sure what 'auto_eth1=true' is supposed to do, its not a construct I've seen documented ... but anyhow, probably the following is whats intended:

Code: Select all

modules_eth1="!plug iproute2"
config_eth1="192.168.37.2/24"
routes_eth1="default via 192.168.37.1"
dns_servers_eth1="192.168.37.2 208.67.222.222 208.67.220.220"
dns_domain_eth1="volundr.dyndns.org"
enable_ipv6_eth1="false"

modules_eth0="!plug dhcpcd"
config_eth0="dhcp"
dhcp_eth0="nodns nontp nonis"
enable_ipv6_eth0="false"
sirlark wrote:Also, I note that one of my boot messages is

Code: Select all

 * Starting DHCP Client Daemon ... [ ok ]

So dhcp is still being initiated by the rc scripts somewhere, instead of from NetworkManager.
If its not in the runlevel (that is, your sure you haven't added it) then something depends on 'net' and so starts dhcpcd, which would mean that NetworkManager isn't providing 'net'. I've given up supporting NetworkManager so that is something you will have to work out for your self, however dhcpcd can be configured *not* to provide 'net' by adding the following to /etc/rc.conf

Code: Select all

rc_dhcpcd_provide="!net"
sirlark wrote:Despite the prohibition of "nodns" my /etc/resolv.conf is still being clobbered.
In your above configuration /etc/resolve.conf will be written (as you define domain and nameservers) ... also, as 'dns_domain=' is global it'll be run for both interfaces, so your best to either omit this entirely (that is make resolv.conf static) or simply define it (as I have above) for one interface.
sirlark wrote:Is there some current documentation for /etc/conf.d/net you could point me too?
yes, /usr/share/doc/openrc-{version}/net.example.bz2

best ... khay
Top
sirlark
Guru
Guru
User avatar
Posts: 344
Joined: Mon Oct 25, 2004 11:41 am
Location: Limerick, Ireland

  • Quote

Post by sirlark » Fri Nov 09, 2012 10:41 am

Right, so it seems no amount of editing /etc/conf.d/net would prevent dhcpcd from being started at boot. The reason being dnsmasq and apache both require "net", and NetworkManager weirdly enough doesn't provide it.

So I added these two lines to my /etc/rc.conf

Code: Select all

rc_NetworkManager_provide="net"
rc_dhcpcd_provide="!net"
Leaving the 'rc_NetworkManager_provide="net"' line out just meant that apache, dnsmasq, etc just wouldn't start.
Adopt an unanswered post today
Top
Post Reply

8 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Authors
Gentoo is a trademark of the Gentoo Foundation, Inc. and of Förderverein Gentoo e.V.
The contents of this document, unless otherwise expressly stated, are licensed under the CC-BY-SA-4.0 license.
The Gentoo Name and Logo Usage Guidelines apply.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy