Skip to content

Instantly share code, notes, and snippets.

@teknoraver
Last active April 18, 2024 10:02
Show Gist options
  • Star 35 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save teknoraver/9524e539061d0b1e9f8774aa96902082 to your computer and use it in GitHub Desktop.
Save teknoraver/9524e539061d0b1e9f8774aa96902082 to your computer and use it in GitHub Desktop.

Trashing the Vodafone Station

How to replace the Vodafone Station with your very own router

Vodafone forces its customers to use their modem/router, the "Vodafone Station": using any other router is impossible because authentication is being done via a custom PPPoE setup.
In the PPPoE packet there is a field named Host-Uniq which is used to separate packets from different PPPoE sessions: Vodafone requires the Station serial number to be put in this field as authentication.

Hardware setup

A Linux router with root access is needed to replace the Station with. With an xDSL connection a modem with a custom firmware like OpenWrt has to be used, most likely one based on a Lantiq SoC.
For a FTTH internet connection then every machine with at least two gigabit ethernet interface and a decent CPU will do it.

Software setup

PPPD by default puts its PID in the Host-Uniq field, while, as previously mentioned, Vodafone requires the Station serial number in it.
PPPD needs to be patched to set an arbitrary Host-Uniq field, but in decent distributions like Debian or OpenWrt the patch is already included.

Configuration

Line setup

Two separate WAN interfaces must be configured, for data and voice. The required setup depends on the connection type, ADSL, VDSL2 or FTTH.
With an ADSL connection you should use 10/36 as VPI/VCI for data, and 10/35 for voice, both of them configured with LLC encapsulation.
With a VDSL2 or FTTH connection you have to create two tagged VLANs with VID 1036 for data and 1035 for voice.

PPPoE

Once the ATM circuits or VLANs are configured, bring two PPPoE interfaces up for data and voice.
PPPoE configuration is a bit tricky because the Station serial number needs to be put in the Host-Uniq tag.
The serial number is in the form X12345678901234 where X is the Station manufacturer:

  • D ADB
  • C/S Sercomm
  • W Huawei

Convert it to hex:

$ echo -n X12345678901234 |xxd -ps
583132333435363738393031323334

and pass the argument host-uniq 583132333435363738393031323334 to PPPD to bringup the PPPoE connections.
In Debian it can be put globally in /etc/ppp/options or in the providers file in /etc/ppp/peers.
In OpenWrt then edit /etc/config/network and in the wan section add host_uniq=583132333435363738393031323334.

Data

The data PPPoE connection must use the Station serial number prepended with D- as username,
and something in the form of VJ|5.4.8.1.160.12.56.1.28|RA|CGN=1|pw=Vodafone as password, which means:

VJ stands for Vodafone Jungo (now OpenRG, the closed, crappy, monolithic, obsolete software inside the Station)
5.4.8.1.160.12.56.1.28 is the Station software version
RA don't really know
CGN=1 Carrier Grade Nat enabled
pw=Vodafone lol?

For example, in Debian a provider file this in /etc/ppp/peers/data will work:

persist
noauth
defaultroute
ifname pppoe-data
name D-X12345678901234
plugin rp-pppoe.so
host-uniq 583132333435363738393031323334
nic-eth0.1036

and add this line in /etc/ppp/pap-secrets:

D-X12345678901234       *       VJ|5.4.8.1.160.12.56.1.28|RA|CGN=1|pw=Vodafone

Voice

The voice PPPoE connection must use the Station serial number prepended with V- as username, and vodafone as password.
In your beloved Debian system it can be done by creating /etc/ppp/peers/voice with this content:

nodefaultroute
noauth
ifname pppoe-voice
name V-X12345678901234
plugin rp-pppoe.so
host-uniq 583132333435363738393031323334
nic-eth0.1035

and this entry in /etc/ppp/pap-secrets:

V-X12345678901234       *       vodafone

The SIP and RTP server are accessible only via the voice WAN and belong to the 10.0.0.0/8 subnet.
To access them create a script which configures that route every time that the voice WAN brings up,
I used to put this script in /etc/ppp/ip-up.d/0002route:

#!/bin/sh
[ "$PPP_IFACE" = 'pppoe-voice' ] && ip route add 10.0.0.0/8 dev pppoe-voice via $PPP_LOCAL

Getting the SIP credentials is difficult but not impossible, you have to query the ACS server to get them.

Connect

To connect both PPPoE sessions simultaneously, the two VLAN must have different MAC addresses, so one of the two interface address mus be spoofed.
Now it should be possible to connect with pon pppoe-data and pon pppoe-voice or with ifup, if the network is configured in /etc/network/interfaces.

Here there is a working Debian configuration:

auto eth0 eth0.1036 eth0.1035 pppoe-data pppoe-voice

iface eth0 inet manual

iface eth0.1036 inet manual
        vlan-raw-device eth0

iface eth0.1035 inet manual
        vlan-raw-device eth0
        up ifconfig eth0.1035 hw ether $(sed 's/^../02/' /sys/class/net/eth0/address)

iface pppoe-data inet ppp
        pre-up ifconfig eth0.1036 up
        provider data

iface pppoe-voice inet ppp
        pre-up ifconfig eth0.1035 up
        provider voice

Don't ever try to use crappy software like systemd-networkd or NetworkManager to do such network configuration:
system-networkd doesn't supports PPPoE and never will because "It's importance is questionable in modern OSs",
NetworkManager does a little better, it supports PPPoE but not over a VLAN, so no way either.

Multiple sessions

Multiple PPPoE sessions can be raised, but they must have different MAC addresses and Host-Uniq.
An option cuold be using a macvlan over the VLAN, like:

ip link add link eth0.1036 veth1 address $(sed 's/^../12/' /sys/class/net/eth0/address) type macvlan

and then starting another PPPoE session over the veth1 device, with another Host-Uniq.
The session will get a public IP and extra bandwidth ;)

Dyndns

A fancy hostname like vox1234567.mynet.vodafone.it is assigned to every Vodafone line, where 1234567 is the line identifier, which is written in the phone bill.
The hostname can be used as free and reliable dyndns, and it's also the ONT authentication token.

Conclusion

I've made this tutorial because I find the Station extremely buggy and feature limited, and I really hate that Vodafone forces me to use this crappy, OpenRG based device.
It's not my intention to harm or damage any of the parties involved in developing, selling or using this device.
I just want to use my fiber line with a customizable, reliable and powerful device, like my x86 based Debian box, nothing more, nothing less.

cheers and happy hacking,
teknoraver

@teknoraver
Copy link
Author

Well, that's easy now. Setup a phone (I use a Gigaset Cordless) using the correct outbound proxy, user, pass and all the parameters.
Do some tests with a Linux application like Yate or Linphone, when it work configure a standalone device

@djStolen
Copy link

Hi,

Is this how to applicable for Vodafone Station in Germany?

Thanks

@teknoraver
Copy link
Author

Yes, maybe some parameters are different, but it's the same stuff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment