]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - share/examples/netgraph/frame_relay
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / share / examples / netgraph / frame_relay
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 # $FreeBSD$
5
6 CARD=sr0
7 DLCI=16
8
9 # create a frame_relay type node and attach it to the sync port.
10 ngctl mkpeer ${CARD}: frame_relay rawdata downstream
11
12 # Attach the dlci output of the (de)multiplexor to a new 
13 # Link management protocol node.
14 ngctl mkpeer ${CARD}:rawdata lmi dlci0 auto0
15
16 # Also attach dlci 1023, as it needs both to try auto-configuring.
17 # The Link management protocol is now alive and probing..
18 ngctl connect ${CARD}:rawdata ${CARD}:rawdata.dlci0 dlci1023 auto1023
19
20 # Attach the DLCI(channel) the Telco has assigned you to
21 # a node to handle whatever protocol encapsulation your peer
22 # is using. In this case RFC1490 encapsulation.
23 ngctl mkpeer ${CARD}:rawdata rfc1490 dlci${DLCI} downstream
24
25
26 # Attach the ip (inet) protocol output of the protocol mux to the ip (inet)
27 # input of a netgraph "interface" node (ifconfig should show it as "ng0").
28 #if interface ng0 needs to be created use a mkpeer command.. e.g.
29 ngctl mkpeer ${CARD}:rawdata.dlci${DLCI} iface inet inet
30
31 # if ng0 already exists, use a CONNECT command instead of a mkpeer. e.g.
32 # ngctl connect ${CARD}:rawdata.dlci${DLCI} ng0: inet inet
33
34 # Then use ifconfig on interface ng0 as usual
35
36 # A variant on this whole set might use the 'name' command to make it more
37 # readable. But it doesn't work if you have multiple lines or dlcis
38 # e.g.
39 # ngctl mkpeer ${CARD}: frame_relay rawdata downstream
40 # ngctl name ${CARD}:rawdata mux
41 # ngctl mkpeer mux: lmi dlci0 auto0
42 # ngctl name mux:dlci0 lmi
43 # ngctl connect mux: lmi: dlci1023 auto1023
44 # ngctl mkpeer mux: rfc1490 dlci${DLCI} downstream
45 # ngctl mux:dlci${DLCI} protomux
46 # ngctl mkpeer protomux: iface inet inet