OpenWrt Forum Archive

Topic: Help: MAP-T configuration on OpenWRT

The content of this topic has been archived on 23 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi friends,

I'm trying to run map-t on OpenWRT. Since Breaking Barrier (14.07) has experimental support for map-t, I went ahead and flashed a NetGear WNDR3700v4 with that release. I have also installed the map and map-t packages as required to enable support for the technology by logging into the CPE and then going to System->Software->Packages

However, I'm having trouble configuring the device to support map-t.

I have tried looking in the following places:
* http://wiki.openwrt.org/doc/howto/ipv6
* http://wiki.openwrt.org/doc/uci/network6
* http://wiki.openwrt.org/doc/howto/map (I'm not sure if the "How to use MAP" section was supposed to have this information - it's blank)

and also googled this quite a bit (but to no avail).

I was hoping someone could help out with a sample configuration / configuration steps to enable this technology.
It'll be greatly appreciated. Thanks a lot!

....
Also, as a sidenote, I'm SSHing into the CPE using putty on a machine connected to it's LAN port. Everytime I mess around with the interface protocol, I get kicked out of the SSH session for obvious reasons. Is there a proper way to go about this?

...
Extended IPv6-support
Added DS-Lite support and improved 6to4, 6in4 and 6rd-support
Experimental support for Lightweight 4over6, MAP-E and MAP-T
Draft-support for self-managing home networks (HNCP)
(taken from http://wiki.openwrt.org/doc/barrier.breaker)

(Last edited by neotaruntius on 17 Mar 2015, 22:11)

MAP-T is usually configured using DHCPv6. In any case you need a router/device on the other side of the network (usually your ISP) who does the reverse translation. Some more information and example configuration for both sides can be generated here: http://6lab.cisco.com/map/MAP.php

Hi CyrusFF

I have the devices that are needed on either side of the CPE (openwrt) ready and connected as follows.

[ Device ]---- [ CPE (openwrt) ]----- [ MAP-T BR ]

I have referred to http://docwiki.cisco.com/wiki/MAP:OpenW … -T_example as well. The site has dead links for the image, and unfortunately, there's no example of what the /etc/config/network file in openWRT should look like.

As mentioned before, GUI doesn't have any mention of configuration steps for map-t either (except for the part where we can install packages).

I did go to WAN6 and enabled DHCPv6 there. However, again, I'm not sure how to enable the MAP-T rules.

Thanks.

You don't need a special image anymore. Just make sure you install the map-t package and enable DHCPv6 on the interface towards the BR and make sure the router is requesting.

config interface wan6
    option ifname eth0 #replace with your interface towards BR, do not use "@wan" or similar
    option proto dhcpv6

The actual map-rules are not configured inside /etc/config/network but usually received using DHCPv6. So make sure your DHCPv6-server is properly configured to send appropriate options. See e.g. "DHCP server configuration" section in the cisco wiki page.

If you are sure the information is provided via DHCPv6 you can use "ubus call network.interface dump" to see if a map interface was created or if anything went wrong. In addition there should be a file like "map-xyz.rule" containing the calculated map-rule in /tmp.

It is possible to manually configure it in /etc/config/network but its intentionally not documented because its cumbersome and can go wrong easily so you definitly should use DHCPv6. If DHCPv6 definitly doesn't work for you I could try to figure out a manual configuration if you can provide me with your MAP-T settings.

Hi CyrusFF

That clears up a lot of things, thanks! My BR currently doesn't support DHCPv6 (I had enabled it on the CPE only to see if it shows me some MAP-t configuration options afterwards).

Since DHCPv6 isn't an option for me currently, would you be able to share the manual configuration with me as well. Currently, my MAP-T settings on the BR are as follows:

Default Mapping Rule:
    ipv6-prefix  = 64:192::/96

Basic Mapping Rule:
    ipv6-prefix = 4ffe:1::/64
    ipv4-prefix = 68.1.0.0 /24

Thanks!

Okay so if you do not have DHCPv6 at all you need to configure your delegated prefix as well manually.

config interface wan6
    option ifname eth0                      # interface towards BR
    option proto static
    option ip6addr 2001:db8::1/64  # the router's address on the wan interface
    option ip6gw 2001:db8::2/64    # the default IPv6 gateway (e.g. BR) 
    option ip6prefix 4ffe:1::/64          # the router's delegated prefix (used to calculate MAP-paramters)


config interface wan6_map
    option proto map
    option type map-t
    option tunlink wan6
    option ip6prefix 4ffe::1::     # BMR IPv6 prefix
    option ip6prefixlen 64       # BMR IPv6 prefix len
    option ipaddr 68.1.0.0      # BMR IPv4 prefix
    option ip4prefixlen 24       # BMR IPv4 prefix len
    option peeraddr 64:192::/96 # DMR

with this configuration the ealen, psidlen, psid etc. will be derived from the delegated prefix (ip6prefix in the first configuration section).
You need to tune this value to your needs but it must be withing your BMR IPv6-prefix. (see the 6lab map calculator)

Hello. I'd like to ask if I missed out any packages. I have installed map and map-t through opkg, but ifstatus returns me this while testing out MAP-E configurations that were generated using http://6lab.cisco.com/map/MAPnew.php:

"proto": "none"

Thanks.

Please post your /etc/config/network.
Also feel free to contact me at: cyrus -at- openwrt -dot- org for map-related issues.

(Last edited by CyrusFF on 13 Apr 2015, 14:53)

Hi,

I have enabled DHCPv6 on wan interface to request for an IPv6 prefix along with the default options the client requests for(MAP-T Container option 95 is of my interest). I could see the response from the DHCPv6 server containing the options requested for along with the prefix assigned. I could see the prefix being assigned to wan6 interface by calling "ubus call network.interface dump". However, wan6_map interface is not setup at the CE despite the rules being received from the DHCPv6 server. Below is the log file content. Please let me know if I am missing something basic here? . From my understanding, wan6_map will be automatically setup once the MAP-T rules are received.

Fri Mar 27 01:22:04 2015 daemon.notice odhcp6c[2636]: Starting SOLICIT transaction (timeout 4294967295s, max rc 0)
Fri Mar 27 01:22:05 2015 daemon.notice odhcp6c[2636]: Got a valid reply after 1059ms
Fri Mar 27 01:22:05 2015 daemon.notice odhcp6c[2636]: Starting REQUEST transaction (timeout 4294967295s, max rc 10)
Fri Mar 27 01:22:05 2015 daemon.notice odhcp6c[2636]: Send REQUEST message (elapsed 0ms, rc 0)
Fri Mar 27 01:22:05 2015 daemon.notice odhcp6c[2636]: Got a valid reply after 0ms
Fri Mar 27 01:22:05 2015 daemon.notice odhcp6c[2636]: entering stateful-mode on eth0.2
Fri Mar 27 01:22:05 2015 daemon.notice odhcp6c[2636]: Starting <POLL> transaction (timeout 34560s, max rc 0)
Fri Mar 27 01:22:05 2015 daemon.notice netifd: Interface 'wan6' is now up
Fri Mar 27 01:22:05 2015 daemon.notice netifd: Interface 'wan6_map' is setting up now
Fri Mar 27 01:22:05 2015 daemon.notice netifd: wan6 (2636): Command failed: Unknown error
Fri Mar 27 01:22:05 2015 user.notice firewall: Reloading firewall due to ifup of wan6 (eth0.2)
Fri Mar 27 01:22:05 2015 daemon.notice netifd: wan6_map (2674): Interface wan6_map_local not found
Fri Mar 27 01:22:05 2015 daemon.notice netifd: Interface 'wan6_map' is now down

Have you installed the package "map-t" via opkg or built into your image? Which version of OpenWrt are you using?

Is there a file like map.rules file in /tmp if so please post its contents.

Hi Cyrus,

I am using OpenWRT BARRIER BREAKER (14.07, r42625). I have installed map-t package, but there is no map rule related file in the /tmp folder.

Can you post the sample content of the file?.

It should contain a dump of your map rules. If you don't have it  Please check the output of "ifstatus wan6_map" for errors and as noted via mail:

you should be able to add a script /etc/odhcp6c.user with code:
env >> /tmp/odhcp6c.log

so you see what odhcp6c prints to the env Before its parsed i.e. waw maprules from the dhcpv6 server.

I have added the script and below is the odhc6c log file content.

HOME=/
JSON_VAR_ifname=@wan6
TYPE_JSON_VAR_rule=string
TYPE_JSON_VAR_zone=string
MAPT=type=map-t,ealen=4,prefix4len=28,prefix6len=51,ipv4prefix=12.xx.xx.240,ipv6prefix=2002:xxx:xxx::,dmr=2002:xxx::/96,
TERM=linux
TYPE_JSON_VAR_proto=string
JSON_VAR_rule=type=map-t,ealen=4,prefix4len=28,prefix6len=51,ipv4prefix=12.xx.xx.xx,ipv6prefix=2002:xxx:xxx::,dmr=2002:xxx::/96,
board=WNDR3700_V4
PATH=/bin:/sbin:/usr/bin:/usr/sbin
PREFIXES=2002:abc:def::/55,69120,86400
SOURCE_ROUTING=1
TYPE_JSON_VAR_type=string
TYPE_JSON_VAR=
JSON_VAR_zone=wan
JSON_VAR_proto=map
TYPE_JSON_VAR_name=string
KEYS_JSON_VAR= name ifname proto type rule tunlink zone
JSON_VAR_type=map-t
INTERFACE=wan6
JSON_SEQ=0
JSON_CUR=
PROTO_PREFIX6=2002:xxx:xxx::/55,69120,86400
PWD=/lib/netifd/proto
TYPE_JSON_VAR_tunlink=string
JSON_VAR_name=wan6_map

wan6_map interface is not setup.!

Hello!

Sorry for not replying back regarding my previous post, it somehow got fixed.

So, I would like to try out a MAP-E without DHCPv6 setup taken from https://tools.ietf.org/html/draft-xli-s … esting-05:

                                                  -----     ------
                                               .-| CE.0|---|Host.0|
                                              /   -----     ------
           ------                  -----     |
         /  The   \    -----     /  An   \   |    -----     ------
        |   IPv4   |--| BR  |---|   IPv6  |------| CE.1|---|Host.1|
         \Internet/   |     | ^  \Network/   |    -----     ------
           ------      -----  |    -----     |
                              |               \   -----     ------
                           tcpdump              -| CE.K|---|Host.K|
                                                  -----     ------

                    Figure 1: Generic testing topology

I am having difficulties making this topology work, especially pinging from a host behind a CE to an ipv4 address outside BR and vice versa. Is it correct that both BR and CE should have the same MAP-E config?

I have the following config in my CE (mostly generated from the Cisco website):

config interface 'lan'
    option ifname 'eth0'
    option proto 'static'
    option ipaddr 198.51.100.1
    option netmask 255.255.255.0

config interface 'wan6'
    option ifname 'eth1'
    option proto 'static'
    option ip6addr 2001:db8::100/64
    option ip6gw 2001:db8::1    # BR address
    option ip6prefix 2001:db8::/64

config interface 'wan6_map'
    option proto 'map'
    option type 'map-e'
    option tunlink 'wan6'
    option peeraddr '2001:db8::1' 
    option ipaddr 198.51.100.0    # network address of hosts behind CE; 198.51.99.0 for BR side
    option ip4prefixlen 24
    option ip6prefix 2001:db8::
    option ip6prefixlen 40
    option ealen 16
    option psidlen 8
    option offset 4

Your configuration seems very inconsistent.

In general:
2001:db8::/64 is the delegated prefix for the CPE but at the same time 2001:db8::1 is the CPE's default gateway, so the default gw address is withing the PD this is incorrect. I don't see how the CPE could ever reach its default gateway or the MAP BR.

For MAP (though I don't know if it makes too much of a difference):
your DP is a /64 and your map-prefix is a /40 though ealen is a 16. Normally it should be: length of DP = length of map-prefix + ealen

Aside that well your BR needs to have a matching configuration, i.e. same MAP-prefix and IPv4-prefix. and lengths etc.

Ok thanks a lot.

I'll try to change my configuration and see how it goes.

Although for the BR configuration, I currently do not have a gateway between the ipv4 internet and the BR as displayed in the diagram in my previous post. Should I add a gateway between them? (I am currently testing on virtual machines)

I guess it doesn't make much of a difference if you use your BR as ipv6 default gateway, as long as it does that properly or if you just don't care about IPv6 otherwise during your tests.

Ah I see.

But what about the ip6gw and peeraddr configurations on the BR side? Since the BR needs to have a matching configuration with the CE, what would be the appropriate settings for them?

config interface 'lan'
    option ifname 'eth0'
    option proto 'static'
    option ipaddr 198.51.100.2
    option netmask 255.255.255.0

config interface 'wan6'
    option ifname 'eth1'
    option proto 'static'
    option ip6addr 2001:db8::1/64
    option ip6gw ????
    option ip6prefix 4ffe:1::/56

config interface 'wan6_map'
    option proto 'map'
    option type 'map-e'
    option tunlink 'wan6'
    option peeraddr '????' 
    option ipaddr 198.51.100.0    
    option ip4prefixlen 24
    option ip6prefix 4ffe:1::
    option ip6prefixlen 40
    option ealen 16
    option psidlen 8
    option offset 4

Ah you are trying to use OpenWrt for the BR? I'm afraid this won't work in the current implementation. For this we would need to add some more stuff to the linux kernel and / or derive different rules (haven't really though about what would be needed actually).

If that's the case then, would it be possible to test the MAP-E functionalities without the BR? I would like to see the tcpdump after encapsulation from the CE.

Thanks.

Hello. I have tested the MAP-E functionalities successfully without the BR.

Thanks.

mark5 wrote:

Hello. I have tested the MAP-E functionalities successfully without the BR.

Thanks.

mark5 - a little hint as to how you tested and what you did may help others who reach this thread


Anyone else (CyrusFF) have a hint on how to simulate a full MAP-T/MAP-E environment without heavy expenditure  (does not need to be performant)?

The discussion might have continued from here.