/etc/network/interfaces declarations

David Henderson dhenderson at digital-pipe.com
Mon Apr 4 20:00:14 UTC 2016


Thanks for the help Isaac!  Replies are inline...


>> Good morning all!  I am working with the /etc/network/interfaces file
>> and was curious what declarations are available to busybox.  So far
>
> Test it out; this is usually the fastest way to find out.

Unfortunately in this situation I think that would have just been a
giant waste of time.  Seeing as how this setup needs 'plugins', I
would never have gotten this to work. :)  Just as a side question, why
doesn't someone update the BB website to include more information like
this?


> As a general rule, anything that doesn't require a plugin should work.
> This is roughly 'allow-*' and anything that's not separated by '-'/'_'.
> Anything that requires a plugin will require the appropriate package
> and script.

I would assume that BB doesn't look for the appropriate package, but
just the appropriately named script under /etc/network/if-*.d and
executes it.  And if the proper binaries aren't installed it will
fail.  So, for example, if I have a 'dns-nameservers' declaration, I
should have a file named /etc/network/if-up.d/dns-nameservers?  Or
should that just be /etc/network/if-up.d/nameservers?


>> I'm interested in using the following:
>>
>> address 192.168.0.10
>> netmask 255.255.255.0
>> gateway 192.168.0.1
> Standard.
> (I don't see code *explicitly* handling 'gateway', but I think there's
> some trick such that it gets handled.)
>
>> dns-nameservers 1.1.1.1 1.1.1.2 1.1.1.3
>> dns-search newdomain.local olddomain.local outside.com
>
> I think these are handled by an ifup plugin, given the hyphen.
> They would become IF_DNS_NAMESERVERS/IF_DNS_SEARCH for scripts in
> /etc/network/*.d/
> ...Ah, they are handled by the resolvconf ifup plugin.

So that would be the variable names in a shell script?  For example:

#!/bin/sh
[ "$IF_DNS_NAMESERVERS" != '' ]; then echo 'we have name servers!'; fi

Does that also mean that these particular declarations need to have a
'plugin' called 'resolvconf' or does it need to be 'dns-nameservers'
or just 'nameservers'.  I'm a bit confused...  And are there any other
special naming cases like this?


>> wpa-conf /etc/wpa_supplicant.conf
>
> Handled by the wpa_supplicant ifup plugin (IF_WPA_CONF).
>
> These 'plugins' I refer to are scripts in
> /etc/network/if-{,pre-,post-}{up,down}.d/
> Depending on the directory, they will be executed before or after
> interfaces go up or down.
>
>> A list of available, working declarations would be greatly appreciated!

Thanks,
Dave


More information about the busybox mailing list