I have selected in YAST > Network settings > tab global options under Network Setup Method “Wicked Service”. Under the tab Hostname/DNS in the field ‘Modify DNS Configurations’ I have selected “Use Custom Policy” and in the field ‘Custom Policy Rule’ I have entered “Static”. In the Field “Name Servers and Domain Search List” I have entered the servers from OpenDNS and the file /etc/resolv.comf looks like this:
cat /etc/resolv.conf
# IPv4 name servers OpenDNS:
nameserver 208.67.222.222
nameserver 208.67.220.220
# IPv6 name servers OpenDNS:
nameserver 2620:0:ccc::2
nameserver 2620:0:ccd::2
However after some time the settings go back to the router address which forwards the request to the DNS server of my ISP. I normally notice this when I enter a new url and it takes very long for the webpage to come up. I expect that the request to change the DNS settings comes from the router and I have to find out where this setting is. Nevertheles I have two questions:
If I set the computer to have the static settings - why does it allow the settings to be changed?
If the setting for the network configuration is set to wicked why is network manager changing the settings?
Any clarification here would be appreciated.
Cheers
Uli
Thanks, gogalthorp, I did set it in YAST and edited the file /etc/resolv.conf using the vi editor. Nothing was set using NetworkManager. I even tried to disable the 3 items with NetworkManager which were enabled in systemctl since I thought using wicked I would not need the NetworkManager. But after a restart I had no internet connection so a enabled NetworkManager those 3 NetworkManager items again. Here are the enabled networking services:
You don’t run both concurrently. You should either have wicked.service enabled or NetworkManager.service enabled. BTW, if you make a manual change to /etc/resolv.conf, NetworkManager will not modify it.
Secondly - the problem I have is that several times I have manually changed /etc/resolv.conf and at some stage it was changed again with router’s IP address like this:
uli@linux-tl1r:~> cat /etc/resolv.conf
# Generated by NetworkManager
search fritz.box site
nameserver 192.168.2.1
This has happened on my other computers as well - hence this thread. I can understand that it happened with my Tumbleweed computer - may be an update caused it to recreate the file, but it happens at the leap 42.1 computers as well.
Cheers
Uli
Thank you, gogalthorp and deano-ferrari.
Firstly I have disabled NetworkManager (this was on my Tumbleweed computer) and after a reboot the network was down even though wicked was enabled. Hence the question and this was the reason I don’t want to disable NetworkManager again without knowing why I seem to need both. All my computers are set to use wicked and yes - this setting was made in YAST. Still I am not closer to solving my problem. Yesterday I changed the file /etc/resolv.conf to those settings from the first post. THe YAST settings are listed there as well (Use Custom Policy and Static). Today the file /etc/resolv.conf looks again like this:
uli@linux-tl1r:~> cat /etc/resolv.conf
# Generated by NetworkManager
search fritz.box site
nameserver 192.168.2.1
nameserver fd00::ca0e:14ff:fe12:ea9d
uli@linux-tl1r:~>
What do I need to do to change make sure the DNS settings in /etc/resolv.conf are kept and that the network connection is up at reboot?
Cheers
Uli
If you want to assign name servers via direct editing of /etc/resolv.conf and not have netconfig overwrite it then you need to use ‘Only Manually’ for the YaST DNS policy.
If you do have NetworkManager.service active it could cause problems here and overwrite resolv.conf. Your real issue is to figure out why wicked is not bringing up the desired connection at boot. You should show us the working ifcfg-* configuration you have as well as
ip add
route -n
cat /etc/resolv.conf
wicked show all
otherwise we’re left to speculate. Also, what does the journal log say about what is happening?
deano_ferrari, I was wrong. Since the network connection did not run on the other computer with network manager disabled I presumed it would not run here also:
linux-tl1r:~ # systemctl stop NetworkManager
linux-tl1r:~ # systemctl disable NetworkManager
rm '/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service'
rm '/etc/systemd/system/multi-user.target.wants/NetworkManager-dispatcher.service'
rm '/etc/systemd/system/multi-user.target.wants/NetworkManager.service'
linux-tl1r:~ # rcnetwork restart
linux-tl1r:~ # rcnetwork status
wicked.service - wicked managed network interfaces
Loaded: loaded (/usr/lib/systemd/system/wicked.service; enabled)
Active: active (exited) since Sat 2016-11-12 11:12:46 NZDT; 5s ago
Process: 4610 ExecStop=/usr/sbin/wicked --systemd ifdown all (code=exited, status=0/SUCCESS)
Process: 4855 ExecStart=/usr/sbin/wicked --systemd ifup all (code=exited, status=0/SUCCESS)
Main PID: 4855 (code=exited, status=0/SUCCESS)
Nov 12 11:12:46 linux-tl1r.site wicked[4855]: lo up
Nov 12 11:12:46 linux-tl1r.site wicked[4855]: eth0 up
Nov 12 11:12:46 linux-tl1r.site wicked[4855]: wlan0 device-not-running
Nov 12 11:12:46 linux-tl1r.site systemd[1]: Started wicked managed network interfaces.
linux-tl1r:~ # ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 48:5b:39:76:80:2d brd ff:ff:ff:ff:ff:ff
inet 192.168.2.28/24 brd 192.168.2.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::4a5b:39ff:fe76:802d/64 scope link
valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default qlen 1000
link/ether 1c:4b:d6:d2:ed:fd brd ff:ff:ff:ff:ff:ff
linux-tl1r:~ # systemctl list-unit-files --state=enabled | grep 'NetworkManager\|wicked'
NetworkManager-wait-online.service enabled
wicked.service enabled
wickedd-auto4.service enabled
wickedd-dhcp4.service enabled
wickedd-dhcp6.service enabled
wickedd-nanny.service enabled
wickedd.service enabled
linux-tl1r:~ #
May be this was because I have disabled all NetworkManager services and here we still have NetworkManager-wait-online.service enabled?
Nevertheless here are some of the commands you asked. For journalctl -u wicked i pasted only since this mornings reboot:
-- Reboot --
Nov 12 09:55:59 linux-tl1r systemd[1]: Starting wicked managed network interfaces...
Nov 12 09:56:29 linux-tl1r.site wicked[913]: lo up
Nov 12 09:56:29 linux-tl1r.site wicked[913]: eth0 up
Nov 12 09:56:29 linux-tl1r.site wicked[913]: wlan0 setup-in-progress
Nov 12 09:56:29 linux-tl1r.site systemd[1]: Started wicked managed network interfaces.
Nov 12 10:34:52 linux-tl1r.site systemd[1]: Stopping wicked managed network interfaces...
Nov 12 10:34:53 linux-tl1r.site wicked[3591]: eth0 device-ready
Nov 12 10:34:53 linux-tl1r.site wicked[3591]: wlan0 device-ready
Nov 12 10:34:53 linux-tl1r.site systemd[1]: Starting wicked managed network interfaces...
Nov 12 10:35:23 linux-tl1r.site wicked[3711]: lo up
Nov 12 10:35:23 linux-tl1r.site wicked[3711]: eth0 up
Nov 12 10:35:23 linux-tl1r.site wicked[3711]: wlan0 setup-in-progress
Nov 12 10:35:23 linux-tl1r.site systemd[1]: Started wicked managed network interfaces.
Nov 12 11:12:36 linux-tl1r.site systemd[1]: Stopping wicked managed network interfaces...
Nov 12 11:12:37 linux-tl1r.site wicked[4610]: eth0 device-ready
Nov 12 11:12:37 linux-tl1r.site wicked[4610]: wlan0 device-ready
Nov 12 11:12:37 linux-tl1r.site systemd[1]: Starting wicked managed network interfaces...
Nov 12 11:12:46 linux-tl1r.site wicked[4855]: lo up
Nov 12 11:12:46 linux-tl1r.site wicked[4855]: eth0 up
Nov 12 11:12:46 linux-tl1r.site wicked[4855]: wlan0 device-not-running
Nov 12 11:12:46 linux-tl1r.site systemd[1]: Started wicked managed network interfaces.
linux-tl1r:~ # wicked show all
lo up
link: #1, state up
type: loopback
config: compat:suse:/etc/sysconfig/network/ifcfg-lo
leases: ipv4 static granted
leases: ipv6 static granted
addr: ipv4 127.0.0.1/8 [static]
addr: ipv6 ::1/128 [static]
eth0 up
link: #2, state up, mtu 1500
type: ethernet, hwaddr 48:5b:39:76:80:2d
config: compat:suse:/etc/sysconfig/network/ifcfg-eth0
leases: ipv4 dhcp granted
leases: ipv6 dhcp granted
addr: ipv4 192.168.2.28/24 [dhcp]
route: ipv4 default via 192.168.2.1
wlan0 device-not-running
link: #3, state down, mtu 1500
type: wireless
config: compat:suse:/etc/sysconfig/network/ifcfg-wlan0
linux-tl1r:~ # route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.2.1 0.0.0.0 UG 0 0 0 eth0
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
linux-tl1r:~ #
The command ip addr was included in the upper code section.
The command cat /etc/resolv.conf from this morning was already included and I have overwritten the file again and it is now again with the opendns settins as in the first post.
I will set the policy in YAST to only manually but I thought when it is set to static it should not be changed either. When NetworkManager changes the settings with every reboot it would not be static. Anyway I will change it and see what happens. Hopefully the NetworkManager does not start up at the next reboot again (like the ModemManager) which needs to be set to mask to disable it permanently.
Cheers
Uli
Okay, so you have wicked working now (connected via eth0) based on the output you provided.
Hopefully the NetworkManager does not start up at the next reboot again (like the ModemManager) which needs to be set to mask to disable it permanently.
It shouldn’t if you’ve disabled it. ModemManager is different because it can be activated by NetworkManager as a dependency, but only if the former is enabled/started.
Yes it looks OK now - I only wonder why NetworkManage was not (and is not yet on my other computers) disabled from the start when wicked is chosen. Is this a bug?
Thanks you again for helping, I tried to click the star a few times but it says “You must spread some Reputation around before giving it to deano_ferrari again.” Nevertheless you were the one who helped. Thank you
Cheers
Uli
BTW, for test purposes I currently have a static IP config assigned and using wicked, and I have also specified a manual DNS server (8.8.8.8) via YaST and using the ‘Use Default Policy’. The applicable DNS settings are stored in the /etc/sysconfig/network/config file. It behaves exactly as expected and not overwritten.
Just a comment from personal experience. It might not apply to your case.
If I am using “NetworkManager”, and then switch to “wicked”, I run into DNS problems. I’m seeing this on Leap 42.1 and on Tumbleweed. I don’t recall seeing it on earlier versions.
What seems to happen, is that “wicked” and “NetworkManager” use different versions of “/etc/resolv.conf”. The version that “wicked” uses has a bunch of comment lines at the top, with cautions about editing the file. The one from “NetworkManager” just has the bare minumum.
When I switch to “wicked”, the “resolv.conf” from “NetworkManager” stays there, except that “NetworkManager” seems to edit it to remove the “nameserver” lines. The “resolv.conf” from “wicked” is saved as “resolv.conf.netconfig”.
I find that I need to
cd /etc
mv resolv.conf.netconfig resolv.conf
And that fixes the problem. Thereafter, “wicked” updates it properly. But something goes wrong on a transition from “NetworkManager” to “wicked”. It’s probably a bug, but I haven’t reported it because it is so easy to fix when it happens.
In your case, you might check for “/etc/resolv.conf.netconfig”. If that exists, it probably has the setting for DNS that you thought you had configured. So move that to “resolv.conf” and your problem should be solved until the next time that you switch from “NetworkManager” to “wicked”.
Interesting observation. I haven’t noticed this particular quirk, and I don’t often switch between the two, but like you I can generally work around issues like this using manual techniques like copying (or removing /etc/resolv.conf) and then using netconfig to force an update, so don’t tend to dwell on things like this unless they keep biting me. Sometimes, it seems that users run into these things by doing something that is unique and exposes some underlying quirk/bug/behaviour that is difficult to characterise or verify without careful experimentation to replicate what they did.
thanks for your observations, nrickert, but it seems to be different on my computers. First I always ran wicked in Leap and I have no resolv.con.netconfig files there but many /etc/resolv.conf.xxxxxxx files where the xxxxxx are random numbers/letters. But they are all older, the newest is from Sept 2013 and their content is all the same created by netconfig without any explicit dns IP address.
I am now on my Tumbleweed computer (I changed the settings there) which is my oldest computer - a more than 12 year old i586 laptop. Here I have the file resolv.conf.netconfig but again this file has no IP addresses.
The other difference is that on my Leap computer I changed several times the dns settings to those from Opendns (at least 3 times in the last 2 months) but the NetworkManager just kept on changing them back. (I have a copy of the settings in my home directory so I just copy it and with vi I just paste the whole text in). Hopefully that is solved now with changing Yast settings to change manually only and disabling NetworkManager.
cheers
Uli