Network Reconnection after Disconnect doesn't work (for me)

The main thing preventing me from going Linux although I have it installed in a multi-boot is the probelm I have with Reconnecting the Network (eth0)

If I reboot everything is fine and I am automatically connected to internet via my Ethernet_NAT_router/Homeplug_PowerLine/Cable_Router (using DHCP)

But if I manually disconnect the Network using the tray icon, or through the terminal, when I reconnect the Network Manager says I am reconnected but actually I am not connected to the internet. I can load my Cable Routers configuration page but pages beyond that in the outside world are accessible no longer…

To regain access I have to reboot.

The reason this is important for me is that I reckon if I could get this sorted then if I put the laptop to sleep it will will wake up and reconnect. :slight_smile:

As it is using Linux sleep function is unworkable unless I don’t mind losing internet.

I am determined to get this sorted eventually as I feel sure there must be a solution. My laptop isn’t new but is a good workhorse.

Help would be most appreciated.

Dell Inspiron 4100 / OpenSUSE Linux 11.2 Gnome

This might help: try giving it a fixed IP address and configuring it not to use network manager. Network manager is for mobile stuff like notebooks. If it’s in a fixed location you can use Yast → Network settings → devices → global → Traditional Method with ifup.

And put in a fixed IP plus the IP addresses of the gateway and of the Name Servers as in this tute: HowTo Configure a network card in Suse/openSUSE 10, 11 for LAN and Internet Access.

See segment Fixed IP addressing use Pics 1, 2, 6, 7, 8 and 9

Progress (I think)

I couldn’t figure out how to implement Fixed IP what with my having 2 routers (Cable Modem and also an Ethernet Router) so I tried ifup with DCHP which worked.

However there seems to be a conflict with Power Management which kind of defeats the object of the exercise >:) …With ifup the Power Management cp hangs for ages and ditto for selecting Shutdown options… and when the options do pop up the Suspend and Hibernate options are missing from the dBox. Those are some of the symptoms of the conflict.

Nevertheless before the conflict kicked I had the feeling that using ifup/DCHP the internet connection would persist through a suspend (provided I could get Power Management and ifup to coexist).

My guess is that you have probably come across this issue before. If I could solve the conflict I suspect ifup should work for me.

(Good site by the way)

Am I right this problem is appearing when coming from suspend? That would mean the driver for the NIC is not (un)loading properly. There are posts in the forums that contain examples of scripts to solve this matter. Search for ‘/etc/pm/sleep.d’ and you should find results on G*gel as well.

The problem appears even if I manually disconnect using NetworkManager. So the effect from Resume must be a secondary effect since Suspend/Resume has included Disconnect/Reconnect. So Disconnect/Reconnect (with or without Suspend) has same effect…In any case I can access the configuration of the routers upstream so the NIC must still be loaded. But the internet is unavailable after Disconnect/Reconnect (whether it is manually via NM or as a result of Suspend so latter must be irrelevant).

I tried ifup via Yast Network Settings and I think that may work, but the problem with that at the moment is the conflict with Power Management… the conflict means using ifup doesn’t allow me to Suspend etc

So my aim at the moment is to test out getting ifup to work without the conflict with Power Management as that seems the most straight forward approach to try on the evidence. i.e it works but conflicts with Power Management

Hope this has cleared things up :wink:

_

Swerdna I think we have success based on your ifup suggestion!! lol! Great stuff… (Just a mouse issue now at the bottom)

The Process:-

I was going to remove pm-utils but found it would require uninstalling hal which didn’t sound great though I am new to linux…

So instead I just installed yast2 and xfce power manager which resulted in downloading of around 90 files and ,more than 1/2 gigabytes?? :confused:

I can’t find xfce power manager anywhere but I updated gnome power manager and network manager (i think) and tried resetting to ifup. After a restart it works! I have all the Suspend options (haven’t tried just closing the lid yet) but Suspend works and the internet still available.

There were some settings in Network Settings I didn;t quite understand and gnome is a shade different from the knetworkmanager on your site but I’ll recheck.

I checked Change Default Route via DCHP but there is no Help file entry for that option to explain it.

I unchecked Change Hostname via DCHP and again have no idea.

But the Main thing is that I can now Suspend and Linux automatically Reconnects! :slight_smile:


The only new issue is that after Suspend I lose my USB mouse and have to play around with various ports before it comes back. It would be good to know how to get Linux to rescan USB via the terminal or even a keyboard shortcut.

It might also be useful to have a copy of this in the Networking Section as this problem is quite common I think before this thread I had been going round and round in circles… so some other blighter may find ifup (+ gnome updates) helpful?

I’ve had to uninstall Gnome Power Manager and reinstall the XFCE4 Power Manager in order to get the fix to persist.

Looking good. I’m lost because I’ve not used xfce, but it’s good that the principle is working for you.

Grrr!! Now I don’t have my CardBus USB and FireWire Cards recognized so it looks as if I will have to reinstall Gonome Power Manager and uninstall XFCE4 Power manager…

So back to square 1 almost :cry:

ifup seems the way to go but can’t yet get it to coexist with Gnome Power manager.

Ok for final review:

I now know ifup is the way to go for me.

I have a remaining issue with Power Management which is not a conflict between ifup and Power Management but Power Management only… Its just that I never realised I had it sisnce until I used ifup I never Suspend/Resumed

On Resume from Suspend I lose my CardBus Cards and Power Management generally is affected after the resumption. So I’ll refocus and move to Laptop section and see if I can get it solved.

But thanks swerdna for the input and getting me halfway there.

Maybe you will have a few ideas in the laptop section :wink:

I have 2 routers and apparently all flavours and current versions of linux find this a problem.

Computer(s) >> Local Safecom 4 Port Cable/DSL Broadband Router (e.g. for WAN sharing) >> ethernet/powerline >> Netgear Broadband Cable Modem Router >> ISP

Both routers have NAT hardware firewall if that is relevant. Until I can figure out how to edit my config somewhere so that both routers and DNS etc are accommodated I have removed the local Safecom router which resolves the problem. Without the extra router I am now using Network Manager (or ifup if I want) and can suspend and hibernate without too much difficulty.

One thing I have done is to add a command to a hook file called 99mylocal I created (and made executable) in /etc/pm/sleep.d to refresh the network. Here is the text of 99mylocal:

#!/bin/bash


case $1 in
    hibernate)
        echo "Hibernating... suspending to Disk... ;>}"
	echo "Unmounting external disks..."
	umount -l  /dev/sdb1 /dev/sdc1 /dev/sdc2
	echo "Taking eth0 down before hibernation..."
	/sbin/ifdown eth0
	;;

    suspend)
        echo "Suspending to RAM... ;>}"
	echo "Unmounting external disks..."
	umount -l  /dev/sdb1 /dev/sdc1 /dev/sdc2
	echo "Taking down eth0 before suspend ..."
	/sbin/ifdown eth0
        ;;

    thaw)
        echo "Suspend to disk is over, we are resuming..."
	echo "Mounting disks..."
	mount -a
	echo "Renewing eth0 "
	/sbin/rcnetwork restart
	echo "network restarted"
        ;;

    resume)
        echo "Suspend to RAM seems to be over..."
	echo "Mounting disks..."
	mount -a
	echo "Renewing eth0 "
	/sbin/rcnetwork restart
	echo "network restarted"
        ;;

    *)  echo "somebody is calling me totally wrong."
        ;;
esac

Without creating the hookfile I could get the same result by opening and then closing the Network Settings control panel in Yast after resuming from suspend or hibernate - since closing the cp runs rcnetwork restart but the hookfile automates it.

smudger