LTE and IPv6 DHCP?

I use Huawei ME909s-120 with RB922. When using LTE, DHCPv6-client is unable to get address or prefix from the ISP. I have verified that the modem has successfully opened the IPv4 and IPv6 connection:

[admin@MikroTik] > /interface lte at-chat lte1 input="AT^NDISSTATQRY\?"
  output: ^NDISSTATQRY: 1,,,"IPV4",1,,,"IPV6"

IPv4 DHCP client is ok, but IPv6 DHCP client on lte1 interface just keeps searching without success. I assume that there is no DHCP server on v6 side, although I have been told that the ISP is using DHCPv6 PD. I can see that the modem has acquired an IPv6 address (address slightly alrered for privacy):

[admin@MikroTik] > /interface lte at-chat lte1 input="AT^DHCPV6?"
  output: ^DHCPV6: 2001:999:42:c092:5a2c:8ff0:fe26:9218,::,::,::,2001:998:20::20,2001:998:20::40,150000000,150000000

If I set that IPv6 address on lte1 interface I can successfully reach it from the Internet, which is enough for me.

So… is there a way to assign the modem reported address (acquired using SLAAC?) on the lte1 interface automatically? Or any other suggestions to try?

Is this you first experience with IPv6 and/or DHCPv6 or did you get it working with other interfaces?
You have to understand that DHCPv6 PD does not assign an interface address. it is used to get a network address to route through your router (to use on the internal interfaces).

Yeah, it’s my first experience. If DHCPv6 PD works shouldn’t I get at least a prefix with DHCPv6? But it just keeps searching:

[admin@MikroTik] > /ipv6 dhcp-client print
Flags: D - dynamic, X - disabled, I - invalid
 #    INTERFACE          STATUS        REQUEST         PREFIX                                                           ADDRESS
 0    lte1               searching...  prefix

currently we don’t have support for the IPv6 using the ME909s-120 using existing lte emulation driver.

Ok. Is it possible to make a routeros script that fetches the IPv6 address from ME909s-120 and applies it to the router configuration automatically?

Normally (with a reasonable provider) your DHCPv6 PD request should result in a pool of addresses (a /60 or more) from which you can assign /64 addresses to individual interfaces.
In my case, I get a /48 so plenty of interfaces can be configured and further routers cascaded behind the first one, also with their addresses.
Many providers give only a single /64 so you have to use it sparingly, it can then only be put on the LAN side of the router and there is no address left for the WAN side.
However, it isn’t required to have a routable address on there, you can just use the fe80:xxx local address that is automatically assigned to each interface.
This will only “cause problems” when doing things like traceroute. For normal operation it works fine.
There is little point in getting a single address from the modem and putting it on the external interface, because RouterOS does not have NAT for IPv6.
You would only be able to use the IPv6 address for traffic originating from the router itself, to do e.g. DNS lookups or VPN(tunnel) over IPv6.

Indeed - I am aware of this. Unfortunately DHCP client is not able to get a pool of addresses from the provider. I assume it has something to do with what uldis mentioned (no existing IPv6 support for ME909s-120). So… I am left with the only option, which is to use the IPv6 address provided by the modem. I can then set up a VPN server on the router which is reachable from Internet (via IPv6).

I have now read through the scripting manual and believe it is possible to create a script which automatically fetches the IP address from the modem and applies it to the router configuration.

Here’s my current implementation.

#
# Mikrotik RouterOS script for
# setting up LTE IPv6 Address from Huawei ME909s-120
#
# Written by Pauli Borodulin Jan 2018
#

# LTE interface name
:local lteifname "lte1";

# # #

# check for a running LTE interface
:if ([ /interface print as-value where name=$lteifname && running ] = "") do={
    :error "No running LTE interface $lteifname.";
}

:local dhcpv6output;
:set dhcpv6output [/interface lte at-chat lte1 input="AT^DHCPV6?" as-value];
:set dhcpv6output ($dhcpv6output->"output");

:if ([:find $dhcpv6output "^DHCPV6: "] != 0) do={
    :error ("Invalid response to AT^DHCPV6?: " . $dhcpv6output);
}

