summaryrefslogtreecommitdiffstats
path: root/share/examples/netgraph
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1999-11-19 06:56:34 +0000
committerjulian <julian@FreeBSD.org>1999-11-19 06:56:34 +0000
commitb02336e915dd02922c79c674b290754a193ec0e3 (patch)
tree5d4106b6d67015d635f31b676eaceb67c5df54e5 /share/examples/netgraph
parent4633f7ad5ee50daddc6683eaf3cbd5ab40429592 (diff)
downloadFreeBSD-src-b02336e915dd02922c79c674b290754a193ec0e3.zip
FreeBSD-src-b02336e915dd02922c79c674b290754a193ec0e3.tar.gz
Add an example of how to set up a frame relay link using netgraph and
the 'sr' sync card.
Diffstat (limited to 'share/examples/netgraph')
-rw-r--r--share/examples/netgraph/frame_relay46
1 files changed, 46 insertions, 0 deletions
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
OpenPOWER on IntegriCloud