Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Nov 2011 02:24:49 +0100 (CET)
From:      Marco Steinbach <coco@executive-computing.de>
To:        Michael Ross <michael.ross@gmx.net>
Cc:        "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org>
Subject:   Re: Get list of ethernet devices
Message-ID:  <alpine.BSF.2.00.1111070217240.1306@s560x.c0c0.intra>
In-Reply-To: <op.v4jwfcrahalquq@michael-think>
References:  <op.v4jwfcrahalquq@michael-think>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 7 Nov 2011, Michael Ross wrote:

> Moin,

Morsche,

> I'm setting up a system on an external USB drive,
> serving as fallback in case of a server failure:
>
> Customer takes USB drive, plugs it into any of his PCs and boots of it.
>
> Now I am looking for a good method to configure the network:
>
> I could just start dhclient on any NIC which could possibly be there,
> thus cramming rc.conf with
> 	ifconfig_em0="DHCP"
> 	ifconfig_em1="DHCP"
> 	ifconfig_fxp0="DHCP"
> and so on.
>
> Or I could grep ifconfig or dmesg output for ethernet interfaces and dhclient 
> these.
>
> Both sound like a very messy solution.
>
> So I would step beyond my current area of expertise, grep some source from 
> sysinstall, bsdinstall or somewhere and do it in C.
> But I'm kind of hoping anybody can point me to a readymade solution yet 
> unknown to me.

No readymade solution, just a hint for possibly keeping the mess down a bit:

The l (lower case letter L) flag to ifconfig lists all available interfaces in a more scripting friendly fashion:

% ifconfig -l
em0 dc0 plip0 lo0 vboxnet0
%

I'd be interested in testing the results (or possible steps thereto) of your efforts in creating a customized, bootable FreeBSD USB stick image, if that's feasible.

MfG CoCo




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.1111070217240.1306>