xref: /freebsd/share/examples/netgraph/raw (revision d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf)
1a5fad8dbSJulian Elischer#!/bin/sh
2a5fad8dbSJulian Elischer# script to connect a raw synchronous card to a system interface.
3a5fad8dbSJulian Elischer# Assumes the file if_sr was compiled with options NETGRAPH.
4a5fad8dbSJulian Elischer
5a5fad8dbSJulian ElischerCARD=sr0
6a5fad8dbSJulian Elischer
7a5fad8dbSJulian Elischer# create an interface "ng0" and attach it to the sync port.
8*5665fe6bSUlrich Spörlein# The packets had jolly well better be IP because we are not discriminating.
9a5fad8dbSJulian Elischerngctl mkpeer ${CARD}: iface rawdata inet
10a5fad8dbSJulian Elischer
11a5fad8dbSJulian Elischer# if ng0 already exists, use a CONNECT command instead of a mkpeer. e.g.
12a5fad8dbSJulian Elischer# ngctl connect ${CARD}: ng0: rawdata inet
13a5fad8dbSJulian Elischer
14a5fad8dbSJulian Elischer# Then use ifconfig on interface ng0 as usual
15a5fad8dbSJulian Elischer
16