
echo
echo "Configuring AX.25 networking..."

# Clear logged-in files...
> /var/ax25/node/loggedin
> /var/ax25/pms/loggedin

echo "Attaching ax.25 interfaces..."

# Radio interfaces:
/usr/sbin/kissattach /dev/ttyS0 144
/usr/sbin/kissattach /dev/ttyS1 433
/usr/sbin/kissattach /dev/ttyS3 9k6

# RS-232 line to Clusse, through the mkiss daemon
/usr/sbin/kissattach /dev/ptyqa cl0
/usr/sbin/kissattach /dev/ptyqb cl1
/usr/sbin/kissattach /dev/ptyqc cl2

# RS-232 line to FBB, through the mkiss daemon
/usr/sbin/kissattach /dev/ptypa mk0
/usr/sbin/kissattach /dev/ptypb mk1
/usr/sbin/kissattach /dev/ptypc mk2
/usr/sbin/kissattach /dev/ptypd mk3

# For the ax25ip daemon
/usr/sbin/kissattach /dev/ptypf ip1

# Net/rom interface for the node
/usr/sbin/nrattach nr0

cd /etc/ax25 
/usr/sbin/ax25ip &

echo "Starting mkiss daemons..."
# Clusse
/usr/sbin/mkiss -c -s 19200 /dev/ttyS2 /dev/ttyqa /dev/ttyqb /dev/ttyqc
# fbb
/usr/sbin/mkiss -c -s 9600 /dev/ttyS4 /dev/ttypa /dev/ttypb /dev/ttypc /dev/ttypd

# For the ipip daemon....
/sbin/slattach -s 38400 -p slip /dev/ptype &

/usr/bin/sleep 10

echo -n "Ifconfig..."

/sbin/ifconfig sl0 44.139.39.8 netmask 255.255.255.0 mtu 230 
/sbin/ifconfig sl1 44.139.39.8 netmask 255.255.255.0 mtu 230 broadcast 44.139.39.255
/sbin/ifconfig sl2 44.139.39.8 netmask 255.255.255.0 mtu 230 broadcast 44.139.39.255
/sbin/ifconfig sl3 44.139.39.8 netmask 255.255.255.0 mtu 230
/sbin/ifconfig sl4 44.139.39.8 netmask 255.255.255.0 mtu 230
/sbin/ifconfig sl5 44.139.39.8 netmask 255.255.255.0 mtu 230
/sbin/ifconfig sl6 44.139.39.8 netmask 255.255.255.0 mtu 230
/sbin/ifconfig sl7 44.139.39.8 netmask 255.255.255.0 mtu 230
/sbin/ifconfig sl8 44.139.39.8 netmask 255.255.255.0 mtu 230
/sbin/ifconfig sl9 44.139.39.8 netmask 255.255.255.0 mtu 230
/sbin/ifconfig sl10 44.139.39.8 netmask 255.255.255.0 mtu 230
/sbin/ifconfig sl11 44.139.39.8 netmask 255.255.255.0 mtu 1024 broadcast 44.139.39.255

/sbin/ifconfig nr0 44.139.39.8 netmask 255.255.255.0 mtu 210 hw netrom OH7RBA-4

# Once upon a time i tried the ipip tunnel device..
#/sbin/ifconfig tunl0 44.139.39.8 pointopoint 193.166.55.160 netmask 255.255.255.0 mtu 1024 broadcast 44.139.39.255
#/sbin/ifconfig tunl1 44.139.39.8 pointopoint 192.98.38.196 netmask 255.255.255.0 mtu 1024 broadcast 44.139.39.255

echo " Done."

/usr/bin/sleep 5

echo -n "IP routes..."
/sbin/route add -net 44.139.39.0 netmask 255.255.255.0 dev sl1
/sbin/route add -host 44.139.39.250 dev sl2
/sbin/route add -host 44.139.39.249 gw 44.139.39.250
/sbin/route add -host 44.139.39.251 gw 44.139.39.250
/sbin/route add -host 44.139.39.6 dev sl11
/sbin/route add -host 44.139.39.2 dev sl11
/sbin/route add -net 44.0.0.0 netmask 255.0.0.0 dev sl11
echo " Done."

echo -n "Restoring NET/ROM route and node tables..."
/etc/rc.d/rc.nodes
echo " Done."

echo -n "AX.25 parameters..."
# These parameters are lousy, don't use them, i haven't had the opportunity
# to find good ones....
/usr/sbin/axparms -parms 144 -t1 10 -t2 4 -t3 1200 -idle 30 -window 3
/usr/sbin/axparms -parms 433 -t1 10 -t2 4 -t3 1200 -idle 30 -window 3
/usr/sbin/axparms -parms 9k6 -t1 4 -t2 1 -t3 1200 -idle 30 -window 2
/usr/sbin/axparms -parms ip1 -t1 4 -t2 1 -t3 300 -idle 30 -window 3

/usr/sbin/kissparms -p 9k6 -t 200
echo " Done."

/etc/rc.d/rc.ax25assoc

echo -n "AX.25 services:"

echo -n " rxecho"
/usr/sbin/rxecho

echo -n " netromd"
/usr/sbin/netromd -t 15

echo -n " ax25d"
/usr/sbin/ax25d

echo -n " mheardd"
/usr/sbin/mheardd

echo " - Done."
