LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-03-2017, 02:45 PM   #1
spiri13
Member
 
Registered: Jun 2016
Posts: 57

Rep: Reputation: Disabled
Disabling an interface per default (using dhcpcd?)


Hi,

I have that simple question, I want to disable a network interface per default, so it never connects to something at system startup. In fact, I have two interfaces and I want to be sure that I will only use *this one* interface per default.

I'm a little bit confused about all the details of network configurations in linux and i need a straightforward method of doing so, because i really only want "disabling by default" and not "redirect this to nirvana" or something else. Is this possible?

In fact I want "take interface x by default AND disable interface y by default OR enable interface y". This should be the most securest behaviour, I think?

Also I think the the solution is within the configuration of dhcp daemon. I know it's a protocol distributing ip addresses and you can configure all this. I also know where those services are located but I have troubles in configuring them and I see a lot of solutions on the internet but *it* won't work.......

I thought something like "ExecPath=/bin/dhcpcd --release overcable --renew overtheair" could work. But it didn't.

Could you help me configuring my linux properly?

Last edited by spiri13; 02-03-2017 at 02:57 PM.
 
Old 02-03-2017, 04:06 PM   #2
TheEzekielProject
Member
 
Registered: Dec 2016
Distribution: Devuan+lxde
Posts: 656

Rep: Reputation: 190Reputation: 190
I don't believe dhcpcd is capable of enabling or disabling an interface itself. That's typically done via
Code:
ip link set interface up (or down)
or ifconfig
 
Old 02-03-2017, 04:37 PM   #3
spiri13
Member
 
Registered: Jun 2016
Posts: 57

Original Poster
Rep: Reputation: Disabled
Yes this worked.
 
Old 02-03-2017, 04:42 PM   #4
TheEzekielProject
Member
 
Registered: Dec 2016
Distribution: Devuan+lxde
Posts: 656

Rep: Reputation: 190Reputation: 190
Hooray! Please mark your thread as solved
 
Old 02-03-2017, 05:45 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 19,032

Rep: Reputation: 2890Reputation: 2890Reputation: 2890Reputation: 2890Reputation: 2890Reputation: 2890Reputation: 2890Reputation: 2890Reputation: 2890Reputation: 2890Reputation: 2890
However, that is only temporary till the next reboot. How to permanently disable an interface depends on the distribution/version and if running a desktop. Most desktops have some kind of network applet where you can configure an interface.

There is a denyinterfaces directive that can be used in dhcpcd.conf or on the command line to prevent an interface from acquiring an IP address.
 
Old 02-04-2017, 06:47 AM   #6
spiri13
Member
 
Registered: Jun 2016
Posts: 57

Original Poster
Rep: Reputation: Disabled
I created and enabled a service in the highest priority directory which does "ip link set interface down".

I also appended "denyinterfaces <regular expression>" in dhcpcd.conf. I tested my regular expression previousely with fnmatch(), this worked.

I (re)started both services but it's still not working. I also tried a reboot, same result.

I previousely disabled and stopped the network services which come with the GUI.

Both services started with success but it's not working for me.

Last edited by spiri13; 02-04-2017 at 06:49 AM.
 
Old 02-05-2017, 06:11 AM   #7
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 12,501
Blog Entries: 9

Rep: Reputation: 3387Reputation: 3387Reputation: 3387Reputation: 3387Reputation: 3387Reputation: 3387Reputation: 3387Reputation: 3387Reputation: 3387Reputation: 3387Reputation: 3387
wouldn't it be simplest and best (sledgehammer method) to blacklist the kernel module in question?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] default packaged dhcpcd-6.0.5-i486-3_slack14.1 contains routing bug Crew-L-T Slackware 1 12-02-2014 11:22 PM
Disabling default keyboard behavior jdwpv4 Linux - Hardware 1 05-02-2014 10:28 AM
Prevent dhcpcd from changing default gateway? MarleyGPN Linux - Networking 3 09-01-2006 01:37 PM
dhcpcd not adding default route cpsully69 Linux - Networking 2 09-07-2004 09:09 PM
change default dhcp client to dhcpcd waffe Debian 2 05-11-2004 09:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:22 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration