This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

6lbr default gateway address

Other Parts Discussed in Thread: CC2538

Hi,

In 6lbr configuration there is default router(Peer Router) address field. For running Nat64 on router, Ti say we should enter host computer's ipv6 or gateway's ipv6 to this field 

http://processors.wiki.ti.com/index.php/Cc26xx_sw_examples

""

It is important that it a real IPv6 address and that the IPv6 address belongs to a device on the subnet and that the device is turned on. If the device is not reachable, the connection to Internet will go down. It is not possible to use the BBB IP address for this.

  • Enter e.g. your PC or access point IPv6 address in the "Peer router" edit box.
  • Scroll down and click Submit button. The Edge Router application will reboot and are then ready for use.

""

I am trying to connect wireless cc2538 nodes to internet. I am running wrapsix (NAT64) on BBB. I entered my host computer' s ipv6 as Peer Router's address.

I used wireshark on my host computer. I saw that cc2538 node sends ip packects to my host computer. But this packets does not go to internet. My host computer simply discards this packets. I think I should use my gateways ipv6 address for Peer Router address on 6lbr config page. Because cc2538 sends

packets to 184.172.124.189 which is IBM s MQTT broker addressan this address is global address . I think this packet should go to my gateway. Because my gateway(router) can send this packet to internet.

Because I could not learn our gateways IPv6 I couldnt try gateways s address instead of host computers address(I am at job now)

Are there anybody who knows which ip address I should use.


Thanks

