ax25 start file

Ax25 start file die ik gebruik voor pi1lap/pi8lap/pd2lt
(nog toe te voegen start/stop/status)

#!/bin/sh
# Start AX25/Netrom networking daemons.
# Script written and modified by Niels pd2lt
# Date of last modification: 03-11-2017

### BEGIN INIT INFO
# Provides:       ax25
# Required-Start: $network $remote_fs $syslog
# Required-Stop:  $network $remote_fs $syslog
# Default-Start:  2 3 4 5
# Default-Stop:   0 1 6
# Description:    AX25 server
### END INIT INFO

set +e   # Don't exit on error status

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/xnet:/usr/local/etc/ax25

DESC="AX25 server"

ENABLED=1

        modprobe mkiss
        modprobe ax25
        modprobe netrom
        modprobe rose


        # Dual port TNC KPC-9612
        mkiss -s 9600 -x 2 /dev/ttyUSB0 > /tmp/unix98
        export PTS0=`more /tmp/unix98 | grep -w /dev | cut -b -11`
        export PTS1=`more /tmp/unix98 | grep -w /dev | cut -b 12-`
        sleep 1
        # Port 1k2 144.850Mhz
        kissattach $PTS0 ax0 > /tmp/ax25-config.tmp
        awk '/device/ { print $7 }' /tmp/ax25-config.tmp > /tmp/ax25-config-tmp
        read Device < /tmp/ax25-config-tmp

        ifconfig $Device 44.137.31.73 netmask 255.255.255.224
        sleep 2
        # Port 9k6 430.950Mhz
        kissattach $PTS1 ax1 > /tmp/ax25-config.tmp
        awk '/device/ { print $7 }' /tmp/ax25-config.tmp > /tmp/ax25-config-tmp
        read Device < /tmp/ax25-config-tmp

        ifconfig $Device 44.137.31.73 netmask 255.255.255.224
        sleep 5

        # attach rose port
        rsattach rose0
        ifconfig rose0 44.137.31.73 netmask 255.255.255.224
        rsparms -call PI1LAP-10

        # link local pi8lap (xnet)
        tmpfile="/tmp/$$.startax2.pts"
        kissnetd -p 2 > "$tmpfile" &
        sleep 2
        attachthem () {
                read PTS1 PTS2
                kissattach -l $PTS1 ax2 44.137.31.73
                ifconfig ax2 44.137.31.73 netmask 255.255.255.224 up
                sleep 1
                sed -i "s,attach sdev3 kiss 3 1 19200 /dev/.*$,attach sdev3 kiss 3 1 19200 $PTS2," /usr/local/xnet/AUTOBOOT.NET
        }

        tail -n 1 $tmpfile | attachthem
        rm $tmpfile
        sleep 3

        # Link local pi1lap-4 (xnet)
        tmpfile="/tmp/$$.startax3.pts"
        kissnetd -p 2 > "$tmpfile" &
        sleep 2
        attachthem () {
                read PTS1 PTS2
                kissattach -l $PTS1 ax3 44.137.31.73
                ifconfig ax3 44.137.31.73 netmask 255.255.255.224 up
                sleep 1
                sed -i "s,attach sdev4 kiss 4 1 19200 /dev/.*$,attach sdev4 kiss 4 1 19200 $PTS2," /usr/local/xnet/AUTOBOOT.NET
        }

        tail -n 1 $tmpfile | attachthem
        rm $tmpfile
        sleep 3

        # create slip link Linux <-> Xnet
        socat -d -d -ly PTY,link=/dev/ttyq1 PTY,link=/dev/ptyq1 &
        sleep 2
                slattach -s 38400 -p slip /dev/ptyq1 &
                sleep 1
                ifconfig sl0 44.137.31.69 netmask 255.255.255.255 pointopoint 44.137.31.70 mtu 236 up
                sleep 1

        # create axudp device
        socat -d -d -ly PTY,link=/dev/ttyq2 PTY,link=/dev/ptyq2 &
        sleep 2
                kissattach -m 256 /dev/ptyq2 ax4 44.137.31.73
                ax25udp -c /etc/ax25/ax25ipd-10093.conf > /tmp/axudp
                ifconfig ax4 44.137.31.73 netmask 255.255.255.224 up
        sleep 1

        # create axip device
        socat -d -d -ly PTY,link=/dev/ttyq3 PTY,link=/dev/ptyq3 &
        sleep 2
                kissattach -m 256 /dev/ptyq3 ax5 44.137.31.73
                ax25ipd -c /etc/ax25/ax25ipd-axip.conf > /tmp/axip
                ifconfig ax5 44.137.31.73 netmask 255.255.255.224 up
        sleep 1

        # create socat device (jnos-uro)
        socat -d -d -ly PTY,link=/dev/ttyq4 PTY,link=/dev/ptyq4 &
        sleep 2
                kissattach -m 256 /dev/ptyq4 ax6 44.137.31.73
                ifconfig ax6 44.137.31.73 netmask 255.255.255.224 up
        sleep 1

        # MFnos running in DOSEmu
        # Set the comport in de file /etc/dosemu/dosemu.comf $_com1 = "dev/ttyq5"
        #socat -d -d -ly PTY,link=/dev/ttyq5 PTY,link=/dev/ptyq5 &
        #       slattach -n -q -p slip -s 38400 /dev/ptyq5 &
        #sleep 2
        # KISS inteface for MFnos / slip
        #       kissattach /dev/ptyq5 ax6 44.137.31.73
        #       kissparms -p ax6 -c 1 -f y -t 10 -s 100 -r 255
        #       axparms -setcall ax6 pi1lap-10
        #
        #       ifconfig ax3 44.88.0.9 netmask 255.255.255.224 up
        #sleep 2

        # create nr0 device (lapuro/pi1lap-5) uronode
                ifconfig nr0 down
                nrattach -i 44.137.31.73 -m 512 nr0
                ifconfig nr0 44.137.31.73 netmask 255.255.255.224 hw netrom PI1LAP-5 up

        # create nr1 device (lapbbs/pi8lap) f6fbb
                ifconfig nr1 down
                nrattach -i 44.137.31.73 -m 512 nr1
                ifconfig nr1 44.137.31.73 netmask 255.255.255.224 hw netrom PI8LAP up

        # create nr2 device (lapdx/pi1lap-4) dxspider
                ifconfig nr2 down
                nrattach -i 44.137.31.73 -m 512 nr2
                ifconfig nr2 44.137.31.73 netmask 255.255.255.224 hw netrom PI1LAP-4 up

        # create nr3 device (lappac/pi1lap-7) fpac
                ifconfig nr3 down
                nrattach -i 44.137.31.73 -m 512 nr3
                ifconfig nr3 44.137.31.73 netmask 255.255.255.224 hw netrom PI1LAP-7 up

        # start xnet
        cd /usr/local/xnet
        rm *.CFG &> /dev/null
        sleep 2
        ./linuxnet < /dev/tty2 > /dev/tty2 2>&1 &
        ./rstatrxd /var/www/cgi-bin/postat/ &> /dev/null &
        sleep 2

        # route
        # Xnet route
        ip route add 44.137.31.70 dev sl0 table 44 src 44.137.31.69
        # Mfnos route to 192.168.1.110
        #route add 44.137.31.75 gw 192.168.1.112

        # beacons
        beacon -c PI1LAP-15 -t 10 -d  ID ax0 "Network node PI1LAP-15 Zeeland, JO11VN" &
        beacon -c PI1LAP-15 -t 10 -d  ID ax1 "Network node PI1LAP-15 Zeeland, JO11VN" &
        beacon -c PI1LAP-15 -t 10 -d  ID ax2 "Network node PI1LAP-15 Zeeland, JO11VN" &
        beacon -c PI1LAP-15 -t 10 -d  ID ax3 "Network node PI1LAP-15 Zeeland, JO11VN" &

        # start ax25 deamons
        /usr/local/sbin/ax25d
        /usr/local/sbin/mheardd
        /usr/local/sbin/ax25rtd
        /usr/local/sbin/flexd
        /usr/local/sbin/netromd -c -i -p 1 -t 15
        fbb -s -a -l /etc/ax25/fbb.log

ax25ipd-axip.conf

On my system i use axip and axudp. I start ax25ipd twice with different configuration files.

Example for a axip port

Start
ax25ipd -c /etc/ax25/ax25ipd-axip.conf

# ax25ipd configuration file Axip
#
socket ip
mode tnc
mycall pi1lap-9
device /dev/ttyq3
speed 19200
#
# loglevel 0 - no output
# loglevel 1 - config info only
# loglevel 2 - major events and errors
# loglevel 3 - major events, errors, and AX25 frame trace
# loglevel 4 - all events
# log 0 for the moment, syslog not working yet ...
#
loglevel 2
broadcast NODES

route n1uro 44.x.x.x b
route pi1bdg 44.x.x.x b