I was thinking of doing this..
but slightly differnt....
renaming the node would change the interface name too.
but what you have would work as well.
"Vladimir B. Grebenschikov" wrote:
>
> Tring to use netgraph system for some pruposes
> (frame-relay/tunneling/sync) I found that it is too complicated to
> follow naming schemes for different clients, and build firewall
> tables And not very clean witch ngX for what.
>
> There two patches:
>
> first allow name netgraph network interface.
>
> # ngctl msg ng0: setifname \"sync0\"
>
> will name interace ng0 as sync0
>
> second patch allows rename already named netgraph node (I don't understand why
> netgraph designers don't allow this)
>
> # ngctl name ng0: sync0
>
> so small script will easy create interface:
>
> mkif() {
> name="$1"
> ngname=`( echo "mkpeer iface dummy inet"; echo "msg .:dummy getifname" ) \
> | ngctl -f - | perl -n -e '/Args:\s+\"(ng\d+)\"/ && print "$1\n";'`
> if [ "$name" != "" ]; then
> ngctl msg $ngname: setifname \"$name\"
> ngctl name $ngname: $name
> ngname=$name
> fi
> }
>
> # SYNC interfaces
> mkif sync0
> # some other netgraph stuff
>
> mkif sync1
> ...
> mkif sync2
> ...
>
> # framerelay
> mkif frm0
> ...
> mkif frm1
> ...
>
> --------------------------------------------------------------------------------
> Name: iface-setname.patch
> iface-setname.patch Type: unspecified type (application/octet-stream)
> Encoding: base64
>
> Name: node-rename.patch
> node-rename.patch Type: unspecified type (application/octet-stream)
> Encoding: base64
>
> --------------------------------------------------------------------------------
>
> --
> TSB Russian Express, Moscow
> Vladimir B. Grebenschikov, [EMAIL PROTECTED]
--
__--_|\ Julian Elischer
/ \ [EMAIL PROTECTED]
( OZ ) World tour 2000-2001
---> X_.---._/
v
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-net" in the body of the message