Asterisk Data Configuration


Zaptel PRI cards (T100P, E100P, T400P, TE405P, TE410P) can be configured for data (HDLC "family") communication (WAN router), as well as hybrid configurating where some T1/E1 timeslots will be used for data and others for voice communication.

This page is designed to help all people to share experience.

You should use the channel keyword nethdlc in zaptel.conf. After running ztcfg, a new network interface will be created. sethdlc (or rather: sethdlc-new) will allow you to control it.

Example 1:

Cisco HDLC protocol, T1, all 24 timeslots used for data span.

=== /etc/zaptel.conf

loadzone = us
defaultzone=us

span=1,1,0,esf,b8zs

nethdlc=1-24,hdlc0

  1. /sbin/modprobe zaptel
  2. /sbin/modprobe wct1xxp
  3. /sbin/ztcfg -vvv
  4. /sbin/sethdlc hdlc0 cisco
  5. /sbin/ifconfig hdlc0 ${WAN_LOCAL_IP} pointopoint ${WAN_REMOTE_IP}
  6. /sbin/route add -net ${WAN_NET} netmask ${WAN_NETMASK} hdlc0
  7. /sbin/route add default gw ${WAN_REMOTE_IP} metric 1 hdlc0

Comment: Everything works with kernels below 2.4.20, thereafter Cisco HDLC is broken in Zaptel driver.

sethdlc utility is included in zaptel driver and available in 2 versions - sethdlc & sethdlc-new, where the first for kernels up to 2.4.20 and second - for all above.

The source code of sethdlc utility available at Generic HDLC layer for Linux

=====

June 05, 2004


I was able to successfully compile and configure Zaptel driver for Cisco HDLC on Linux 2.4.26, Slackware 9.1.
A vanilla 2.4.26 kernel from www.kernel.org used.

Kernel options for HDLC:
# Wan interfaces
CONFIG_WAN=y
CONFIG_HDLC=m
CONFIG_HDLC_RAW=y
CONFIG_HDLC_RAW_ETH=y
CONFIG_HDLC_CISCO=y

Zeptel code based on HEAD CVS (June 04, 2004)
zconfig.h:
  1. #define CONFIG_ZAPTEL_MMX /* used Pentium 3 as router, so enabling MMX */
  2. #define CONFIG_HDLC
  3. #define CONFIG_PPP

zaptel.c:
changed block:
#if 0
skb->protocol = hdlc_type_trans(skb, &ms->hdlcnetdev->netdev.netdev);
#else
skb->protocol = htons (ETH_P_HDLC);
#endif
to next block of the code:
#if 1
skb->protocol = hdlc_type_trans(skb, &ms->hdlcnetdev->netdev.netdev);
#else
skb->protocol = htons (ETH_P_HDLC);
#endif



# WAN Interface (T1)
/sbin/modprobe zaptel
/sbin/modprobe wct1xxp
/sbin/ztcfg -vvv
/sbin/modprobe hdlc


# Set up the hdlc0 interface:
/sbin/sethdlc-1.15 hdlc0 cisco
/sbin/ifconfig hdlc0 ${WAN_IPADDR_LOCAL_0} pointopoint ${WAN_IPADDR_REMOTE_0}
/sbin/route add -net ${WAN_NETWORK_0} netmask ${WAN_NETMASK_0} dev hdlc0
  1. Done set up the hdlc0 interface:

# Set up the gateway:
/sbin/route add default gw ${GATEWAY} netmask 0.0.0.0 metric 1 dev hdlc0


Index: zaptel.c
================================================================
RCS file: /usr/cvsroot/zaptel/zaptel.c,v
retrieving revision 1.76
diff -r1.76 zaptel.c
5500c5500
< #if 0

> #if 1
Index: zconfig.h
=============================================================
RCS file: /usr/cvsroot/zaptel/zconfig.h,v
retrieving revision 1.6
diff -r1.6 zconfig.h
41c41
< /* #define CONFIG_ZAPTEL_MMX */

> #define CONFIG_ZAPTEL_MMX
57a58,60
> #define CONFIG_HDLC
> #define CONFIG_PPP
>
95c98
< /* #define CONFIG_ZAPTEL_WATCHDOG */

> #define CONFIG_ZAPTEL_WATCHDOG



============================================

October 6, 2004


I have HDLC/Zaptel working on a Nuvox data/voice PRI with a T100P on Slackware 10
using the 2.4.26 kernel. I believe my configuration is different enough from the above
instructions to warrant this addition to the Wiki.

Like above, these settings are required in your kernel compilation.
CONFIG_WAN=y
CONFIG_HDLC=y
CONFIG_HDLC_RAW=y
CONFIG_HDLC_RAW_ETH=y
CONFIG_HDLC_CISCO=y