Serdar ARSLAN

  • Hello,

    I guess this request is coming in form several places(?). Anyway I will answer it hear for the masses ;)

    The peer router (default route) is used in the Edge Router for packets coming in for which there is no route in the routing table. The 6lbr application needs this to be a valid IPv6 address on the same subnet (it needs to be pingable)

    We are looking into this issue, I am not sure what is the error here. Seems like your setup is ok, you are getting answers form IBM cloud server. The problem is probably the NAT64 configuration.

    You say you are using cc2538... did you port the CC26xx example to CC2538? Can you please describe your network setup?

    Jonas
  • Hello,
    Thanks for your reply.
    I did not port CC26XX example to CC2538. There was already mqtt_demo example at the CC2538_DK directory in source files. I used it.
    I only changed Pan_id and rf_channel.

    in processors.wiki.ti.com/.../Cc26xx_sw_examples page. Web page says that for internet connection of BBB we should enter our desktop computer s ip here. Bu I dont understand why? My BBB also has ethernet connection to our own router. I think if BBB wants to send a ip packet to internet it must send it to other router not to my computer.
    Also we will use BBB router in metering project in Turkey. And there will be no host computer at site. we will use cc2538 as rf modem in meters. BBB as router. BBB will access internet directly.

    As you say there may be a mistake in wrapsix configuration.
    In wrapsix own web page it describes how wrapsix configuration must be:
    www.wrapsix.org/router.html

    WrapSix on a Debian/Ubuntu router

    Written by: DDRRE (Snir Hassidim), 2014

    Example environment configuration:

    br0 (172.16.0.1/16, fd10:ffff::1/16) is an internal bridge interface that holds all internal LAN ports.
    eth0 (212.4.5.63/30, 2ab0:15bc:32af:0020:a752:a467::63/96) is the external interface.
    212.4.5.64/30 is the NAT64 external address.
    2ab0:15bc:32af:0020:6464:6464::/96 is the pre-allocated DNS64 prefix.


    1. To configure WrapSix on an Ubuntu router, edit wrapper.c in the WrapSix "src" directory, and fill in the values for INTERFACE, PREFIX, IPV4_ADDR, HOST_IPV6_ADDR and HOST_IPV4_ADDR.

    INTERFACE: Set your internal interface here. Example: "br0"
    PREFIX: Set your DNS64 prefix here. Example: "2ab0:15bc:32af:0020:6464:6464::"
    IPV4_ADDR: Set the IPv4 address to be used for NAT64 external packets. Example: "212.4.5.64"
    If you only have one external IP, you can try setting a private IP from your internal subnet (not fully tested).
    HOST_IPV6_ADDR: Type your router's external IPv6 address. Example: "2ab0:15bc:32af:0020:a752:a467::63"
    HOST_IPV4_ADDR: Type your router's external IPv4 address. Example: "212.4.5.63"

    Note: DO NOT create an interface that uses the NAT64 address from IPV4_ADDR.

    2. Compile and install wrapsix (make && make install).
    3. Add it to your local startup scripts.
    4. If you used a public IPv4 address in IPV4_ADDR, skip this step.
    Create a NAT rule for WrapSix (add it before other rules):
    iptables -t nat -I POSTROUTING 1 -s <IPv4_ADDR goes here> -j SNAT --to <IPV4_ADDR goes here>
    5. Done!



    So it says that there are 2 interface br0 and eth0
    And for INTERFACE they say that we must use br0, but we use eth0 I didnt understand why?

    they say that br0 is internal interface and eth0 is external interface

    I think we should use ttyACM0(which is wireless nodes interface) or anyother interface name for INTERFACE field

    We are using external interface name for INTERFACE field.



    As you say wrapsix may be wrong configurated. So packets from wireless nodes dont go to nat64. Maybe they are going

    to default router(peer router)which is my host computer(windows 7)

    Thaks
    Serdar Arslan
  • ok, that example has been verified to work well with 6lbr and wrapsix NAT64, to IBM cloud server.

    I will get back on the NAT64/wrapsix configuration...

    Jonas
  • In wrapsix web page 4. step says that:

    4. If you used a public IPv4 address in IPV4_ADDR, skip this step.
    Create a NAT rule for WrapSix (add it before other rules):
    iptables -t nat -I POSTROUTING 1 -s <IPv4_ADDR goes here> -j SNAT --to <IPV4_ADDR goes here>

    I didnt do it, Because in texas web page there is no text about this step. But they say that if you are using private address for IPV4_ADDR you should run this command. Also I am using 10.10.16.200 which is private ip address.
    Should I enter this command to BBB command line or not.
    Thanks
    Serdar.
  • Hi Serdar,

    Can you please try changing the RAW_ETH_FCS=0 in you /etc/6lbr/6lbr.conf file? I have seen that the FCS seems to be system dependent, sometimes 0 work best sometimes 1 works best. What lead me to think to might be your issue is the comment about the CRC/FCS error you see in the Ethernet side. So you should have a 6lbr.conf:

    MODE=ROUTER
    #MODE=SMART-BRIDGE
    #MODE=RPL-RELAY
    #MODE=FULL-TRANSPARENT-BRIDGE
    #MODE=NDP-ROUTER
    #MODE=6LR
    #MODE=RPL-ROOT

    RAW_ETH=1
    BRIDGE=0
    DEV_BRIDGE=br0
    DEV_TAP=tap0
    DEV_ETH=eth0
    #RAW_ETH_FCS=1
    RAW_ETH_FCS=0

    DEV_RADIO=/dev/ttyACM0
    BAUDRATE=115200

    LOG_LEVEL=3

    Part from that as far as I can tell your NAT64/wrapsix configuration is fine.

    Let me know how it goes!

    Best,
    Jonas
  • Hi Jonas,

    At last I saw Node was connected to Ibm server.

    I am summarizing things I did for other peoples who may need.

    Before doing your suggestions, I formatted sd card on BBB. Copied Debian image to Sd card, again I installed 6lbr, then installed wrapsix. So I started with a fresh board.

    for 6lbr.config I used following
    MODE=ROUTER
    #MODE=SMART-BRIDGE
    #MODE=RPL-RELAY
    #MODE=FULL-TRANSPARENT-BRIDGE
    #MODE=NDP-ROUTER
    #MODE=6LR
    #MODE=RPL-ROOT

    RAW_ETH=1
    BRIDGE=0
    DEV_BRIDGE=br0
    DEV_TAP=tap0
    DEV_ETH=eth0
    #RAW_ETH_FCS=1
    RAW_ETH_FCS=0

    DEV_RADIO=/dev/ttyACM0
    BAUDRATE=115200

    LOG_LEVEL=3

    For wrapsix configuration I used following

    /* +++ CONFIGURATION +++ */
    #define INTERFACE "eth0"
    #define PREFIX "64:ff9b::"
    #define IPV4_ADDR "10.10.16.200" // Free Ip in my Network. I pinged it and I saw no ping answer,So I am sure there is no body using this ip.
    #define HOST_IPV6_ADDR "bbbb::101"
    #define HOST_IPV4_ADDR "10.10.16.120" //my BBB ipv4 address
    /* --- CONFIGURATION --- */

    I entered my host computers ipv6 address as Peer router address in 6lbr config page.

    For cc2538 nodes I used rf_channel= 26, PAN_Id = 0xABCD.

    I started wrapsix, Then I powered on my CC2538 nodes. I opened Ibm web page, entered my CC2538 Mac address to web page. At last I saw Node was connected to Ibm server.

    The things I did wrond were:
    1- Before changing wrapsix configuration file I didnt stop wrapsix process. So while running a wrapsix process on BBB, I have started another wrapsix process at the same time. I tried alot of IPV4_ADDR address. When I runned tcpdump on 1883 port I saw BBB sends SYN packets to different ips.
    2- I were using #define HOST_IPV6_ADDR "bbbb::100"
    3- I tried different INTERFACE names, Because wrapsix manual says there is 2 interface br0 and eth0, But BBB has only one interface for this, only eth0. Then I understood that 6lbr uses a different processes on interfaces.

    Thanks for your support.

    Serdar
  • Good you got it up and running, I'll make sure the wiki is updated based on your valuable feedback.

    Thanks,
    Jonas
  • Wiki is now updated to give better guidance when configuring NAT64 using wrapsix.

    ti.com/contiki-6lowpan-wiki

    Jonas
  • Hi Serder,

    I am also trying to use Wrapsix over 6lbr on raspberry pi connected with a z1 mote running slip radio. My network does not support IPv6 and I want to upload data collected by other z1 motes to be uploaded to ubidots.com using raspberry pi as border router.

    Raspberry pi is connected to a router by ethernet cable and my laptop also connected to router through ethernet

    My wrapper.c configuration is :

    #define INTERFACE       "eth0"
    #define PREFIX          "64:ff9b::"
    #define IPV4_ADDR       " x.x.x.x" //unused ip in my network
    #define HOST_IPV6_ADDR  "bbbb::101"
    #define HOST_IPV4_ADDR  "x.x.x.x"// ip address of raspberry pi as mentioned in ifcocnfig

    My 6lbr.conf looks like :

    MODE=ROUTER
    RAW_ETH=1
    BRIDGE=0
    DEV_BRIDGE=br0
    DEV_TAP=tap0
    DEV_ETH=eth0
    RAW_ETH_FCS=0
    DEV_RADIO=/dev/ttyUSB0
    BAUDRATE=115200
    LOG_LEVEL=3 #INFO and above only

    when I start wrapsix as daemon I get :

    [1] 3039
    [Info] WrapSix 0.2.0 is starting
    pi@raspberrypi ~/wrapsix-0.2.0/src $ [Error] Unable to create listening socket

    sudo service 6lbr restart

    Logs:


    Tue Jun 16 09:52:34 UTC 2015 : Starting 6LBR
    /usr/lib/6lbr/bin/cetic_6lbr_router -c /etc/6lbr/nvm.dat -s /dev/ttyUSB0 -t eth0 -r -B 115200 -U /usr/lib/6lbr/6lbr-ifup -D /usr/lib/6lbr/6lbr-ifdown -w /usr/lib/6lbr/www -L 3 -W /var/log/6lbr.timestamp -P 60 -C /var/log/6lbr.ip -m /usr/lib/6lbr/plugins
    Contiki-6lbr-1.3.2-34-g3715b49 started with IPV6, RPL
    Rime started with address 1.2.3.4.5.6.7.8
    MAC CSMA RDC br-rdc NETWORK sicslowpan
    Log level : 30
    Log services : ffffffff
    2015-05-16 9:52:34.465054: INFO: ETH: 6LBR watchdog started (interval: 60)
    2015-05-16 9:52:34.466461: INFO: 6LBR: Starting 6LBR version 1.3.3 (Contiki-6lbr-1.3.2-34-g3715b49)
    2015-05-16 9:52:34.466502: INFO: NVM: Opening nvm file '/etc/6lbr/nvm.dat'
    2015-05-16 9:52:34.475495: INFO: NVM: NVM Magic : 2009
    2015-05-16 9:52:34.475550: INFO: NVM: NVM Version : 1
    2015-05-16 9:52:34.475574: INFO: SCMD: Started br-cmd process
    2015-05-16 9:52:34.475598: INFO: NODECFG: No node_config.conf file specified
    2015-05-16 9:52:34.475620: INFO: ETH: RAW/TAP init
    2015-05-16 9:52:34.478330: INFO: SLIP: SLIP started on /dev/ttyUSB0
    2015-05-16 9:52:34.500564: INFO: TAP: opened device /dev/eth0
    2015-05-16 9:52:34.501371: INFO: TAP: Running 6lbr-ifup script '/usr/lib/6lbr/6lbr-ifup'
    eth0 Link encap:Ethernet HWaddr b8:27:eb:33:e7:28
    inet addr:192.168.10.5 Bcast:192.168.10.255 Mask:255.255.255.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:3531 errors:0 dropped:0 overruns:0 frame:0
    TX packets:1726 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:627824 (613.1 KiB) TX bytes:266945 (260.6 KiB)

    2015-05-16 9:52:34.870443: INFO: TAP: Eth MAC address : b8:27:eb:33:e7:28
    2015-05-16 9:52:34.870684: INFO: BR-RDC: Reset SLIP Radio
    2015-05-16 9:52:34.870810: INFO: BR-RDC: Fetching MAC address
    2015-05-16 9:52:34.904707: ERROR: SLIP: Unknown command
    2015-05-16 9:52:34.935126: INFO: BR-RDC: Got MAC: c1:0c:00:00:00:00:13:e8
    2015-05-16 9:52:35.870855: INFO: 6LBR: Tentative local IPv6 address fe80::c30c:0:0:13e8
    2015-05-16 9:52:35.871634: INFO: 6LBR: Tentative global IPv6 address (WSN) aaaa::c30c:0:0:13e8
    2015-05-16 9:52:35.872290: INFO: 6LBR: Tentative global IPv6 address (ETH) bbbb::100
    2015-05-16 9:52:35.872644: INFO: 6LBR: RA Daemon enabled
    2015-05-16 9:52:35.873114: INFO: NVM: Opening nvm file '/etc/6lbr/nvm.dat'
    2015-05-16 9:52:35.874336: INFO: 6LBR: Configured as DODAG Root
    2015-05-16 9:52:35.874611: INFO: 6LBR: Starting as RPL ROUTER
    2015-05-16 9:52:35.877235: INFO: UDPS: UDP server started
    2015-05-16 9:52:35.878332: INFO: 6LBR: CETIC 6LBR Started
    2015-05-16 9:52:35.878704: ERROR: SLIP: Unknown command

    In my browser I able to see border router page : [bbbb::100]

    Any suggestions would be helpful

    Thanks!
    Deepika