Wanpipe Linux Driver Operation
- WAN Router Commands
- WANPIPE Environment Check
- WANPIPE Startup
- Error Debugging
- Kernel Driver Errors
- Line Errors and Driver Statistics
- Wanpipe Power User Operation
- Wanpipe Manual Startup
- Wanpipe External Scripts
At the heart of WANPIPE operation is the 'wanrouter' operation script. It is used to start/stop/restart and display WANPIPE current status and environment.
usage: /usr/sbin/wanrouter <command>
Usage: wanrouter: {options} <wanpipe#> <interface>
wanrouter start :
Starts all devices specified in /etc/wanpipe/wanrouter.rc WAN_DEVICES
wanrouter stop :
Stops all devices specified in/etc/wanpipe/wanrouter.rc WAN_DEVICES
wanrouter restart :
Restart all devices specified in/etc/wanpipe/wanrouter.rc WAN_DEVICES
wanrouter start wanpipe# :
Start a single device
wanrouter stop wanpipe# :
Stops a single device
wanrouter restart wanpipe# :
Restart a single device
wanrouter start wanpipe# if_name:
Start a single interface on device
wanrouter stop wanpipe# if_name:
Stops a single interface on device
wanrouter restart wanpipe# if_name :
Restart a single interface on device
wanrouter list :
List all active devices
wanrouter modules:
Show wanpipe kernel modules
wanrouter status:
Display status for all active devices
wanrouter summary:
summary of config files in /etc/wanpipe
wanrouter hwprobe:
Display wanpipe hardware probe info.
wanrouter debug:
Check current wanpipe environment.
Wanpipe startup debugging. After a startup error run this command to get a possible solution
i.e. wanrouter start; wanrouter debug;
wanrouter debug if_name :
Display common debugging statistics.
In case of line problems save to file, wait 2-5min and send to Sangoma Tech Support
i.e. wanrouter debug wp1fr16 > debug_file
wanrouter conflogs:
Display wanpipe configuration syntax errors
i.e. /var/log/wanrouter
wanrouter messages:
Display wanpipe kernel event messages
i.e. /var/log/messages
wanrouter version:
wanpipe version information.
WANPIPE Environment Check
The wanrouter debug option will check current wanpipe environment, make sure that kernel modules do load, and that /var/log/messages and /var/log/wanrouter logs do not show any errors. It will also try
to give possible solutions.
/usr/sbin/wanrouter debug
Make sure that the new WANPIPE kernel modules have been installed correcty and that they can be loaded into the kernel, and the hardware is detected.
/usr/sbin/wanrouter hwprobe
Check that a configuration file exists in /etc/wanpipe directory
/usr/sbin/wanrouter summary
Make sure that no WANPIPE devices are currently running on the system
/usr/sbin/wanrouter list
WANPIPE Startup
Please note that all kernel driver output messages are located in /var/log/messages file.
Run 'tail -f /var/log/messages' in a separate console window, to monitor WANPIPE start/stop and operation messages.
To start/stop/restart WANPIPE devices listed in
/etc/wanpipe/wanrouter.rc file: (default is wanpipe1)
/usr/sbin/wanrouter start
/usr/sbin/wanrouter stop
/usr/sbin/wanrouter restart
To start/stop/restart single wanpipe device: (eg: wanpipe2)
This command is useful when running multiple devices and would like to operate on a singe device.
/usr/sbin/wanrouter start wanpipe2
/usr/sbin/wanrouter stop wanpipe2
/usr/sbin/wanrouter restart wanpipe2
To start/stop/restart a single network interface from a /etc/wanpipe/wanpipe1.conf configuration file:
This command is useful when adding an extra frame relay DLCI. Also to reconfigure a single DLCI.
/usr/sbin/wanrouter start wanpipe2 wp2_fr18
/usr/sbin/wanrouter stop wanpipe2 wp2_fr18
/usr/sbin/wanrouter restart wanpipe2 wp2_fr18
To view current status and configuration of active devices:
/usr/sbin/wanrouter status
After a failed wanrouter start command run:
wanrouter debug
The debug option will identify an error and offer solutions.
Configuration Syntax Errors:
All configuration file syntax errors, generated during WANPIPE starup, will be displayed in:
/var/log/wanrouter
(eg: cat /var/log/wanrouter)
Kernel Driver Errors
All device driver errors and events will be displayed in:
/var/log/messages
(eg: tail -f /var/log/messages)
Line Errors and Driver Statistics
After a successful WANPIPE startup any extra debugging, such as line tracing or CSU/DSU debugging will be done using:
/usr/sbin/wanpipemon -g
For automated Line Error debugging run
/usr/sbin/wanrouter debug <if_name>
where <if_name> is wanpipe interface name.
Wanpipe package contents
1. Wanpipe Kernel Drivers
The drivers are listed in order of dependency.
sdladrv.o : Hardware Layer
wanrouter.o : Wanpipe Protocol Interface Layer
wanpipe_syncpp.o : Wanpipe PPP/CHDLC Protocol
wanpipe.o : Wanpipe multi-protocol layer
(Frame-Relay,PPP,CHDLC,...)
af_wanpipe.o : Wanpipe API socket layer
2. User space programs
2.1 Configuration (/usr/sbin)
wancfg: Wanpipe configuration tool
cfgft1: Wanpipe FT1 config tool for S508FT1 and S5143 cards
(For all other cards use wancfg)
2.2 Operation (/usr/sbin)
wanconfig
Wanpipe operation tool that parses the config file and executed config ioctl() calls to the kernel driver.
wanconfig -a /etc/wanpipe/wan_adsl.list card wanpipe1 up
wanrouter
Wanpipe operation script used to start/stop/restart Wanpipe drivers. The wanrouter script uses the above wanconfig to start wanpipe as well as standard "ifconfig" to bring all necessary interfaces up.
2.3 Debugging/Monitoring
wanpipemon
Wanpipe debugging application used to debug the hardware, drivers and sync line.
Graphical Mode: wanpipemon -g
Raw trace: wanpipemon -i <if name> -c tr
Interpreted trace: wanpipemon -i <if name> -c ti
Alarms : wanpipemon -i <if name> -c Ta
Hardware echo canceller monitoring: wanpipemon -i <if name> -c ehw
Wanpipe Manual Startup
If a power user desn't want to use the wanrouter master script. Here is the break down of the wanpipe startup sequence:
wanrouter start
1. Load Kernel Modules
insmod sdladrv.o
insmod wanrouter.o
insmod wanpipe_syncppp.o
insmod wanpipe.o
insmod af_wanpipe.o
or
modprobe af_wanpipe
2. Configure and Start Drivers
If using ADSL
/usr/sbin/wanconfig -a /etc/wanpipe/wan_adsl.list card wanpipe1 up
else
/usr/sbin/wanconfig card wanpipe1 up
3. Start up all network interfaces
ifconfig wan0 <local ip> pointopoint <remote ip> netmask 255.255.255.255
4. Confirmation
tail -f /var/log/messages
5. Check the events and driver statistics.
cat /proc/net/wanrouter/status
6. Check driver state
wanrouter status
Wanpipe External Scripts
The wanrouter utility will also EXECUTE any external
script that is located in /etc/wanpipe/scripts directory.
Furthermore wanrouter utility will execute number of
scripts depending on what is being started or stopped.
Global Start/Stop Script
------------------------
Global Start : wanrouter start
Global Stop : wanrouter stop
Global Restart: wanrouter restart
Script Location: /etc/wanpipe/scripts
Start Script Name: start
Script "start" will execute after a sucessfull
"wanrouter start" command. The wanrouter start
command will start one or more configured
wanpipe devices.
Stop Script Name : stop
Script "stop" will execute after a sucessfull
"wanrouter stop" command. The wanrouter stop
command will stop one or more configured
wanpipe devices.
Device Start/Stop Script
------------------------
Device start : wanrouter start wanpipe1
Device stop : wanrouter stop wanpipe1
Device restart: wanrouter restart wanpipe1
Script Location: /etc/wanpipe/scripts
Start Script Name: wanpipe#-start Where #={1,2,3,4...}
Script "wanpipe1-start" will execute after:
-> Device Start
-> Global Start (if wanpipe1 is part of the start list)
Stop Script Name : wanpipe#-stop Where #={1,2,3,4...}
Script "wanpipe1-stop" will execute after:
-> Device Stop
-> Global Stop (if wanpipe1 is part of the start list)
Interface Start/Stop Script
---------------------------
Interface start : wanrouter start wanpipe1 w1g1
Interface stop : wanrouter stop wanpipe1 w1g1
Interface restart: wanrouter restart wanpipe1 w1g1
Script Location: /etc/wanpipe/scripts
Start Script Name: wanpipe1-w1g1-start
Script "wanpipe1-start-w1g1" will execute after:
-> Interface Start
-> Device Start
-> Global Start (if wanpipe1 is part of the start list)
Start Script Name: wanpipe1-w1g1-stop
Script "wanpipe1-stop-w1g1" will execute after:
-> Interface Stop
-> Device Stop
-> Global Stop (if wanpipe1 is part of the start list)
The bash script should be written as follows:
----------CUT----------------
#!/bin/sh
#Put shell script commands here
----------CUT-----------------