The speedtouch 780 is a DSL modem combined with a 4 port managed switch/router, 1 FXO and 2 FXS. One great thing
about this modem is that it is possible to telnet on the device and get access to a CLI. Using the CLI, one can
achieve great things with this piece of hardware.
The specs will say that the FXO is a "Full-Mode" FXO. I don't know what they mean by that, but I was very disapointed
when I used it. The FXO does not register itself with a PBX. Meaning that it is impossible to use it for placing
outgoing calls or to receive calls using Asterisk (for example). You can setup a dialplan (in the device) that will
allow certain numbers to be dialed directly on the FXO (i.e: 911) using the FXS ONLY! The FXO can also be used
as a Fallback (for the FXS only) if registration with the PBX failed. It is then impossible to use the ST780 for
PSTN access with Asterisk. For that purpose, I am using a SPA3102
Configuration
This is just a sample of what I have. You will find the things I found to be the most usefull.
DHCP Pool
Before configuring this, make sure no one has a lease. In this example I am adding a pool named LAN_private. The addresses will be assigned on the interface LocalNetwork. Specifying the interface is very usefull when using several VLANs.
:dhcp server lease flush
:dhcp server pool config name=LAN_private intf=LocalNetwork poolstart=192.168.1.101 poolend=192.168.1.254 gateway=192.168.1.1 leasetime=21600 primdns=192.168.1.3 secdns=192.168.1.1
VLANs
This was hard to figure out. The way I am setup, I have two different VLANs. One which is the default VLAN (untagged) and the other one is tagged with ID 3. I have a Dell PowerConnect 3348 switch which has 24 port that belong in the untagged VLAN and the other 24 in VLAN3. Traffic comming from/goint to the switch for the untagged VLAN is plugged on ethernet port 1 of the st780. Traffic for VLAN 3 is also connected to ethernet port 1. The trunk comming from the switch thus transports both VLANs. I have two different DHCP pools for each VLAN so that they can be assigned different addresses in two distinct subnets.
I don't fully understand all this. All I know is that it works. I have searched everywhere and only found bits of information about that particular setup. I figured everything out by trying different stuff until it worked and trying to understand how to connect the dots between different setup I saw on other sites. Please feel free to contact me to inform me of any mistake I did here or to give me advices.
; Create vlan #3 named vlan3
:eth vlan add name=vlan3 vid=3
;Add the OBC interface in vlan3. disabling untagging will prevent the switch from stripping
; off the tag of the incomming frame on that interface. I think that the OBC interface is the interface
; on which the router resides. If you don't add this interface in the VLAN, you won't be able to ping to router.
:eth bridge vlan ifadd name=vlan3 intf=OBC untagged=disabled
;Add the ethernet port 1 in the vlan #3. We want to preserve the VLAN tag. Untagged frames will be assigned
; the default VLAN (VLAN ID 0)
:eth bridge vlan ifadd name=vlan3 intf=ethport1 untagged=disabled
; Unttaged egress traffic on ethport1 will be tagged with VLAN ID "default" (0)
:eth bridge ifconfig intf=ethport1 vlan=default
; Create a new ethernet logical interface
:eth ifadd intf=eth_vlan3
; frames transmitted through this interface will be tagged with vlan3
:eth ifconfig intf=eth_vlan3 dest=bridge vlan=vlan3
;enable the interface (put it up)
:eth ifattach intf=eth_vlan3
; when using this ip interface, transmit using vlan3 logical ethernet interface. I'm not sure why I have to use the group "lan".
; if I don't use that group, it doesn't work.
:ip ifadd intf=ip_vlan3 dest=eth_vlan3 group=lan
:ip ifattach intf=ip_vlan3
; when using this subnet, use vlan3 ip interface.
:ip ipadd intf=ip_vlan3 addr=192.168.0.1/24
; Add a second DHCP pool for the 2nd vlan
:dhcp relay add name=relay_vlan3
:dhcp relay ifconfig intf=ip_vlan3 relay=enabled maxhops=4 trusted=disabled
:dhcp relay modify name=relay_vlan3 addr =127.0.0.1 intf =ip_vlan3 giaddr =192.168.0.1
I might be wrong here, but this is the way I understand it: When a frame comes in on an ethernet interface, it VLAN ID is looked at and the frame is forwarded to every ethernet port that belongs to that VLAN. When transmitting a packet on the 192.168.0.0 subnet, the IP interface ip_vlan3 will be used. ip_vlan3 uses the logical ethernet interface eth_vlan3. When a frame is transmitted on eth_vlan3, it will be tagged with VLAN vlan3. Since ethport1 is a member of vlan3, the frame will be forwarded on it.
Port Forwarding
This is one of the easyest thing. No explanation needed here
nat mapadd intf=Internet inside_addr=192.168.0.3 inside_port=5060-5062 outside_port=5060-5062
SIP
My st780 is setup to register both FXS ports on my Asterisk PBX.
; Disable the service already provided by the device
:connection appconfig application=SIP SIP_ALG=disabled
:voice config digitrelay=rfc2833 rtp_portrange=10000-10100
;FIRST: delete current profiles
:voice profile add SIP_URI=username username=username password=your_password voiceport=FXS1
; 192.168.0.2 is the address of the PBX
:voice sip config useragentdomain=192.168.0.2 primproxyaddr=192.168.0.2 primregaddr=192.168.0.2
:service system modify name=VOIP_SIP state=enabled port=5060
;allow 2000ms between each DTMF before assuming that dialing is completed.
:voice fxsport config interdigitOpen=2000 interdigit=2000
; When a call comes in on the FXO, don't forward it anywhere. You could forward it to one of the FXS, but
; not to your PBX unfortunately
:voice fxoport config incfxodest=none
; the voice interface should use the ip interface ip_vlan3
:voice config intf = ip_vlan3
; any number between 3 and 14 digits long must be forwarded to the PBX without being altered. If VOIP cannot be accessed, (PBX down,
power failure, ...) use FXO
:voice dialplan add prefix=0-8 defaultport=Voip fallbackport=FXO priority=Low fallback=enabled minimumdigits=3 maximumdigits=14 posofmodify=0 remnumdigits=0 rescan=no action=none
; 911 must be forwarded on the FXO directly
:voice dialplan add prefix=911 defaultport=FXO fallbackport=FXO priority=High fallback=enabled minimumdigits=3 maximumdigits=3 posofmodify=0 remnumdigits=0 rescan=no action=none
The other day, my PBX was down. I noticed that every outgoing calls were automatically sent on the FXO instead of the PBX. This is the way I want it (because of the "fallback" option). The odd thing was that incomming calls were not forwarded from the FXO to the FXS. This is one thing I will have to figure out.