xref: /freebsd/share/examples/netgraph/frame_relay (revision d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf)
1#!/bin/sh
2# script to set up a frame relay link on the sr card.
3# The dlci used is selected below. The default is 16
4
5CARD=sr0
6DLCI=16
7
8# create a frame_relay type node and attach it to the sync port.
9ngctl mkpeer ${CARD}: frame_relay rawdata downstream
10
11# Attach the dlci output of the (de)multiplexor to a new
12# Link management protocol node.
13ngctl mkpeer ${CARD}:rawdata lmi dlci0 auto0
14
15# Also attach dlci 1023, as it needs both to try auto-configuring.
16# The Link management protocol is now alive and probing..
17ngctl connect ${CARD}:rawdata ${CARD}:rawdata.dlci0 dlci1023 auto1023
18
19# Attach the DLCI(channel) the Telco has assigned you to
20# a node to handle whatever protocol encapsulation your peer
21# is using. In this case RFC1490 encapsulation.
22ngctl mkpeer ${CARD}:rawdata rfc1490 dlci${DLCI} downstream
23
24
25# Attach the ip (inet) protocol output of the protocol mux to the ip (inet)
26# input of a netgraph "interface" node (ifconfig should show it as "ng0").
27#if interface ng0 needs to be created use a mkpeer command.. e.g.
28ngctl mkpeer ${CARD}:rawdata.dlci${DLCI} iface inet inet
29
30# if ng0 already exists, use a CONNECT command instead of a mkpeer. e.g.
31# ngctl connect ${CARD}:rawdata.dlci${DLCI} ng0: inet inet
32
33# Then use ifconfig on interface ng0 as usual
34
35# A variant on this whole set might use the 'name' command to make it more
36# readable. But it doesn't work if you have multiple lines or dlcis
37# e.g.
38# ngctl mkpeer ${CARD}: frame_relay rawdata downstream
39# ngctl name ${CARD}:rawdata mux
40# ngctl mkpeer mux: lmi dlci0 auto0
41# ngctl name mux:dlci0 lmi
42# ngctl connect mux: lmi: dlci1023 auto1023
43# ngctl mkpeer mux: rfc1490 dlci${DLCI} downstream
44# ngctl mux:dlci${DLCI} protomux
45# ngctl mkpeer protomux: iface inet inet
46