I used zaptel version 1.0.0, and uncommented these sections in zconfig.h
after recompiling the kernel:

  1. if defined(CONFIG_HDLC) || defined(CONFIG_HDLC_MODULE)
/* #define CONFIG_ZAPATA_NET */
to
  1. if defined(CONFIG_HDLC) || defined(CONFIG_HDLC_MODULE)
  2. define CONFIG_ZAPATA_NET

/* #define CONFIG_ZAPATA_NET */
to
  1. define CONFIG_ZAPATA_NET

/* #define CONFIG_ZAPATA_PPP */
to
  1. define CONFIG_ZAPATA_PPP

/* #define CONFIG_ZAPTEL_WATCHDOG */
to
  1. define CONFIG_ZAPTEL_WATCHDOG


edit your zapata.conf file, and be sure you
include nethdlc=(dso data channels).
Here's mine for an example, which is
configured for a T100P & TDM400P with a single FXS module.

span=0,0,0,esf,b8zs
nethdlc=20-23
fxsks=1-11
loadzone=us
defaultzone=us
fxoks=25

run ztcfg, and look for any check for errors.

If there are no errors, the following commands should bring
up your network.
sethdlc hdlc0 cisco
sethdlc hdlc0 fr lmi ansi
sethdlc hdlc0 create 100 (your dlci may be a different number)
ifconfig hdlc0 up
ifconfig pvc0 {WAN_LOCAL_IP} pointopoint {WAN_REMOTE_IP}
route add default gateway {WAN_REMOTE_IP} dev pvc0

