Re: How to prevent bringing interface up on system startup and be able to bring it up manually
Roy Marples
Fri Apr 14 19:12:58 2017
Hi
On 14/04/17 15:43, Роман Мещеряков wrote:
> I have Raspberry Pi (RPi) mini-PC with Raspbian OS which is adaptation
> of Debian. RPi model 3 B has 2 built-in network interfaces: Ethernet
> (eth0) and Wi-Fi (wlan0). As far as I know, in Raspbian it is dhcpcd
> that manages network configuration.
By default this is the case.
> I need to configure it in such a way that on system startup only eth0 is
> brought up. At the same time I need opportunity to bring up wlan0 at any
> time with simple command like “ifconfig wlan0 up” or “ifup wlan0”. I
> read “man dhcpcd.conf” and tried using “denyinterfaces wlan0”
> configuration option, but this seems to make wlan0 completely out of
> dhcpcd’s control. Is it possible to configure dhcpcd to get the result
> desired?
Why?
With both brought up and connected, dhcpcd should prefer eth0 over wlan0
all the time. Although both will have IP addresses, routes and gateways,
eth0 will have the lower metric to ensure it gets all the traffic - the
premise being that wired is faster than wireless (this isn't 100%, but
is a good default).
But in answer to your question, you should be able to do this.
In dhcpcd.conf put:
allowinterfaces eth0
This makes dhcpcd start eth0 only.
You can then go onto start wlan0 like so
dhcpcd -n wlan0
This should notify dhcpcd via it's control socket to start wlan0 and
should bring it up.
> dhcpcd version installed in Raspbian by default is 6.7.1.
That's getting old now, but no reason why it shouldn't work.
Roy
Archive administrator: postmaster@marples.name