Where to find a list of ifconfig_<interface> options?

johnblue

Well-Known Member

Reaction score: 40
Messages: 309

In reading rc.conf(5) man page I see where "AUTO" and "DHCP" are valid options:

1547234306766.png


(btw ... the word of the day is "possible")

:D

.. but I have not been able to find where the options are listed in an obvious fashion. ifconfig(8) does not even have the word "DHCP" anywhere and the Handbook is equally vague.

I am sure it is possible that I am over looking it somewhere ..
 

Bobi B.

Well-Known Member

Reaction score: 142
Messages: 333

DHCP is a "magic" token. Or you can write anything that can would work if added after ifconfig ed0 , for example ifconfig_ed0="inet 192.168.1.10/24" would become ifconfig ed0 inet 192.168.1.10/24. You can also simply use ifconfig_ed0="up" if you're going to use tagged VLANs only.

Imagine that startup scripts would start DHCP client if you enable DHCP for given interface. All the rest is in ifconfig(8) man page.

Edit: (too many edits). Pseudocode:
Code:
if ($interface_config = "DHCP") then
    start_dhcp_client $ifname
else
    ifconfig $ifname $interface_config
.
 
OP
OP
johnblue

johnblue

Well-Known Member

Reaction score: 40
Messages: 309

Phishfry said:
/etc/defaults/rc.conf has the settings.
It has the defaults but no extensive list of options, correct? I could not find either "DHCP" or "AUTO".
 
OP
OP
johnblue

johnblue

Well-Known Member

Reaction score: 40
Messages: 309

Bobi B. said:
DHCP is a "magic" token.
I do not disagree. :D How does /etc/rc.conf process it? Looking for where under-the-hood magic is taking place.

;)
 

_martin

Aspiring Daemon

Reaction score: 156
Messages: 766

What about the man page of rc.conf(5)? It's there.

EDIT: meh, I did want to erase my reply when I saw that you did look into that man page (reading with comprehension failure on my side :p).
I guess I failed to understand the 'obvious fashion', as for me it seems ok.
 
OP
OP
johnblue

johnblue

Well-Known Member

Reaction score: 40
Messages: 309

_martin said:
What about the man page of rc.conf(5)? It's there.
Correct, as indicated references to a couple different options are sprinkled throughout the text, but there is not a concise listing. I guess what I am looking for is to see there are other options besides DHCP and AUTO.
 
OP
OP
johnblue

johnblue

Well-Known Member

Reaction score: 40
Messages: 309

Phishfry said:
/etc/network.subr
Intersting that it calls DHCP a "pseudo argument".

So here is where it looks like it starts up DHCP:
Code:
        if dhcpif $1; then
                if [ $_cfg -ne 0 ] ; then
                        ${IFCONFIG_CMD} $1 up
                fi
                if syncdhcpif $1; then
                        /etc/rc.d/dhclient start $1
                fi
                _cfg=0
        fi
Lots of arguments to review in there ..

Thanks for the help. ;)
 
Top