I placed these commands in rc.local (don't forget to add the paths)
and set:
GATEWAY=""
in rc.inet1.conf if you are using slackware like myself.


Not sure if this is the right or best way to do this, but it worked great for me.
Your milage may vary.

=========

Nov. 2, 2005


Additional settings example using kernel 2.4.28

This worked with a cisco router connected to the T1(PRI) from the provider. Even though their router was a cisco we could not get
it to work using cisco hdlc. We were told by the provider that the system was a cisco un-numbered interface. The following
settings worked great however.

/usr/src/asterisk/zaptel/sethdlc-new hdlc0 ppp
/sbin/ifconfig hdlc0 {GATEWAY_IP} netmask {LOCAL_NETMASK}
/sbin/route add default gateway {GATEWAY_IP} dev hdlc0

See also



Zaptel PRI cards (T100P, E100P, T400P, TE405P, TE410P) can be configured for data (HDLC "family") communication (WAN router), as well as hybrid configurating where some T1/E1 timeslots will be used for data and others for voice communication.

This page is designed to help all people to share experience.

You should use the channel keyword nethdlc in zaptel.conf. After running ztcfg, a new network interface will be created. sethdlc (or rather: sethdlc-new) will allow you to control it.

Example 1:

Cisco HDLC protocol, T1, all 24 timeslots used for data span.

=== /etc/zaptel.conf

loadzone = us
defaultzone=us

span=1,1,0,esf,b8zs

nethdlc=1-24,hdlc0

  1. /sbin/modprobe zaptel
  2. /sbin/modprobe wct1xxp
  3. /sbin/ztcfg -vvv
  4. /sbin/sethdlc hdlc0 cisco
  5. /sbin/ifconfig hdlc0 ${WAN_LOCAL_IP} pointopoint ${WAN_REMOTE_IP}
  6. /sbin/route add -net ${WAN_NET} netmask ${WAN_NETMASK} hdlc0
  7. /sbin/route add default gw ${WAN_REMOTE_IP} metric 1 hdlc0

Comment: Everything works with kernels below 2.4.20, thereafter Cisco HDLC is broken in Zaptel driver.

sethdlc utility is included in zaptel driver and available in 2 versions - sethdlc & sethdlc-new, where the first for kernels up to 2.4.20 and second - for all above.

The source code of sethdlc utility available at Generic HDLC layer for Linux

=====

June 05, 2004


I was able to successfully compile and configure Zaptel driver for Cisco HDLC on Linux 2.4.26, Slackware 9.1.
A vanilla 2.4.26 kernel from www.kernel.org used.

Kernel options for HDLC:
# Wan interfaces
CONFIG_WAN=y
CONFIG_HDLC=m
CONFIG_HDLC_RAW=y
CONFIG_HDLC_RAW_ETH=y
CONFIG_HDLC_CISCO=y

Zeptel code based on HEAD CVS (June 04, 2004)
zconfig.h:
  1. #define CONFIG_ZAPTEL_MMX /* used Pentium 3 as router, so enabling MMX */
  2. #define CONFIG_HDLC
  3. #define CONFIG_PPP

zaptel.c:
changed block:
#if 0
skb->protocol = hdlc_type_trans(skb, &ms->hdlcnetdev->netdev.netdev);
#else
skb->protocol = htons (ETH_P_HDLC);
#endif
to next block of the code:
#if 1
skb->protocol = hdlc_type_trans(skb, &ms->hdlcnetdev->netdev.netdev);
#else
skb->protocol = htons (ETH_P_HDLC);
#endif



# WAN Interface (T1)
/sbin/modprobe zaptel
/sbin/modprobe wct1xxp
/sbin/ztcfg -vvv
/sbin/modprobe hdlc


# Set up the hdlc0 interface:
/sbin/sethdlc-1.15 hdlc0 cisco
/sbin/ifconfig hdlc0 ${WAN_IPADDR_LOCAL_0} pointopoint ${WAN_IPADDR_REMOTE_0}
/sbin/route add -net ${WAN_NETWORK_0} netmask ${WAN_NETMASK_0} dev hdlc0
  1. Done set up the hdlc0 interface:

# Set up the gateway:
/sbin/route add default gw ${GATEWAY} netmask 0.0.0.0 metric 1 dev hdlc0


Index: zaptel.c
================================================================
RCS file: /usr/cvsroot/zaptel/zaptel.c,v
retrieving revision 1.76
diff -r1.76 zaptel.c
5500c5500
< #if 0

> #if 1
Index: zconfig.h
=============================================================
RCS file: /usr/cvsroot/zaptel/zconfig.h,v
retrieving revision 1.6
diff -r1.6 zconfig.h
41c41
< /* #define CONFIG_ZAPTEL_MMX */

> #define CONFIG_ZAPTEL_MMX
57a58,60
> #define CONFIG_HDLC
> #define CONFIG_PPP
>
95c98
< /* #define CONFIG_ZAPTEL_WATCHDOG */

> #define CONFIG_ZAPTEL_WATCHDOG



============================================

October 6, 2004


I have HDLC/Zaptel working on a Nuvox data/voice PRI with a T100P on Slackware 10
using the 2.4.26 kernel. I believe my configuration is different enough from the above
instructions to warrant this addition to the Wiki.

Like above, these settings are required in your kernel compilation.
CONFIG_WAN=y
CONFIG_HDLC=y
CONFIG_HDLC_RAW=y
CONFIG_HDLC_RAW_ETH=y
CONFIG_HDLC_CISCO=y

I used zaptel version 1.0.0, and uncommented these sections in zconfig.h
after recompiling the kernel:

  1. if defined(CONFIG_HDLC) || defined(CONFIG_HDLC_MODULE)
/* #define CONFIG_ZAPATA_NET */
to
  1. if defined(CONFIG_HDLC) || defined(CONFIG_HDLC_MODULE)
  2. define CONFIG_ZAPATA_NET

/* #define CONFIG_ZAPATA_NET */
to
  1. define CONFIG_ZAPATA_NET

/* #define CONFIG_ZAPATA_PPP */
to
  1. define CONFIG_ZAPATA_PPP

/* #define CONFIG_ZAPTEL_WATCHDOG */
to
  1. define CONFIG_ZAPTEL_WATCHDOG


edit your zapata.conf file, and be sure you
include nethdlc=(dso data channels).
Here's mine for an example, which is
configured for a T100P & TDM400P with a single FXS module.

span=0,0,0,esf,b8zs
nethdlc=20-23
fxsks=1-11
loadzone=us
defaultzone=us
fxoks=25

run ztcfg, and look for any check for errors.

If there are no errors, the following commands should bring
up your network.
sethdlc hdlc0 cisco
sethdlc hdlc0 fr lmi ansi
sethdlc hdlc0 create 100 (your dlci may be a different number)
ifconfig hdlc0 up
ifconfig pvc0 {WAN_LOCAL_IP} pointopoint {WAN_REMOTE_IP}
route add default gateway {WAN_REMOTE_IP} dev pvc0

I placed these commands in rc.local (don't forget to add the paths)
and set:
GATEWAY=""
in rc.inet1.conf if you are using slackware like myself.


Not sure if this is the right or best way to do this, but it worked great for me.
Your milage may vary.

=========

Nov. 2, 2005


Additional settings example using kernel 2.4.28

This worked with a cisco router connected to the T1(PRI) from the provider. Even though their router was a cisco we could not get
it to work using cisco hdlc. We were told by the provider that the system was a cisco un-numbered interface. The following
settings worked great however.

/usr/src/asterisk/zaptel/sethdlc-new hdlc0 ppp
/sbin/ifconfig hdlc0 {GATEWAY_IP} netmask {LOCAL_NETMASK}
/sbin/route add default gateway {GATEWAY_IP} dev hdlc0

See also


Created by: rublev, Last modification: Thu 17 of Jul, 2008 (20:12 UTC) by JustRumours
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+