Netgraph at startup - rc.conf ?

Scot Hetzel swhetzel at gmail.com
Thu Jan 25 16:14:52 UTC 2007


On 1/25/07, Pete French <petefrench at ticketswitch.com> wrote:
> I have a machine with two interfaces in it - bge0 and beg1. I now
> find I need to usse ng_fec to make these into one interface due to
> the way out networking contractors are installign a new site.
>
> Seems like no problem from the command line, but what I can't
> find anywhere in the documentation is how to make this happen
> at boot time using rc.conf. I am assuming my line which
> looks like:
>
>         ifconfig_em0="inet 172.16.1.6 netmask 255.255.0.0"
>
> becomes
>
>         ifconfig_fec0="inet 172.16.1.6 netmask 255.255.0.0"
>
> but obviously I need to do something to create fec0 before
> that happens. Preseumably something like cloned_interfaces="fce0",
> but where does it get the parameters from to create the interface ?
>

To run commands before a interface started, you need to create a
/etc/start_if.fec0,

           #!/bin/sh

           /usr/sbin/ngctl -f- <<-SEQ
                   mkpeer fec dummy fec
                   msg fec0: add_iface "bge0"
                   msg fec0: add_iface "bge1"
                   msg fec0: set_mode_inet
         SEQ

Then add fec0 to the network_interfaces variable in your /etc/rc.conf.

Scot
-- 
DISCLAIMER:
No electrons were mamed while sending this message. Only slightly bruised.


More information about the freebsd-stable mailing list