LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-28-2021, 12:25 AM   #1
rng
Senior Member
 
Registered: Aug 2011
Posts: 1,198

Rep: Reputation: 47
How to prevent network reconnecting automatically?


I am working on Debian Stable Linux with XFCE and it is working very well. I have network-manager installed (in XFCE) and I used to disconnect network from there when not using it.

Then once I used command from commandline: "dhclient eth0" to connect to network.

Now the net gets connected automatically a few seconds after I disconnect if from network-manager applet.

How can I prevent net from reconnecting automatically? Thanks for your help.

Last edited by rng; 02-28-2021 at 12:26 AM.
 
Old 02-28-2021, 05:17 PM   #2
leclerc78
Member
 
Registered: Dec 2020
Posts: 169

Rep: Reputation: Disabled
Try

ip link set eth0 down
 
Old 03-01-2021, 05:55 AM   #3
rng
Senior Member
 
Registered: Aug 2011
Posts: 1,198

Original Poster
Rep: Reputation: 47
Quote:
Originally Posted by leclerc78 View Post
Try

ip link set eth0 down
Thanks for your suggestion. I actually removed dhclient and restarted the computer and it seems to have settled down now!
 
Old 03-10-2021, 12:48 AM   #4
Joe1020
LQ Newbie
 
Registered: Mar 2021
Posts: 1

Rep: Reputation: 0
Thanks
 
Old 03-10-2021, 08:36 AM   #5
rng
Senior Member
 
Registered: Aug 2011
Posts: 1,198

Original Poster
Rep: Reputation: 47
Quote:
Originally Posted by leclerc78 View Post
Try
ip link set eth0 down
Automatic reconnection has started again after re-installation of dhcpcd and dhclient.
Above code does not help.
 
Old 03-10-2021, 08:57 AM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,641

Rep: Reputation: 7966Reputation: 7966Reputation: 7966Reputation: 7966Reputation: 7966Reputation: 7966Reputation: 7966Reputation: 7966Reputation: 7966Reputation: 7966Reputation: 7966
Quote:
Originally Posted by rng View Post
Automatic reconnection has started again after re-installation of dhcpcd and dhclient.
Above code does not help.
You should be able to disable auto-connection in the network manager. Right click on the nm-applet icon, and select "Edit Connections". Open the wireless tab, and select the connection in question, and click the edit button. There *SHOULD* be a box that says "Connect Automatically"...uncheck it, and it should then prompt you for a password before you can connect.

Not in front of a system where I can test that, but there should be a place in the applet to configure connections.
 
Old 03-10-2021, 09:13 AM   #7
rng
Senior Member
 
Registered: Aug 2011
Posts: 1,198

Original Poster
Rep: Reputation: 47
Quote:
Originally Posted by TB0ne View Post
You should be able to disable auto-connection in the network manager. Right click on the nm-applet icon, and select "Edit Connections". Open the wireless tab, and select the connection in question, and click the edit button. There *SHOULD* be a box that says "Connect Automatically"...uncheck it, and it should then prompt you for a password before you can connect.

Not in front of a system where I can test that, but there should be a place in the applet to configure connections.
I do not have access to that computer at present, but I think problem is related to dhclient, as is mentioned in following links:

https://askubuntu.com/questions/4591...oose-static-ip

https://askubuntu.com/questions/1519...ast-dhcp-lease
 
Old 03-10-2021, 09:18 AM   #8
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,641

Rep: Reputation: 7966Reputation: 7966Reputation: 7966Reputation: 7966Reputation: 7966Reputation: 7966Reputation: 7966Reputation: 7966Reputation: 7966Reputation: 7966Reputation: 7966
Quote:
Originally Posted by rng View Post
I do not have access to that computer at present, but I think problem is related to dhclient, as is mentioned in following links:

https://askubuntu.com/questions/4591...oose-static-ip

https://askubuntu.com/questions/1519...ast-dhcp-lease
Yes, but the network manager is the one initiating the connection...if you tell it to NOT connect to a network, it won't, and won't then try to get a DHCP address.
 
Old 03-10-2021, 11:31 AM   #9
rng
Senior Member
 
Registered: Aug 2011
Posts: 1,198

Original Poster
Rep: Reputation: 47
Quote:
Originally Posted by TB0ne View Post
Yes, but the network manager is the one initiating the connection...if you tell it to NOT connect to a network, it won't, and won't then try to get a DHCP address.
I understand now. I will try it and post feedback here.
 
Old 03-13-2021, 09:13 PM   #10
rng
Senior Member
 
Registered: Aug 2011
Posts: 1,198

Original Poster
Rep: Reputation: 47
Quote:
Originally Posted by leclerc78 View Post
Try

ip link set eth0 down
If dhcpcd is not installed, and I give following command:
Code:
ip link set eth0 down
Will I get connected to the internet?
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to unbind/rebind paths over sshfs without disconnect/reconnecting the network BryanFRitt Linux - Networking 1 05-12-2019 12:17 AM
[SOLVED] Network constantly disconnecting and reconnecting tcnm Linux - Networking 6 06-25-2015 08:40 AM
[SOLVED] network manager reconnecting problem shva Linux - Networking 4 04-27-2011 06:35 PM
Reconnecting wireless network in Ubuntu kendo9991 Linux - Wireless Networking 4 02-04-2009 03:09 AM
network connection doesn't work after reconnecting cable on newer kernels phil.d.g Slackware 1 12-20-2005 03:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:32 PM.

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