Dual-stack 3G connections

A few months ago, I received two test SIM cards for Orange Poland’s new IPv6 network.

The interesting thing about this network is that it’s running IPv6 in a fairly unusual configuration and it was interesting to see how to get that work on Ubuntu.

This network uses two separate APNs, one for IPv4 (internet) and one for IPv6 (internetipv6).
Using two separate APNs is certainly easier on the carrier’s infrastructure side as they can get IPv6 online without actually changing anything on the IPv4 equipement, however that means that any client wanting to use both protocols at once needs to use multiple PDP contexts.

I’m now going to detail how to manually configure ppp to connect to such a network:
/etc/ppp/peers/orange

noauth
connect "/usr/sbin/chat -e -f /etc/ppp/peers/orange-connect"
/dev/ttyACM0
460800
+ipv6

/etc/ppp/peers/orange-connect

TIMEOUT 5
ABORT BUSY
ABORT 'NO CARRIER'
ABORT VOICE
ABORT 'NO DIALTONE'
ABORT 'NO ANSWER'
ABORT DELAYED
ABORT ERROR
'' \nAT
TIMEOUT 12
OK ATH
OK ATE1
OK 'AT+CGDCONT=1,"IP","internet"'
OK 'AT+CGDCONT=2,"IPV6","internetipv6"'
OK ATD*99#
CONNECT ""

Then all that’s needed is a good old:

pon orange

And a few seconds later, I’m getting the following on ppp0:

ppp0      Link encap:Point-to-Point Protocol  
          inet addr:87.96.119.169  P-t-P:10.6.6.6  Mask:255.255.255.255
          inet6 addr: 2a00:f40:2100:ac9:8c1e:da60:93e2:c234/64 Scope:Global
          inet6 addr: 2a00:f40:2100:ac9::1/64 Scope:Global
          inet6 addr: fe80::1/10 Scope:Link
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:13 errors:0 dropped:0 overruns:0 frame:0
          TX packets:23 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3 
          RX bytes:354 (354.0 B)  TX bytes:767 (767.0 B

This config should work for any mobile network using a similar setup (likely to become more and more popular as the various RIRs are running out of IPv4).

Sadly ModemManager/NetworkManager don’t support mutliple PDP contexts yet, though it’s being discussed upstream, so we can hope to see something land soon.

Apparently multiple PDP contexts support is also dependant on hardware. In my case, I’ve been using an “old” Nokia E51 over USB as I didn’t have any luck getting that to work with an Android phone. My Nokia N900 also worked but required a custom kernel to be installed first to properly handle IPv6.

About Stéphane Graber

Project leader of Linux Containers, Linux hacker, Ubuntu core developer, conference organizer and speaker.
This entry was posted in Canonical voices, IPv6, Planet Ubuntu. Bookmark the permalink.

4 Responses to Dual-stack 3G connections

  1. Regarding ModemManager supporting multiple APNs, it’s already supported in git master for a future 0.7/0.8 release. But currently we’re assuming that you need two data ports to handle two different APNs. I’m still wondering how you can configure two different PDP contexts and then issue the ATD command without specifying one explicitly (thus enabling the ’empty PDP type’) and get both connected at the same time. When no PDP context is specified in the ATD call no PDP address or APN is sent to the network. Now wondering if your modem handles this differently or if there is something automatic running somewhere which lets you handle this properly. Do you really have IPv6 connectivity here?

    1. The config from this blog post works fine at least on that Orange network using a Nokia E51 with ppp.
      It’s using both the IP (internet APN) and IPV6 (internetipv6 APN) contexts at the same time and gets me IP, DNS and defaultroute for both protocols. I confirmed that both IPv4 and Ipv6 connectivity works fine (except for the 300ms latency as I’m testing that using roaming from Canada).

      I also checked that connecting to one or the other individually only gives me IPv4 or IPv6 respectively but never both (to confirm that their IPv6 APN wasn’t actually dual-stack).

  2. Fabiano Ferronato says:

    There is a way to configure four different APNs from different ISPs? So PPP could try to connect to each APN until the connection is established? This is helpful when you don´t know which ISP´s SIM card it’ll be used.

  3. Hamitlton says:

    2020! And that line right here:
    OK ‘AT+CGDCONT=2,”IPV6″,”internetipv6″

    Saved me! I looked everywhere for a solution for my problem, it would connect to ipv4 but not ipv6….

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.