From owner-freebsd-net Mon May 7 11:23: 4 2001 Delivered-To: freebsd-net@freebsd.org Received: from InterJet.elischer.org (c421509-a.pinol1.sfba.home.com [24.7.86.9]) by hub.freebsd.org (Postfix) with ESMTP id C622737B422 for ; Mon, 7 May 2001 11:23:00 -0700 (PDT) (envelope-from julian@elischer.org) Received: from elischer.org (InterJet.elischer.org [192.168.1.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id LAA82392; Mon, 7 May 2001 11:42:48 -0700 (PDT) Message-ID: <3AF6E39A.A7447268@elischer.org> Date: Mon, 07 May 2001 11:04:10 -0700 From: Julian Elischer X-Mailer: Mozilla 4.7 [en] (X11; U; FreeBSD 5.0-CURRENT i386) X-Accept-Language: en, hu MIME-Version: 1.0 To: "Vladimir B. Grebenschikov" Cc: freebsd-net@freebsd.org Subject: Re: netgraph interface names References: <15092.6166.422647.927779@vbook.express.ru> Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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, vova@express.ru -- __--_|\ Julian Elischer / \ julian@elischer.org ( OZ ) World tour 2000-2001 ---> X_.---._/ v To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message