From b02336e915dd02922c79c674b290754a193ec0e3 Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 19 Nov 1999 06:56:34 +0000 Subject: Add an example of how to set up a frame relay link using netgraph and the 'sr' sync card. --- share/examples/netgraph/frame_relay | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 share/examples/netgraph/frame_relay (limited to 'share/examples/netgraph/frame_relay') diff --git a/share/examples/netgraph/frame_relay b/share/examples/netgraph/frame_relay new file mode 100644 index 0000000..0becb47 --- /dev/null +++ b/share/examples/netgraph/frame_relay @@ -0,0 +1,46 @@ +#!/bin/sh +# script to set up a frame relay link on the sr card. +# The dlci used is selected below. The default is 16 +# $FreeBSD$ + +CARD=sr0 +DLCI=16 + +# create a frame_relay type node and attach it to the sync port. +ngctl mkpeer ${CARD}: frame_relay rawdata downstream + +# Attach the dlci output of the (de)multiplexor to a new +# Link management protocol node. +ngctl mkpeer ${CARD}:rawdata lmi dlci0 auto0 + +# Also attach dlci 1023, as it needs both to try autoconfiguring. +# The Link management protocol is now alive and probing.. +ngctl connect ${CARD}:rawdata ${CARD}:rawdata.dlci0 dlci1023 auto1023 + +# Attach the DLCI(channel) the Telco has assigned you to +# a node to hadle whatever protocol encapsulation your peer +# is using. In this case rfc1490 encapsulation. +ngctl mkpeer ${CARD}:rawdata rfc1490 dlci${DLCI} downstream + + +# Attach the ip (inet) protocol output of the protocol mux to the ip (inet) +# input of a netgraph "interface" node (ifconfig should show it as "ng0"). +#if interface ng0 needs to be created use a mkpeer command.. e.g. +ngctl mkpeer ${CARD}:rawdata.dlci${DLCI} iface inet inet + +# if ng0 already exists, use a CONNECT command instead of a mkpeer. e.g. +# ngctl connect ${CARD}:rawdata.dlci${DLCI} ng0: inet inet + +# Then use ifconfig on interface ng0 as usual + +# A variant on this whole set might use the 'name' command to make it more +# readable. but it doesn't work if you have multiple lines or dlcis +# e.g. +# ngctl mkpeer ${CARD}: frame_relay rawdata downstream +# ngctl name ${CARD}:rawdata mux +# ngctl mkpeer mux: lmi dlci0 auto0 +# ngctl name mux:dlci0 lmi +# ngctl connect mux: lmi: dlci1023 auto1023 +# ngctl mkpeer mux: rfc1490 dlci${DLCI} downstream +# ngctl mux:dlci${DLCI} protomux +# ngctl mkpeer protomux: iface inet inet -- cgit v1.1