# parse IPv6 address from AT^DHCPV6? output
:local idx1;
:local idx2;
:local v6addr;
:set idx1 ([ :find $dhcpv6output " " ] + 1);
:set idx2 [ :find $dhcpv6output "," ];
:set v6addr [ pick $dhcpv6output $idx1 $idx2 ];

# check that it is not empty address ::
if ($v6addr = "::") do={
    :error ("Modem has no IPv6 address.");
}

# clean up current list of global addresses
:local v6addrok false;
:local v6globaladdrs;
:set v6globaladdrs [ /ipv6 address print detail as-value where interface=$lteifname && global ]
:foreach tmp in=$v6globaladdrs do={
    # remove prefix from address
    :local tmpaddr [ :pick ($tmp->"address") 0 [ :find ($tmp->"address") "/" ] ];
    :if ($tmpaddr != $v6addr) do={
        :put ("Removing address " . $tmpaddr . " from $lteifname.");
        /ipv6 address remove [ /ipv6 address find address=($tmp->"address") && interface=$lteifname ];
    } else={
        :set v6addrok true;
    }
}

if (!$v6addrok) do={
    :put ("Adding address " . $v6addr . " to $lteifname.");
    /ipv6 address add address=$v6addr interface=$lteifname;
}

I only now figured out that the IPv6 address presented by the modem is /64. I may be able to extend the script to create a pool using it. I need to extend my testbed to see how it plays out. :slight_smile:

WAP LTE KIT with R11e-LTE supports the the IPv6.

Great tip, thanks! I was able to extend my script so that I can distribute global IPv6 addresses from the acquired subnet to clients while also assigning a global IPv6 address for the router. It would be great if RouterOS supported ME909s-120 as-is, but meanwhile I’m happy with the scripted solution.

Is that actually available? I tried to order one but my supplier can’t get it at the moment.

Hello,
I just got the BaseBox 2 with R11e-LTE card and I could not find the step/procedure to guide me how to setup R11e-LTE work with IPv6 ?
Can someone enlighten me how to do ?
Rgds,

Hello,
Learn from forum article dated 2015 Apr.07 that RouterOS do not support SLAAC yet ? Or “WAP LTE KIT with R11e-LTE supports the the IPv6.” it did support SLAAC ?
Presently, our local tel comm. company support ipv4/ipv6 on smartphone now, so I would like to establish it with routerOS with R11e-LTE if it is capable …
Thanks you for your time.

Q
Bad news: You’re basically unable to use this LTE connection for IPv6. Mikrotik doesn’t even support learning an interface IPv6 address / default GW from SLAAC. Furthermore, your connection would require NAT in order to share it with other devices. SLAAC is for one and only one device. Mikrotik doesn’t support NAT on IPv6 either - mostly because there’s no official kernel support for it.
Uq

2pboro: how did you activate IPv6 for ME909S-120 ?

my device:

/interface lte at-chat lte1 input=“AT^NDISSTATQRY?”
output: ^NDISSTATQRY: 1,“IPV4”,0,“IPV6”

/interface lte at-chat lte1 input=“AT+CGDCONT?”
output: +CGDCONT: 0,“IPV4V6”,“”,“”,0,0,0,0,0,0
+CGDCONT: 1,“IPV4V6”,“”,“”,0,0,0,0,0,0

thanks!

P.S. a bit more info, i see this message in logs if i try to run

/interface lte apn set ip-type=ipv4-ipv6 …

23:48:59 echo: lte,critical lte1 disabled, bad APN config: IPv6 not supported for this device (6)

but AT+CGDCONT? shows that we have IPV4V6 Dual Stack
output: +CGDCONT: (0-11),“IP”,(0-2),(0-3),(0,1),(0,1),(0-2),(0,1) +CGDCONT: (0-11),“IPV6”,(0-2),(0-3),(0,1),(0,1),(0-2),(0,1) +CGDCONT: (0-11),“IPV4V6”,(0-2),(0-3),(0,1),(0,1),(0-2),(0,1)

AT^IPV6CAP?
output: ^IPV6CAP: 7