Skip to content

Instantly share code, notes, and snippets.

@Fluepke
Created December 24, 2022 15:57
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fluepke/e8c215fd7530d642259ae03375375497 to your computer and use it in GitHub Desktop.
Save Fluepke/e8c215fd7530d642259ae03375375497 to your computer and use it in GitHub Desktop.
Vodafail

Vodafail

This will become a short tutorial on how to achieve higher bandwidth on a residential (german) Vodafone DOCSIS internet connection.

A flaw in Vodafone's modem activation process allows for simultanous operation of two modems on one contract:

  • Vodafone-owned CPE (e.g. "Vodafone Station")
  • Customer CPE (TC4400, Fritz?!Box 6660, etc.)

On a low-loaded DOCSIS 3.1 segment, I am able to achieve 1900 MBit/s download and 95 MBits/ upload bitrate by bundling both modems using MPTCP

Additionally uplinks (5G, (V/A/S/X/WTF)DSL) can be added to the MPTCP setup for better performance and availability.

TODO

  • automate modem activation (see modem.sh)
  • document VPN+MPTCP setup
#!/bin/bash
# A flaw in Vodafone's DOCSIS modem activation process allows
# for simultanous operation of two modems (their own CPE + your own).
#
# Combine two modems with MPTCP and get twice the datarate!
#
# Sometimes the customer's modem get's kicked out. This script
# helps with keeping it online by reactivating it.
# This script assumes a Fritz!Box Modem at 192.168.178.1 and
# the local system to have 192.168.178.2
CUSTOMER_ID="REDACTED"
ACTIVATION_CODE="REDACTED-XXXXX-XXXXX"
MAC="xx:xx:xx:xx:xx:xx" # Router WAN MAC
while true; do
dig +short -b 192.168.178.2 fluep.ke @192.168.178.1 | grep -q "kabelmodem"
if [ $? != 0 ]; then
echo "Modem needs no activation"
sleep 3
continue
fi
echo "Modem needs activation"
IP=$(dig +short -b 192.168.178.2 kabelmodemaktivieren.vodafone.de @192.168.178.1)
curl --interface 192.168.178.2 --resolve kabelmodemaktivieren.vodafone.de:443:$IP -i -s -k -X $'POST' \
-H $'Host: kabelmodemaktivieren.vodafone.de' -H $'Content-Length: 63' -H $'Sec-Ch-Ua: \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"108\"' -H $'Accept: application/json, text/plain, */*' -H $'Content-Type: application/json' -H $'Sec-Ch-Ua-Mobile: ?0' -H $'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.5359.99 Safari/537.36' -H $'Sec-Ch-Ua-Platform: \"Linux\"' -H $'Origin: https://kabelmodemaktivieren.vodafone.de' -H $'Sec-Fetch-Site: same-origin' -H $'Sec-Fetch-Mode: cors' -H $'Sec-Fetch-Dest: empty' -H $'Referer: https://kabelmodemaktivieren.vodafone.de/login' -H $'Accept-Language: en-US,en;q=0.9' -H $'Connection: close' \
--data-binary "{\"customerId\":\"$CUSTOMER_ID\",\"activationCode\":\"$ACTIVATION_CODE\"}" \
$'https://kabelmodemaktivieren.vodafone.de/api/v1/sessions/authCode' -c /tmp/cookies.txt
curl --interface 192.168.178.2 --resolve kabelmodemaktivieren.vodafone.de:443:$IP -i -s -k -X $'POST' \
-H $'Host: kabelmodemaktivieren.vodafone.de' -H $'Content-Length: 0' -H $'Sec-Ch-Ua: \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"108\"' -H $'Accept: application/json, text/plain, */*' -H $'Sec-Ch-Ua-Mobile: ?0' -H $'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.5359.99 Safari/537.36' -H $'Sec-Ch-Ua-Platform: \"Linux\"' -H $'Origin: https://kabelmodemaktivieren.vodafone.de' -H $'Sec-Fetch-Site: same-origin' -H $'Sec-Fetch-Mode: cors' -H $'Sec-Fetch-Dest: empty' -H $'Referer: https://kabelmodemaktivieren.vodafone.de/v1/activation' -H $'Accept-Language: en-US,en;q=0.9' -H $'Connection: close' -b /tmp/cookies.txt \
"https://kabelmodemaktivieren.vodafone.de/api/v1/devices/$MAC"
# Reconnect the Fritz?!Box via UPnP
curl -i "http://192.168.178.1:49000/igdupnp/control/WANIPConn1" \
-H "Content-Type: text/xml" \
-H "soapaction: urn:schemas-upnp-org:service:WANIPConnection:1#ForceTermination" \
-H "charset: utf8" \
-d '<?xml version="1.0" encoding="utf-8"?><s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><u:ForceTermination xmlns:u="urn:schemas-upnp-org:service:WANIPConnection:1"></u:ForceTermination></s:Body></s:Envelope>'
sleep 30
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment