LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 07-01-2011, 09:15 AM   #1
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Rep: Reputation: 174Reputation: 174
How do I reinstall "networking" in Ubuntu 10.04? (long but thorough)


I solved my suspend/resume issues by replacing the nVida card with an ATI Radeon card. The second of the issues, discussed in other posts, was as follows:

When I selected System; Shutdown; Suspend the PC would not suspend. It would go to a locked screen. When I unlocked the screen I would find that networking was disconnected (shown by the NetworkManager applet) and there was no way to get it back other than to reboot the PC.

That has gone away. However, I have noticed that the networking intermittently disconnects and reconnects and on occasion disconnects and does not reconnect. Sometimes when the PC is rebooted it comes up with networking disabled and no choice in the applet to reconnect. So I have taken on a mission to fix the thing.

A search for "restart networking Ubuntu" brings up a lot of information which did not seem to work. The keys seemed to be editing /etc/network/interfaces and the command sudo /etc/init.d/networking restart. Using a VMWare Ubuntu 10.04 VM I made the following observations:

User moe, a member of the administrator group, logs on to the VM. Networking is enabled. moe clicks on "Disconnect" in the NetworkManager applet. Networking disconnects.

Switch user to larry - not an administrator. Networking is disconnected. larry selects "Auto eth0" in the applet. The network is reconnected.

Switch user to curly - not an administrator. Networking is still connected. curly does a "Disconnect" and then "Auto eth0". Networking disconnects and reconnects.

Switch user back to moe. Networking is connected.

Conclusion: NetworkingManager applet allows any user do disconnect/connect networking without having administrative or escalated permissions. The network status controlled by the applet is not specific to the user. It is global at the machine level.

This is convenient but not the way things were generally done in Linux. Networking used to be a "root" level activity. In the above case if the 3 stooges (users) are connected remotely to the box and curly decides to unplug he not only unplugs his remote session, he also unplugs the other users.

Switch user to ken (me, a sudoer). I attempt to stop networking thusly
Quote:
ken@ubuntu:~$ sudo /etc/init.d/networking stop
[sudo] password for ken:
* Deconfiguring network interfaces... Ignoring unknown interface eth0=eth0.
[ OK ]
and it does not work. Networking is still connected.

So I add the following lines to /etc/network/interfaces
Quote:
auto eth0
iface eth0 inet dhcp
and try again
Quote:
ken@ubuntu:~$ sudo /etc/init.d/networking stop
* Deconfiguring network interfaces... [ OK ]
Networking is still connected. It appears that the applet is using some interface which is not in the normal system level configuration. The applet uses "Auto eth0" as the name to select to reconnect. It appears not to be the same as that name in /etc/init.d/networking. If I "Edit connections" from the applet I am told that Auto eth0 was last used "never"(?)

If I reboot the VM after editing /etc/init.d/networking it comes up connected and the applet is gone. I am connected to the network as shown by ifconfig or opening a web browser session. I can stop
Quote:
ken@ubuntu:~$ sudo /etc/init.d/networking stop
* Deconfiguring network interfaces... There is already a pid file /var/run/dhclient.eth0.pid with pid 1488
killed old client process, removed PID file
Internet Systems Consortium DHCP Client V3.1.3
Copyright 2004-2009 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/00:0c:29:ec:a3:8c
Sending on LPF/eth0/00:0c:29:ec:a3:8c
Sending on Socket/fallback
DHCPRELEASE on eth0 to 192.168.0.1 port 67
[ OK ]
and start
Quote:
ken@ubuntu:~$ sudo /etc/init.d/networking start
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service networking start

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start networking
networking stop/waiting
Quote:
ken@ubuntu:~$ sudo ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:0c:29:ec:a3:8c
inet addr:192.168.0.102 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:feec:a38c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:91 errors:0 dropped:0 overruns:0 frame:0
TX packets:125 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:47523 (47.5 KB) TX bytes:17250 (17.2 KB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:12 errors:0 dropped:0 overruns:0 frame:0
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:720 (720.0 B) TX bytes:720 (720.0 B)
But now back to my physical machine which is having the issues. If I edit /etc/init.d/networking and reboot the applet is gone. If I issue sudo /etc/init.d/networking stop I can disconnect
Quote:
ken@taylor12:~$ sudo /etc/init.d/networking stop
[sudo] password for ken:
* Deconfiguring network interfaces... * Stopping the Firestarter firewall...
...done.
* Starting the Firestarter firewall...
...done.
postconf: fatal: open /etc/postfix/main.cf: No such file or directory
There is already a pid file /var/run/dhclient.eth0.pid with pid 1948
killed old client process, removed PID file
Internet Systems Consortium DHCP Client V3.1.3
Copyright 2004-2009 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/00:25:64:e8:18:2c
Sending on LPF/eth0/00:25:64:e8:18:2c
Sending on Socket/fallback
DHCPRELEASE on eth0 to 192.168.0.1 port 67
[ OK ]
However, if I issue sudo /etc/init.d/networking start I get this
Quote:
ken@taylor12:~$ sudo /etc/init.d/networking start
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service networking start

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start networking
networking stop/waiting
after a long delay but no connection.

It seems to me that something in the "networking" area of the physical PC is broken. Is it possible to reinstall the networking stuff short of going though synaptic and guessing and hoping?

TIA,

Ken
 
Old 07-02-2011, 07:55 AM   #2
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304

Rep: Reputation: 65
i don't think uninstalling and reinstalling is going to do you any good. some more tools for you would be:

ifconfig eth0 up
ifconfig eth0 down
dhcpcd eth0
killall dhcpcd
 
Old 07-02-2011, 08:58 AM   #3
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Original Poster
Rep: Reputation: 174Reputation: 174
Thanks whansard,

"sudo ifconfig eht0 down" will in fact disconnect networking. However the ... up command will not bring it back. The output from ifconfig looks like it is back but it is not. I have to run "sudo /etc/init.d/networking start" to get reconnected.

I am not able to run the dhcpcd command. Perhaps a Ubuntu thing.

The above testing done on the virtual machine with /etc/network/interfaces containing the two lines described in the original post. The physical machine is working at the moment with the applet so I am going to leave well enough alone for the time being. I probably need to reinstall Ubuntu from scratch or perhaps CentOS 6 (if/when) it comes out.

Ken
 
Old 07-02-2011, 10:00 AM   #4
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304

Rep: Reputation: 65
dhcpcd gets an ip address and name servers for the interface. ubuntu's might be dhcp3-client.
 
  


Reply



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
system(ubuntu) waits too long at "starting cupsd" during boot grindelwald Linux - Software 1 07-19-2008 05:26 AM
How to convert "unsigned long long" to "char pointer"? novicehacker Linux - Kernel 1 11-20-2006 12:57 AM
LONG LONG "lost" /home directory post Mark_in_Hollywood Linux - Newbie 5 09-19-2006 11:47 PM
Lost DHCP Lease when putting computer in "Standby" mode for a "long" time pnellesen Linux - Networking 1 01-06-2005 11:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 01:45 AM.

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