Modem VDSL Sagemcom F@ST2864
Modem loué par Bell (obligatoire) pour du VDSL.
TL;DR
** Ne marche plus sur les dernières versions du firmware :(
POUR LA NOUVELLE SOLUTION: Mettre pack.tar sur la racine d'un serveur tftp et exécuter sagemcom2.sh (voir commentaire plus bas)
POUR LA VIEILLE SOLUTION: Ne pas brancher le RJ11 dans le mur avant de faire ceci, un update de firmware va désactiver la possibilité de l'activer! Une fois un upgrade fait, si on reset, il n'est plus possible de l'activer, mais il devrait rester activé! Script pour activer telnet: sagemcom.sh
HARDWARE
128MB de RAM * cpu model : MIPS 24K V4.12 * BogoMIPS : 330.13
Obtenir un accès par telnet:
NOUVELLE SOLUTION:
Assurez vous d'avoir pack.tar sur la racine de votre serveur tftp, par exemple sous Debian, ce sera probablement:
/srv/tftp/pack.tar
Puis éxécuter le script suivant après avoir vérifié la récupération de pack.tar du serveur tftp et avoir changé le numéro de série de votre modem (et si vous voulez, les DNS, etc...):
#!/bin/bash # What host is running a tftp server? TFTP_SERVER=192.168.2.2 # What is the modem's address MODEM_ADDRESS=192.168.2.1 # What is your modem's serial number? SERIAL=NQ1234567890123 # which DNS servers do you want to use DNS1=8.8.4.4 DNS2=8.8.8.8 # Do you want to enable telnet (1 = yes, 0 = no)? ENABLE=1 # Login info LOGIN=admin:admin # Allow remote machines to access... Uncomment this if you need it. # iptables -I INPUT 1 -p udp --dport 69 -j ACCEPT # Ne marchait pas avec mon client tftp # Test retrieve the file #tftp $TFTP_SERVER -c get pack.tar /tmp/$$.tar #if [ ! -r /tmp/$$.tar ] #then #echo "Failed to retrieve file via tftp" 1>&2 #exit 1 #fi #rm -f /tmp/$$.tar # setup strPost="page=dns&action=submit&update=1&serial_num=$SERIAL&modedns=1&domainname=home&primarydns=$DNS1&secondarydns=$DNS2" strStep1="%22%20%24(tftp%20-g%20-r%20pack.tar%20-l%20%2Fmnt%2Fjffs2%2Fp.tar%20$TFTP_SERVER)%22" strStep2="%22%20%24(mkdir%20%2Ftmp%2Funlock)%20%24(tar%20-xf%20%2Fmnt%2Fjffs2%2Fp.tar%20-C%20%2Ftmp%2Funlock)%20%24(%2Ftmp%2Funlock%2Fr.sh%20$ENABLE)%22" h=http url="$h://$MODEM_ADDRESS" #Do the requests echo "Sending tftp request..." curl -u "$LOGIN" -d "$strPost$strStep1" "$url/index.cgi" > /tmp/step1 echo "Unpacking and installing..." curl -u "$LOGIN" -d "$strPost$strStep2" "$url/index.cgi" > /tmp/step2 echo "Process complete." echo "Try opening $url/stats/ to see if it worked."
NOTE: Peut geler vers la fin de l'envoie, mais telnet semble marcher. Par contre en quittant il ne m'a pas retourné à la console comme la vieille solution. Retourner dans vdsl semble le geler après une commande comme "11".
VIEILLE SOLUTION:
Download Config:
curl http://admin:admin@192.168.2.1/save_rg_conf.cgi > HomeGateway.conf
Edit Config :
Trouver la ligne:
(telnets(ports))
Remplacer par:
(telnets (ports (0 (port(23)) (ssl_mode(none)) (remote_access(0)) ) ) )
POST Config:
curl --data-urlencode new_rg_conf@HomeGateway.conf http://admin:admin@192.168.2.1/replace_rg_conf.cgi
Conect:
Utilisez telnet:
>telnet 192.168.2.1 Trying 192.168.2.1... Connected to 192.168.2.1. Escape character is '^]'. Username: admin Password: ***** HomeGateway>
Obtenir root et étendre le lien IP vers Bell:
HomeGateway> system shell Temporary setting log_level off BusyBox v1.01 (2005.09.07-07:38+0000) Built-in shell (ash) Enter 'help' for a list of built-in commands. # ifconfig ppp1 down
La lumière rouge devrait éventuellement s'allumer à côté du "@" (1-2 minutes), indiquant que votre connexion à Bell est rompue!
ie: vous êtes libéré de leur gestion! ;)
Caveat emptor: Au resync xDSL suivant la connexion ppp1 sera rétablie (voir TODO)
Vous pouvez entre temps remplacer le login: sc2864n par: test@test sans toucher le mot de passe et vous aurez un IP dans 10.x (non routable)
Pour obtenir les statistiques sur la ligne:
(commande vdsl avec mot de passe superikanos)
# vdsl Please enter console password: superikanos Supervisor mode BME Reference board API Menu Ikanos Communications Copyright 2000-2008 Version 9.2.0.12 VOX180 ========================================= 2) Initiate Reset BME command 3) Configure System Provision (default values) 4) Configure Port Provision 5) Initiate Port Start command 7) Initiate Port Stop command 9) Start Loopback Test 10) Request Brief Port Status 11) Request Extended Port Status 12) Display Performance Counters 13) Get Near End SNR Margin and Attenuation 15) Display User Logs 16) Clear User Logs 20) Display this menu 21) Modify Port Provision 31) INI CRC Threshold 41) Port Error Count Management 42) Event Log Management 55) Board Configuration Management 56) OAM Options Mask Setting 57) Performance Management Parameter Configuration 58) Trigger PM Failures 59) Bitloading Per Tone 62) GPIO Test 70) Maintenance Mode 72) VDSL2 Double Ended Loop Testing (DELT) 73) Freeze Mode 90) BME Firmware versions 91) EFM Pre-emption 99) Log off/ Go to auto mode 114) Clear Performance Counters 127) System training LED blink rate 131) VDSL CRC Threshold 140) Internal EOC Commands 141) Overhead Message Commands 143) Remote Ethernet Status Report 150) Bit Swap Commands 212) Display All Performance Counters cpe>
Pour obtenir les statistiques de votre connexion (exemple avec ADSL2 16/1):
cpe>11 cpe> Extended Port Status ================= Bme: 1 Port: 1 Downstream line rate: 29664 kbps Upstream line rate: 10932 kbps Bearer0 Downstream payload rate: 0 kbps Bearer1 Downstream payload rate: 26936 kbps Bearer0 Upstream payload rate: 0 kbps Bearer1 Upstream payload rate: 9512 kbps Downstream attainable payload rate: 65888 kbps Downstream attainable line rate: 77576 kbps Downstream Training Margin: 24.7 dB Downstream Line Protection (Bearer1 Path): 0.0 DMT Symbols Upstream Line Protection (Bearer1 Path): 0.0 DMT Symbols Near-end ITU Vendor Id: 0xb500494b4e530200 Far-end ITU Vendor Id: 0xb500494b4e530100 Downstream delay: 0.0 ms Upstream delay: 0.0 ms Tx total power -16.6 dbm FE Tx total power 14.2 dbm VDSL Estimated Loop Length : 877 ft G.Hs Estimated Near End Loop Length : 372 ft G.Hs Estimated Far End Loop Length :886 ft Current framing mode: 0x10 EFM Bandplan Type...........: 2 No. of Upstream Bands...: 2 No. of Downstream Bands.: 2 Line Type: 0x01000000 VDSL2 Profile 12A Downstream FFT Protection (Bearer1 Path): 0.0 DMT Symbols Upstream FFT Protection (Bearer1 Path): 0.0 DMT Symbols Upstream Line Attenuation: NA (Only for ADSL1 & T1.413) Upstream SNR Margin: NA (Only for ADSL1 & T1413) Upstream Retransmission status: Disabled Downstream Retransmission status: Disabled cpe>
...Amusez-vous...
TODO:
- comprendre qu'est ce qui fait quoi
- Dumper l'image cramfs / jffs2
- modifier les configurations par défaut et changer les logos de la page web

Liens utiles:
- http://www.dslreports.com/forum/r27703851-Sagemcom-F-st-2864-unlock-on-nix
- http://www.hardware.com.br/comunidade/sagemcom-hackeando/1238038/
- http://www.tripleoxygen.net/wp/2012/08/sagemcom-modem-fst-2764-gv-power-box-gvt-hacking-1/
- http://www.jungo.com/products/openrg-uniform-gateway-middleware/
- http://en.wikipedia.org/wiki/TR-069