Bug 804577

Summary: network sets up eth0 incl. route without link/cable
Product: [openSUSE] openSUSE 12.3 Reporter: Harald Koenig <koenig>
Component: NetworkAssignee: openSUSE GNOME <os.gnome.maintainers>
Status: RESOLVED DUPLICATE QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P5 - None CC: dimstar, mt
Version: RC 1   
Target Milestone: ---   
Hardware: x86-64   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: network-service-switch.sh script as illustration

Description Harald Koenig 2013-02-20 02:23:27 UTC
this is 12.3-RC1 plus online updates (same behavior as with plain RC1):

network manager sets up eth0 with ip address and route even though there is no cable connected:

# ethtool eth0 | grep Link
        Link detected: no

# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:26:2D:FD:16:B1  
          inet addr:192.168.178.40  Bcast:192.168.178.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:20 Memory:f2500000-f2520000 

# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.178.1   0.0.0.0         UG    0      0        0 wlan0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
192.168.178.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.178.0   0.0.0.0         255.255.255.0   U     0      0        

the eth0 ip is from old wired connection data (when wireless was broken due to multiple running instaces of wpa_supplicant -- see bug #803389) in 

    /var/lib/dhcpcd/dhcpcd-eth0.info
this route interferes with wireless connection.

I have to run "ifconfig eth0 down" to get the routing via wlan0 :-((
Comment 1 Dominique Leuenberger 2013-02-20 11:51:11 UTC
CCing Marius... would not be too surprised if the sysconfig 0.80 upgrade and NM adjustments for it are cause here too
Comment 2 Marius Tomaschewski 2013-02-20 13:06:27 UTC
The description sounds to me, it would unrelated bug. It seems to be
intention and not yast2/update problem that the network manager is
used here.
The problem is, that NM is trying to set up unconnected link, right?


Current problems mentioned in comment 1 are:

bug 803058: tracks the update case [where yast2 2nd stage is not involved],
bug 798348: is about fresh installations with yast2-network unable to switch.


Background/Except of this:

sysconfig, NetworkManager and most other packages has been changed to not
use NETWORKMANAGER variable any more, but a network.service alias link.

See also release notes bug #800771 and - still unfixed - bug #798348, to
adopt switching between NetworkManager and /etc/init.d/network in yast2.

[/etc/init.d/network is currently active only while miminal installation,
 in all other cases NetworkManager because yast2 is unable to switch it
 as needed.]

To enable NetworkManager, use:

  systemctl stop network.service
  systemctl --force enable NetworkManager.service
  systemctl start network.service

to disable NetworkManager, use:

  systemctl stop network.service
  systemctl --force disable NetworkManager.service
  systemctl start network.service

This command:
   systemctl --no-pager -p Id show network.service

reports "Id=NetworkManager.service" when NetworkManager acts as the network
service, "Id=network.service" means /etc/init.d/network.
Comment 3 Harald Koenig 2013-02-20 13:27:15 UTC
(In reply to comment #2)
> The description sounds to me, it would unrelated bug. It seems to be
> intention and not yast2/update problem that the network manager is
> used here.

correct

> The problem is, that NM is trying to set up unconnected link, right?

right

> To enable NetworkManager, use:
> 
> to disable NetworkManager, use:

so what do you recommend for testing and getting you more information?

for now I have workarounds for my issues, so I can test and collect data.


until recently I've never used NetworkManager, that's even newer to me than systemd ;-)
but with 12.2 it worked reasonable well, so I'd like to give it some more chances,
and would like to stay with it for now (at least if that's the way opensuse is going
for new, plain installations).


> This command:
>    systemctl --no-pager -p Id show network.service
> 
> reports "Id=NetworkManager.service" when NetworkManager acts as the network
> service, "Id=network.service" means /etc/init.d/network.

really ?
systemctl --no-pager -p Id   show NetworkManager.service 
Id=NetworkManager.service
hl harald > systemctl --no-pager -p Id   show foo.service 
Id=foo.service

# systemctl --no-pager -p Id   show network.service 
Id=network.service

BUT:

# systemctl --no-pager -p Id   show NetworkManager.service 
Id=NetworkManager.service

# systemctl --no-pager -p Id   show foo.service 
Id=foo.service

and:


# systemctl  | grep -i network
...
network.service           loaded active running       LSB: Configure network interfaces and set up routing
NetworkManager.service    loaded active running       Network Manager
ntp.service               loaded active running       LSB: Network time protocol daemon (ntpd)
network.target            loaded active active        Network
nss-lookup.target         loaded active active        Host and Network Name Lookups

so *both* are running ?!?  
I'm still not too comfortable with systemd, sorry!


feel free to suggest what to try/test or ask for more infos.

just for reference my ifcfg-eth0 (works with 12.2[tm]) :

$ cat /etc/sysconfig/network/ifcfg-eth0
BOOTPROTO='dhcp'
BROADCAST=''
ETHTOOL_OPTIONS=''
IPADDR=''
MTU=''
NAME='82577LM Gigabit Network Connection'
NETMASK=''
NETWORK=''
REMOTE_IPADDR=''
STARTMODE='auto'
USERCONTROL='no'
Comment 4 Marius Tomaschewski 2013-02-20 15:31:47 UTC
(In reply to comment #3)
> > This command:
> >    systemctl --no-pager -p Id show network.service
> > 
> > reports "Id=NetworkManager.service" when NetworkManager acts as the network
> > service, "Id=network.service" means /etc/init.d/network.
> 
> really ?
> systemctl --no-pager -p Id   show NetworkManager.service 
> Id=NetworkManager.service
> hl harald > systemctl --no-pager -p Id   show foo.service 
> Id=foo.service
> 
> # systemctl --no-pager -p Id   show network.service 
> Id=network.service

When "systemctl --no-pager -p Id show network.service" does not
show "Id=NetworkManager.service", then the network.service alias
link is not correctly created.

Use "systemctl --force enable NetworkManager.service" it should
create the network.service -> NetworkManager.servivce link.

The declaration to do it is the "Alias=network.service" in the
"[Install]" of /usr/lib/systemd/system/NetworkManager.service".

> so *both* are running ?!?  

Yes. NM is running, but rcnetwork is active and running too :-/

Enable/disable are independent of start/stop.

I still trying to figure out how to fix it for "zypper up" and
"NETWORKMANAGER=yes" migration case in bnc#803058.

The problem *seems* to be, that "systemctl enable" [in preset or
manual call from spec] is unable to create the link because of all
the /lib/systemd to /usr/lib/systemd move and restart_on_update in
NM %postun from the 12.2 package...

> feel free to suggest what to try/test or ask for more infos.

To fix your current state use:

systemctl stop NetworkManager.service
systemctl stop network.service

systemctl --force enable NetworkManager.service

# it should be visible that it creates the link... then:

systemctl start network.service # starts NM via alias link

A "systemctl status network.service" should show exactly the same
status as "systemctl status NetworkManager.service".
Comment 5 Marius Tomaschewski 2013-02-20 15:33:53 UTC
Created attachment 525507 [details]
network-service-switch.sh script as illustration
Comment 6 Harald Koenig 2013-02-20 16:24:03 UTC
(In reply to comment #4)
> To fix your current state use:
> 
> systemctl stop NetworkManager.service
> systemctl stop network.service
> 
> systemctl --force enable NetworkManager.service
> 
> # it should be visible that it creates the link... then:
> 
> systemctl start network.service # starts NM via alias link
> 
> A "systemctl status network.service" should show exactly the same
> status as "systemctl status NetworkManager.service".

ack! looks much better now!  (I did run your commands manually, noticed your script only now)
at least eth0 does not show an ipaddress nor route anymore.

and: only one wpa_supplicant is running now, so this might also fix the wifi issues in bug #803389
but I can this this only much later at home...

looks good to me -- thanks!
Comment 7 Marius Tomaschewski 2013-02-20 17:20:53 UTC
OK, thanks! Then let's resolve it as bnc#803058 duplicate.

*** This bug has been marked as a duplicate of bug 803058 ***