6lbr icon indicating copy to clipboard operation
6lbr copied to clipboard

6lbr doesn't work on a new Raspbian

Open janeksz opened this issue 8 years ago • 50 comments

Hi, After creating a new RPi image: Linux raspberrypi 4.4.38-v7+ #938 SMP Thu Dec 15 15:22:21 GMT 2016 armv7l GNU/Linx and installing 6lbr I am not able to access 6lbr webpage Everything works fine if I use my old uSD card with the same hardware (RPi2mB, cc2650 Launchpad as SLIP radio, CC2650 sensortags with Contiki as motes) How to debug it?

root@raspberrypi:~# service 6lbr restart root@raspberrypi:~# service 6lbr status ● 6lbr.service - LSB: 6LoWPAN Border Router Loaded: loaded (/etc/init.d/6lbr) Active: active (running) since Fri 2017-01-06 01:51:59 UTC; 8s ago Process: 10617 ExecStop=/etc/init.d/6lbr stop (code=exited, status=0/SUCCESS) Process: 10633 ExecStart=/etc/init.d/6lbr start (code=exited, status=0/SUCCESS) CGroup: /system.slice/6lbr.service ├─10639 /bin/sh /usr/lib/6lbr/6lbr /etc/6lbr/6lbr.conf ├─10643 /usr/lib/6lbr/bin/cetic_6lbr_router -c /etc/6lbr/nvm.dat -... ├─10644 /bin/sh /usr/lib/6lbr/6lbr-watchdog 10643 60 3 /var/log/6l... └─10704 sleep 1

Jan 06 01:51:59 raspberrypi 6lbr[10633]: Starting 6LoWPAN Border Router:. Jan 06 01:51:59 raspberrypi systemd[1]: Started LSB: 6LoWPAN Border Router. root@raspberrypi:~#

All my hardware and 6lbr settings are identical to previous (working) version

my /var/log/6lbr.log is being continuously updated, but i am unable to figure out what is wrong and why I can not see [bbbb::100] in my browser

Friday 6 January 02:03:22 UTC 2017 : Starting 6LBR /usr/lib/6lbr/bin/cetic_6lbr_router -c /etc/6lbr/nvm.dat -o /etc/6lbr/nvm.conf -s /dev/ttyACM0 -r -t wlan0 -f -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 -n /etc/6lbr/node_config.conf -m /usr/lib/6lbr/plugins
Contiki-develop-20160421-6-gb1df3d1 started with IPV6, RPL Rime started with address 1.2.3.4.5.6.7.8 MAC mac_wrapper RDC br-rdc SEC llsec-wrapper NETWORK sicslowpan 2017-01-06 2:03:23.282507: NOTICE: 6LBR: Starting 6LBR version 1.4.x (Contiki-develop-20160421-6-gb1df3d1) 2017-01-06 2:03:23.283637: INFO: ETH: 6LBR watchdog started (interval: 60) 2017-01-06 2:03:23.287660: INFO: PLUGIN: Loading /usr/lib/6lbr/plugins/dummy.so 2017-01-06 2:03:23.290524: INFO: PLUGIN: Loading /usr/lib/6lbr/plugins/lwm2m.so 2017-01-06 2:03:23.327259: INFO: PLUGIN: Initialising lwm2m-client 2017-01-06 2:03:23.368001: INFO: NVM: NVM Magic : 2009 2017-01-06 2:03:23.368046: INFO: NVM: NVM Version : 5 2017-01-06 2:03:23.368106: INFO: CONFIG: Loading configuration : /etc/6lbr/nvm.conf wlan0 Link encap:Ethernet HWaddr 00:c1:41:06:0b:97
inet addr:172.19.124.137 Bcast:172.19.125.255 Mask:255.255.254.0 inet6 addr: fe80::7863:b74b:b569:9336/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:25 errors:0 dropped:0 overruns:0 frame:0 TX packets:45 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:6623 (6.4 KiB) TX bytes:6659 (6.5 KiB)

2017-01-06 2:03:24.728144: PACKET: TAP: read: 165 2017-01-06 2:03:24.729030: PACKET: TAP: read: 145 2017-01-06 2:03:25.043883: PACKET: PF: bridge_output: Sending packet to Broadcast 2017-01-06 2:03:25.044488: PACKET: PF: wireless_output: sending packet 2017-01-06 2:03:25.045212: PACKET: PF: eth_output: broadcast 2017-01-06 2:03:25.045749: PACKET: PF: eth_output: Sending packet to Ethernet 2017-01-06 2:03:25.046380: PACKET: ETH: write: 78 2017-01-06 2:03:25.046922: DUMP: ETH: 3333ffb5 ee8500c1 41060b97 86dd6000 00000018 3aff0000 00000000 00000000 00000000 0000ff02 00000000 00000000 0001ffb5 ee858700 9d750000 0000aaaa 00000000 00000212 4b0007b5 ee85

janeksz avatar Jan 06 '17 02:01 janeksz

through experimentation found the problem, but I am unable to solve it: when I change in my /etc/6lbr/6lbr.conf from DEV_ETH=wlan0 to DEV_ETH=eth0 it works, but I need to work with wifi (wlan0) like in a previous system What do I need to change in my RPi system to make it work?

janeksz avatar Jan 06 '17 02:01 janeksz

following this link https://github.com/cetic/6lbr/issues/163 and this https://github.com/cetic/6lbr/wiki/6LBR-Interface-Configuration I am trying to setup "the routed interface mode" my config is:

root@raspberrypi:~# cat /etc/6lbr/6lbr.conf #This file contains a default configuration for Raspberry PI platform using #a Telos SLIP Radio #The full list of parameters and their meaning can be found in 6lbr.conf.example

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

RAW_ETH=0 BRIDGE=0 #DEV_BRIDGE=br0 #CREATE_BRIDGE=0 DEV_TAP=tap0 DEV_ETH=wlan0 RAW_ETH_FCS=0

DEV_RADIO=/dev/ttyACM0 BAUDRATE=115200

NODE_CONFIG=/etc/6lbr/node_config.conf

LOG_LEVEL=3 #INFO and above only root@raspberrypi:~#

and I added: net.ipv4.ip_forward = 1 net.ipv6.conf.all.forwarding=1 into my /etc/sysctl.d

but still no luck (don't see 6lbr webpage [bbbb::100]

janeksz avatar Jan 08 '17 22:01 janeksz

Well, I just made a set up with a pi and rasbian. Did you start the 6lbr service on the server ? sudo service 6lbr start

If it is not working, here is my conf

Interestingly, my ethernet connection is not named eth0 but enxb827eb15ec3a 1st do a ifconfig and check the name of your ethernet connection and correct the file with it 2nd, update your /etc/network/interfaces file


This file describes the network interfaces available on your system

and how to activate them. For more information, see interfaces(5).

The loopback network interface

auto lo iface lo inet loopback

The primary network interface

auto enxb827eb15ec3a iface enxb827eb15ec3a inet dhcp

Example to keep MAC address between reboots

#hwaddress ether DE:AD:BE:EF:CA:FE

The secondary network interface

#auto eth1 #iface eth1 inet dhcp

auto br0 iface br0 inet dhcp bridge_ports enxb827eb15ec3a bridge_stp off up echo 0 > /sys/devices/virtual/net/br0/bridge/multicast_snooping post-up ip link set br0 address `ip link show enxb827eb15ec3a | grep ether $

WiFi Example

auto wlan0 iface wlan0 inet dhcp

wpa-ssid "essid"

wpa-psk "password"


make a sudo service network-manager stop & sudo service network-manager start in order to take the config into consideration

and then, configure the 6lbr router in /etc/6lbr/6lbr.conf


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

RAW_ETH=0 BRIDGE=1 DEV_BRIDGE=br0 DEV_TAP=tap0 DEV_ETH=enxb827eb15ec3a RAW_ETH_FCS=1

DEV_RADIO=/dev/ttyACM0 BAUDRATE=115200

#Enable this line if radio device is not detected #SCAN_DEVICE=/usr/lib/6lbr/bb-scan-usb.sh

LOG_LEVEL=3 #INFO and above only


YOU HAVE TO SET DEV_RADIO=/dev/ttyACM0 accordingly to your slip device listed in ls /dev

DO NOT FORGET TO START THE 6LBR PROCESS AT EACH STARTUP sudo service 6lbr start Then, to enable internet, sudo sysctl -w net.ipv6.conf.enxb827eb15ec3a.accept_ra=1

florian-popup avatar Jan 09 '17 09:01 florian-popup

@florian-popup , Thanks, appreciate it, however it doesn't solve my problem. My system is running well if I use ethernet interface. I have a problem with wifi. As your 6lbr.conf suggest, you don't use wifi

janeksz avatar Jan 09 '17 21:01 janeksz

@janeksz Oh, yeah, sorry. I just made a setup bridging on the wifi interface and I can access the [bbbb:100] from it. I m not an expert, so there is things that I don't master but here is how I made it

In the /etc/network/interfaces, I used auto wlan0 iface wlan0 inet dhcp wpa-ssid "YOUR_SSID" wpa_psk "YOUR_PASSWORD"

When you modify /etc/network/interfaces, the network manager won't manage the devices anymore, so you have to edit /etc/NetworkManager/NetworkManager.conf and change the line managed=false for managed=true

Change the interfaces and 6lbr.conf files to bridge over wlan0 and restart your computer.

You should be connected to the wifi directly at startup.

I suppose that if ipv6 is disabled on your router, issues could happened due to the wifi interface being configured in dhcp mode. I have to test the stability of the bridge because all the interfaces are managed by the network manager now

florian-popup avatar Jan 10 '17 10:01 florian-popup

@florian-popup Thanks again. I have tried your suggestions (bridge over wlan0), but still no luck. I don't have NetworkManager on my Raspberry Pi as it doesn't come with Raspbian OS Do you think I should install it? Would it make a change?

janeksz avatar Jan 11 '17 01:01 janeksz

Well, I have exactly the same set up as you do : a rpi 3 with raspbian with a cc2650 as slip radio and 2 cc2650 as mote.

I had an issue using wlan0 because it couldn't bridge over br0. Check if you don't have the same issue (very likely because you can't use on wlan0 but can on eth0). You can check your /var/log/6lbr.log for the message error saying that 6lbr can't create a bridge between wlan0 and br0

I through that I found a way to make wlan0 bridge over br0 but it doens't work. Apparently making a bridge over wlan0 is not obvious for the pi. I'll work on it and keep you up to date.

Here is an usefull link https://www.raspberrypi.org/forums/viewtopic.php?t=39269

florian-popup avatar Jan 11 '17 07:01 florian-popup

@florian-popup I understand, that you don't have it working using wlan0, correct? It doesn't work for me on both RPi2 (using USB wifi dongle) and RPi3 (using built-in wifi) both using latest Raspbian and latest 6lbr. Both have network connection working and I am using them in headless mode. Thanks for looking at this issue and please, let me know if there is any new development. I will try to contact Laurent by email, to see his view.

janeksz avatar Jan 11 '17 21:01 janeksz

Bridging to a WiFi interface is complex and depends on several factors (and the old faq ins't really helpful about that, I will update it)

To have WiFi bridging you need two thinks :

  • The WiFi chipset must support AP mode (or promiscuous mode)
  • The WiFi interface must be configured as an Access Point (so the host must becomes a WiFi Router)

The confusion comes from some WiFI chipset and drivers that in the past allowed to bridge the WiFi interface even not in AP mode (which seems to be forbidden by the WiFi standard...)

If you don't want to make your host as a WiFi AP there are two solutions :

  • Use routing between the BR tap Interface and the WiFi interface, this can be done by enable ip forwarding in the host. The BR should be configured as SmartBridge with a manual configuration. An configuration example is available here : https://github.com/cetic/6lbr/wiki/6LBR-Interface-Configuration#routing-mode
  • Use ProxyARP to create a fake bridge between the BR Tap Interface and the WiFi bridge. This however will only work for IPv4. For IPv6 ou will need proxy_ndp or npdd. See https://wiki.debian.org/BridgeNetworkConnectionsProxyArp for how to setup proxy arp. And here to setup ndppd https://github.com/DanielAdolfsson/ndppd This solution is more flexible but also more complex to setup and I actually never tried it !

Tell me how it works for you and I will update the doc accordingly and if it does not work I'll find more information.

laurentderu avatar Jan 12 '17 14:01 laurentderu

Czesc Janek sorry za offtop, czy moglby sie z Toba skontaktowac, mam kilka pytan co do 6lbr w razie czego moj mail to [email protected]?

kameleon070 avatar Jan 15 '17 13:01 kameleon070

@laurentderu Thanks for helping, much appreciate it.

I"m trying to use solution 1 as suggested by you. My /etc/6lbr/6lbr.conf is:

####################################### _#This file contains a default configuration for Raspberry PI platform using #a Telos SLIP Radio #The full list of parameters and their meaning can be found in 6lbr.conf.example

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

RAW_ETH=0 BRIDGE=1 CREATE_BRIDGE=0 DEV_ETH=wlan0 DEV_BRIDGE=br0 DEV_TAP=tap0

RAW_ETH_FCS=0

DEV_RADIO=/dev/ttyACM0 BAUDRATE=115200

NODE_CONFIG=/etc/6lbr/node_config.conf

LOG_LEVEL=3 #INFO and above only_ ##################################################

my /etc/network/interfaces is:

#----------------------- source-directory /etc/network/interfaces.d

auto lo iface lo inet loopback

iface eth0 inet manual

iface wlan0 inet static address 0.0.0.0

auto br0 iface br0 inet dhcp bridge_ports wlan0 bridge_stp off up echo 0 > /sys/devices/virtual/net/br0/bridge/multicast_snooping post-up ip link set br0 address ip link show wlan0 | grep ether | awk '{print $2}'

allow-hotplug wlan0 iface wlan0 inet manual wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

iface default inet dhcp

#-----------------------

After rebooting and starting 6lbr service, my ifconfig is:

root@raspberrypi:~# ifconfig br0 Link encap:Ethernet HWaddr b8:27:eb:54:9c:2b inet addr:169.254.162.190 Bcast:169.254.255.255 Mask:255.255.0.0 inet6 addr: fe80::1d:4dff:fe71:34a7/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:8 errors:0 dropped:0 overruns:0 frame:0 TX packets:39 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1553 (1.5 KiB) TX bytes:8534 (8.3 KiB)

eth0 Link encap:Ethernet HWaddr b8:27:eb:01:c9:7e inet6 addr: fe80::8943:5157:2336:12a7/64 Scope:Link UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:4 errors:0 dropped:0 overruns:0 frame:0 TX packets:4 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1 RX bytes:240 (240.0 B) TX bytes:240 (240.0 B)

tap0 Link encap:Ethernet HWaddr 02:0a:0b:0c:0d:0e inet addr:169.254.77.32 Bcast:169.254.255.255 Mask:255.255.0.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:8 errors:0 dropped:0 overruns:0 frame:0 TX packets:51 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1665 (1.6 KiB) TX bytes:11353 (11.0 KiB)

wlan0 Link encap:Ethernet HWaddr b8:27:eb:54:9c:2b inet addr:172.19.115.1 Bcast:172.19.115.255 Mask:255.255.254.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:490 errors:0 dropped:43 overruns:0 frame:0 TX packets:129 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:83306 (81.3 KiB) TX bytes:17246 (16.8 KiB)

root@raspberrypi:~#

Still no luck, unable to access [bbbb::100] from web browser

my /var/log/6lbr.err doesn't show any error my /var/log/6lbr.ip shows: :: my /var/log/6lbr.ip4 shows: 0.0.0.0 my /var/log/6lbr.log shows:


Friday 13 January 04:10:52 UTC 2017 : Starting 6LBR /usr/lib/6lbr/bin/cetic_6lbr_router -c /etc/6lbr/nvm.dat -o /etc/6lbr/nvm.conf -s /dev/ttyACM0 -r -t wlan0 -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 -n /etc/6lbr/node_config.conf -m /usr/lib/6lbr/plugins
Contiki-develop-20161222 started with IPV6, RPL Rime started with address 1.2.3.4.5.6.7.8 MAC mac_wrapper RDC br-rdc SEC llsec-wrapper NETWORK sicslowpan 2017-01-13 4:10:52.701090: NOTICE: 6LBR: Starting 6LBR version 1.5.x (Contiki-develop-20161222) 2017-01-13 4:10:52.701498: INFO: ETH: 6LBR watchdog started (interval: 60) 2017-01-13 4:10:52.703168: INFO: NVM: NVM Magic : 2009 2017-01-13 4:10:52.703190: INFO: NVM: NVM Version : 5 2017-01-13 4:10:52.703198: INFO: CONFIG: Loading configuration : /etc/6lbr/nvm.conf wlan0 Link encap:Ethernet HWaddr b8:27:eb:54:9c:2b
inet addr:172.19.114.152 Bcast:172.19.115.255 Mask:255.255.254.0 inet6 addr: fe80::880d:43d2:b0ee:b09f/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:341 errors:0 dropped:274 overruns:0 frame:0 TX packets:108 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:83615 (81.6 KiB) TX bytes:15913 (15.5 KiB) ... 0306ff 2017-01-17 22:28:57.905108: PACKET: TAP: write: 291 2017-01-17 22:29:00.626391: PACKET: TAP: read: 382 2017-01-17 22:29:00.978081: PACKET: TAP: read: 382 2017-01-17 22:29:40.887363: PACKET: PF: bridge_output: Sending packet to Broadcast 2017-01-17 22:29:40.887575: PACKET: PF: wireless_output: sending packet 2017-01-17 22:29:40.887690: PACKET: PF: eth_output: broadcast 2017-01-17 22:29:44.363459: PACKET: TAP: read: 342 2017-01-17 22:29:50.946042: PACKET: TAP: read: 342 2017-01-17 22:30:00.991339: PACKET: TAP: read: 342 2017-01-17 22:30:01.899003: PACKET: ETH: write: 291 2017-01-17 22:30:01.899144: DUMP: ETH: ffffffff ffff0200 07b5cb00 08004500 0115000f 00004011 79ca0000 0000ffff ffff0044 00430101 ae880101 06000100 00000000 80000000 00000000 00000000 00000000 00000200 07b5cb00 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00006382 53633501 01370301 0306ff 2017-01-17 22:30:01.906529: PACKET: TAP: write: 291 2017-01-17 22:30:05.203519: PACKET: TAP: read: 382 2017-01-17 22:30:05.282624: PACKET: TAP: read: 382 2017-01-17 22:30:13.248182: PACKET: TAP: read: 342 2017-01-17 22:30:20.095790: PACKET: TAP: read: 342

Any conclusions?

janeksz avatar Jan 17 '17 22:01 janeksz

@janeksz If you intend to use the routing interfacing, with your configuration you are still bridging wlan0 and tap0, which does not work. You should have in your 6lbr.conf file :

BRIDGE=0
RAW_ETH=0

In your /etc/network/interfaces you should have a normal interface for wlan0, not a bridge.

If you have :: in 6lbr.ip, that means the BR is still waiting for the network configuration. You must instead configure it manually using the nvm_tool :

nvm_tool --update --wsn-accept-ra 0 /etc/6lbr/nvm.dat

Or, if you are using 1.5.x, remove the /etc/6lbr/nvm.dat file to reset to default configuration.

laurentderu avatar Jan 20 '17 08:01 laurentderu

@laurentderu, thanks but I am still confused, so will need your advice step by step. I will try again on Monday, as I'm away for weekend. My main confusion is to understand the difference between modes ( many of them) and interface configurations (3 types) and how they are related. Anyhow following your previous post:

Use routing between the BR tap Interface and the WiFi interface, this can be done by enable ip forwarding in the host. The BR should be configured as SmartBridge with a manual configuration. An configuration example is available here : https://github.com/cetic/6lbr/wiki/6LBR-Interface-Configuration#routing-mode_

my /etc/6lbr/6lbr.conf will be: ####################################### _#This file contains a default configuration for Raspberry PI platform using #a Telos SLIP Radio #The full list of parameters and their meaning can be found in 6lbr.conf.example

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

RAW_ETH=0 BRIDGE=0 CREATE_BRIDGE=0 DEV_ETH=wlan0 DEV_BRIDGE=br0 DEV_TAP=tap0

RAW_ETH_FCS=0

DEV_RADIO=/dev/ttyACM0 BAUDRATE=115200

NODE_CONFIG=/etc/6lbr/node_config.conf

LOG_LEVEL=3 #INFO and above only_ ##################################################

Is this correct?

janeksz avatar Jan 20 '17 09:01 janeksz

@laurentderu
and my /etc/network/interfaces is: //------------------------------------ source-directory /etc/network/interfaces.d

auto lo iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0 iface wlan0 inet manual wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf //-------------------------------------

root@raspberrypi:~# service 6lbr status ● 6lbr.service - LSB: 6LoWPAN Border Router Loaded: loaded (/etc/init.d/6lbr) Active: active (running) since Sun 2017-01-22 23:55:25 UTC; 2s ago Process: 888 ExecStart=/etc/init.d/6lbr start (code=exited, status=0/SUCCESS) CGroup: /system.slice/6lbr.service ├─894 /bin/sh /usr/lib/6lbr/6lbr /etc/6lbr/6lbr.conf ├─898 /usr/lib/6lbr/bin/cetic_6lbr_smart_bridge -c /etc/6lbr/nvm.d... ├─899 /bin/sh /usr/lib/6lbr/6lbr-watchdog 898 60 3 /var/log/6lbr.t... └─982 sleep 1

Jan 22 23:55:24 raspberrypi 6lbr[888]: Starting 6LoWPAN Border Router:. Jan 22 23:55:25 raspberrypi systemd[1]: Started LSB: 6LoWPAN Border Router. //---------------------------------- root@raspberrypi:~# ifconfig eth0 Link encap:Ethernet HWaddr b8:27:eb:01:c9:7e inet6 addr: fe80::8943:5157:2336:12a7/64 Scope:Link UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:4 errors:0 dropped:0 overruns:0 frame:0 TX packets:4 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1 RX bytes:240 (240.0 B) TX bytes:240 (240.0 B)

tap0 Link encap:Ethernet HWaddr 02:0a:0b:0c:0d:0e inet addr:169.254.77.32 Bcast:169.254.255.255 Mask:255.255.0.0 inet6 addr: fe80::ce9d:13fd:1f4:8248/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:5 errors:0 dropped:0 overruns:0 frame:0 TX packets:44 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1455 (1.4 KiB) TX bytes:10147 (9.9 KiB)

wlan0 Link encap:Ethernet HWaddr b8:27:eb:54:9c:2b inet addr:172.19.114.51 Bcast:172.19.115.255 Mask:255.255.254.0 inet6 addr: fe80::880d:43d2:b0ee:b09f/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:327 errors:0 dropped:232 overruns:0 frame:0 TX packets:143 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:72747 (71.0 KiB) TX bytes:26358 (25.7 KiB)

root@raspberrypi:~# //----------------------------------------- /var/log/6lbr.ip is: aaaa::212:4b00:7b5:cb00

looks close, but no cigar (unable to access [bbbb::100] from web browser)

Attached is the log file (renamed from6lbr.log to 6lbr.txt) 6lbr.txt

janeksz avatar Jan 23 '17 00:01 janeksz

@laurentderu Thanks for helping Additional info - my nvm.dat is: root@raspberrypi:~# cat /var/log/6lbr.ip aaaa::212:4b00:7b5:cb00 root@raspberrypi:~# /usr/lib/6lbr/bin/nvm_tool --print /etc/6lbr/nvm.dat Reading nvm file '/etc/6lbr/nvm.dat' Channel : 25 PAN ID : abcd

WSN network prefix : aaaa:: WSN network prefix length : 64 WSN IP address : aaaa::100 WSN accept RA : False WSN IP address autoconf : True WSN 6LoWPAN context 0 : fd00:: DNS server : ::

Eth network prefix : bbbb:: Eth network prefix length : 64 Eth IP address : bbbb::100 Eth default router : :: Eth IP address autoconf : False

RA daemon : True RA router lifetime : 0 RA maximum interval : 600 RA minimum interval : 200 RA minimum delay : 3 RA PIO enabled : True RA prefix valid lifetime : 86400 RA prefix preferred lifetime : 14400 RA RIO enabled : True RA RIO lifetime : 1800

RPL instance ID : 30 RPL DODAG ID manual : False RPL DODAG ID : :: RPL DODAG ID global : True RPL Preference : 0 RPL version ID : : 63 RPL DIO interval doubling : 8 RPL DIO minimum interval : 12 RPL DIO redundancy : 10 RPL default lifetime : 30 RPL maximum rank increase : 1792 RPL minimum rank increment : 256 RPL lifetime unit : 1

RPL DAO ACK : False RPL DAO ACK local repair : False DIO triggers route refresh : True MAC layer : 1 Security layer : 0 Security level : 6 Security key : 0:1:2:3:4:5:6:7:8:9:a:b:c:d:e:f Noncoresec anti-replay enabled : False Noncoresec anti-replay workaround : False Filter unknown nodes : False

NAT 64 Enabled : True NAT 64 DHCP Enabled : True NAT 64 static port mapping Enabled : True NAT 64 RFC-6052 prefix : True NAT 64 address : 192.168.1.55 NAT 64 netmask : 255.255.255.0 NAT 64 gateway : 172.19.114.1

Local address rewrite : True Smart Multi BR : False Webserver configuration page disabled : False Webserver port : 80

root@raspberrypi:~#

janeksz avatar Jan 23 '17 02:01 janeksz

@janeksz Ok so I made 6lbr working over wifi on the rpi ! You have to play with all the routing tables !

In order to do this, you have to desactivate the bridge in the 6lbr conf and interface conf files MODE=ROUTER BRIDGE = 0 #You want to redirect the connection yourself DEV_ETH=wlan0 RAW_ETH = 0

then in your interface file, you should not define br0

Once you restarted 6lbr, take a look at the ipv6 routing table sudo route -6 -n

Here is my network conf, adapt the command to yours bbbb::100 6lbr server address bbbb::/64 6lbr network addresses fd00::/64 node network addresses 192.168.150.251 local wifi address (configured static) 192.168.150.249 6lbr ip64 server address

what you have to do is

  1. Declare that all address to bbbb::/64 shall go through to bbbb::100 on interface tap0 sudo route -A inet6 add bbbb::/64 gw bbbb::100 dev tap0

  2. Declare that wlan0 can reach the network bbbb::/64 via the local loopback (cf the previous rule) sudo route -A inet6 add bbbb::/64 dev wlan0

  3. Declare that wlan0 can reach your device network fd00::/64 or aaaa::/64 for you via bbbb::100 sudo route -A inet6 add fd00::/64 gw bbbb::100 dev wlan0

  4. ONLY IF YOU HAVE AN IPV6 network enabled, On your client computer, add a rule to say that in order to reach your 6lbr server, you have to pass through the ip address of the wifi network address of your server sudo route -A inet6 add bbbb::100 via SERVER'S WIFI IPV6 LOCAL ADDRESS sudo route -A inet6 add fd00::/64 via SERVER'S WIFI IPV6 LOCAL ADDRESS

That's it for ipv6

IF YOU WANT TO USE IP64

  1. Declare that your 6lbr ipv4 server address (192.168.150.249) can be reached via tap0 sudo ip route add 192.168.150.249 dev tap0 Be aware that this address should be different than your wifi local network address !!!

  2. On your client computer, add a rule to say that in order to reach your 6lbr server, you have to pass through the ip address of the wifi network address of your server (192.168.150.251 for me) sudo ip route add 192.168.150.249 via 192.168.150.251

Don't forget to enable ipv4 forwarding on the server side sudo sysctl net.ipv4.ip_forward=1

YOU SHOULD BE ABLE TO REACH THE 6LBR SERVER FROM IPV4 192.168.150.249

Then to access via IPV6 ONLY IF YOU DON'T HAVE AN IPV6 network enabled, you have to tunnel all ipv6 address (or only your ipv6 server address to 192.168.150.249), using for example 6to4 on your client computer cf tunnel bbbb::100 via 192.168.150.249

florian-popup avatar Jan 23 '17 08:01 florian-popup

@florian-popup , thanks for sharing //------------------------ my /etc/6lbr/6lbr.conf is same as yours root@raspberrypi:~# service 6lbr status ● 6lbr.service - LSB: 6LoWPAN Border Router Loaded: loaded (/etc/init.d/6lbr) Active: active (running) since Tue 2017-01-24 00:00:58 UTC; 5min ago Process: 2836 ExecStop=/etc/init.d/6lbr stop (code=exited, status=0/SUCCESS) Process: 2848 ExecStart=/etc/init.d/6lbr start (code=exited, status=0/SUCCESS) CGroup: /system.slice/6lbr.service ├─2856 /bin/sh /usr/lib/6lbr/6lbr /etc/6lbr/6lbr.conf ├─2864 /usr/lib/6lbr/bin/cetic_6lbr_router -c /etc/6lbr/nvm.dat -o... ├─2865 /bin/sh /usr/lib/6lbr/6lbr-watchdog 2864 60 3 /var/log/6lbr... └─4911 sleep 1 Jan 24 00:00:58 raspberrypi 6lbr[2848]: Starting 6LoWPAN Border Router:. Jan 24 00:00:58 raspberrypi systemd[1]: Started LSB: 6LoWPAN Border Router. //-------------------- root@raspberrypi:~# sudo route -6 -n Kernel IPv6 routing table Destination Next Hop Flag Met Ref Use If ::1/128 :: U 256 0 0 lo bbbb::/64 :: U 205 0 0 tap0 fe80::/64 :: U 256 0 0 eth0 fe80::/64 :: U 256 0 0 wlan0 fe80::/64 :: U 256 0 0 tap0 ::/0 :: !n -1 1 17 lo ::1/128 :: Un 0 3 3 lo bbbb::/128 :: Un 0 1 0 lo bbbb::846b:e981:733d:e263/128 :: Un 0 1 0 lo fe80::/128 :: Un 0 1 0 lo fe80::/128 :: Un 0 1 0 lo fe80::880d:43d2:b0ee:b09f/128 :: Un 0 1 0 lo fe80::8dc8:28b2:6a4b:9633/128 :: Un 0 1 0 lo ff00::/8 :: U 256 0 0 eth0 ff00::/8 :: U 256 3 15 wlan0 ff00::/8 :: U 256 4 30 tap0 ::/0 :: !n -1 1 17 lo root@raspberrypi:~# //--------------------------------------------- root@raspberrypi:~# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 172.19.114.1 0.0.0.0 UG 303 0 0 wlan0 169.254.0.0 0.0.0.0 255.255.0.0 U 205 0 0 tap0 172.19.114.0 0.0.0.0 255.255.254.0 U 303 0 0 wlan0 root@raspberrypi:~# //--------------------------------------

Next I executed steps 1,2,3 as per your post above (same addresses as yours) root@raspberrypi:~# sudo route -A inet6 add bbbb::/64 gw bbbb::100 dev tap0 root@raspberrypi:~# sudo route -A inet6 add bbbb::/64 dev wlan0 root@raspberrypi:~# sudo route -A inet6 add fd00::/64 gw bbbb::100 dev wlan0 root@raspberrypi:~# I have tried here on Windows client IPv6 network, theoretically it should work now, but it doesn't root@raspberrypi:~# cat /var/log/6lbr.ip bbbb::100 root@raspberrypi:~# cat /var/log/6lbr.ip4 0.0.0.0 root@raspberrypi:~# from web browser - The server at bbbb::100 is taking too long to respond. //------------------------------------------

Moving into IPV4 network. I am not getting IPv4 address from 6lbr root@raspberrypi:~# cat /var/log/6lbr.ip4 0.0.0.0 root@raspberrypi:~#

root@raspberrypi:~# /usr/lib/6lbr/bin/nvm_tool --print /etc/6lbr/nvm.dat Reading nvm file '/etc/6lbr/nvm.dat' Channel : 25 PAN ID : abcd

WSN network prefix : aaaa:: WSN network prefix length : 64 WSN IP address : aaaa::100 WSN accept RA : False WSN IP address autoconf : True WSN 6LoWPAN context 0 : fd00:: DNS server : ::

Eth network prefix : bbbb:: Eth network prefix length : 64 Eth IP address : bbbb::100 Eth default router : :: Eth IP address autoconf : False

RA daemon : True RA router lifetime : 0 RA maximum interval : 600 RA minimum interval : 200 RA minimum delay : 3 RA PIO enabled : True RA prefix valid lifetime : 86400 RA prefix preferred lifetime : 14400 RA RIO enabled : True RA RIO lifetime : 1800

RPL instance ID : 30 RPL DODAG ID manual : False RPL DODAG ID : :: RPL DODAG ID global : True RPL Preference : 0 RPL version ID : : 75 RPL DIO interval doubling : 8 RPL DIO minimum interval : 12 RPL DIO redundancy : 10 RPL default lifetime : 30 RPL maximum rank increase : 1792 RPL minimum rank increment : 256 RPL lifetime unit : 1

RPL DAO ACK : False RPL DAO ACK local repair : False DIO triggers route refresh : True MAC layer : 1 Security layer : 0 Security level : 6 Security key : 0:1:2:3:4:5:6:7:8:9:a:b:c:d:e:f Noncoresec anti-replay enabled : False Noncoresec anti-replay workaround : False Filter unknown nodes : False

NAT 64 Enabled : True NAT 64 DHCP Enabled : True NAT 64 static port mapping Enabled : True NAT 64 RFC-6052 prefix : False NAT 64 address : 192.168.1.55 NAT 64 netmask : 255.255.255.0 NAT 64 gateway : 172.19.114.1

Local address rewrite : True Smart Multi BR : False Webserver configuration page disabled : False Webserver port : 80

root@raspberrypi:~# /usr/lib/6lbr/bin/nvm_tool --print /etc/6lbr/nvm.dat

//---------------------- I want to use IP64. I have modified /etc/6lbr/nvm.dat for NAT64 DHCP as above, but I am unable to obtain an IPv4 address from 6lbr, so I am stack here ...

janeksz avatar Jan 24 '17 00:01 janeksz

@florian-popup @laurentderu On my working 6lbr version I checked IP64 address here: 6lbr even if it is not shown here: root@raspberrypi:~# cat /var/log/6lbr.ip4 0.0.0.0 How can I read valid IP64 address from the command line?

janeksz avatar Jan 24 '17 03:01 janeksz

@janeksz You don't get any ip address because you have NAT 64 DHCP Enabled DHCP is a protocol that gives dynamically the ip addresses Desactivate it and you will get your ip address defined as 192.168.1.55 if there is no conflict (ip not already given by the dhcp router to another device). You can check if that ip is free with a ping on that address without 6lbr started

florian-popup avatar Jan 24 '17 08:01 florian-popup

@janeksz

Just after you start 6lbr, check if you can reach [bbbb::100] from your rpi. If you don't, there is an issue with the routing table. You have to delete all routing rules related to bbbb and wlan at the same time sudo route -A inet6 del bbbb::/64 dev wlan0 sudo route -A inet6 del bbbb::/64 gw bbbb::100 dev wlan0

Then follow all the steps as I descibed.

EDIT !!!!!!!!!!!!!!!! YOU HAVE TO ENABLE THE POSTROUTING sudo iptables -t nat -A POSTROUTING -j MASQUERADE You should get a response after entering that line.

If you want to go deeper in the network configuration and securise your device, I invite you to take a look at -Static addressing plan -Ipv4 forwarding -Paquet forwarding

The command I gave for the network configuration are really loose about it ! But if you trust your local network and have a firewall (ie box internet), you should be fine

florian-popup avatar Jan 24 '17 09:01 florian-popup

@florian-popup, thanks again re DHCP, I actually want a dynamic address and in my old system it is created and both IPv6 and IP64 work, but there is still a question how to read it from the command line (not GUI). In university environment IP addresses change very frequently and it is hard to have a static IP

janeksz avatar Jan 24 '17 10:01 janeksz

@florian-popup, thanks again. I will try your further suggestion, when back at uni.

janeksz avatar Jan 24 '17 10:01 janeksz

@janeksz As Laurent suggested, ProxyARP would be worth a look. It will basiclly do the same thing as changing the ip tables and allowing ip forwarding but you won't have to manipulate the ip tables nor weaken the security and you would be able to use dhcp easly, have an autoconfiguration & autostart

florian-popup avatar Jan 24 '17 13:01 florian-popup

@florian-popup , thanks for your patience, that thing is killing me, I wish I knew more about networking.

After starting 6lbr service, bbbb::100 is reachable from RPi: root@raspberrypi:~# ping6 bbbb::100 PING bbbb::100(bbbb::100) 56 data bytes 64 bytes from bbbb::100: icmp_seq=1 ttl=64 time=8.17 ms

After executing: sudo route -A inet6 add bbbb::/64 gw bbbb::100 dev tap0 sudo route -A inet6 add bbbb::/64 dev wlan0 sudo route -A inet6 add fd00::/64 gw bbbb::100 dev wlan0 my routing table looks like this: root@raspberrypi:~# route -6 -n Kernel IPv6 routing table Destination Next Hop Flag Met Ref Use If ::1/128 :: U 256 0 0 lo bbbb::/64 bbbb::100 UG 1 0 0 tap0 bbbb::/64 :: U 204 1 5 tap0 fe80::/64 :: U 256 0 0 eth0 fe80::/64 :: U 256 0 0 wlan0 fe80::/64 :: U 256 0 0 tap0 ::/0 :: !n -1 1 22 lo ::1/128 :: Un 0 3 3 lo bbbb::/128 :: Un 0 1 0 lo bbbb::846b:e981:733d:e263/128 :: Un 0 4 5 lo fe80::/128 :: Un 0 1 0 lo fe80::/128 :: Un 0 1 0 lo fe80::4a90:102:ce61:3090/128 :: Un 0 1 0 lo fe80::880d:43d2:b0ee:b09f/128 :: Un 0 1 0 lo ff00::/8 :: U 256 0 0 eth0 ff00::/8 :: U 256 3 15 wlan0 ff00::/8 :: U 256 3 28 tap0 ::/0 :: !n -1 1 22 lo

On my Windows client, still no access to [bbbb::100]

Can you see anything obviously wrong?

routing1

janeksz avatar Jan 24 '17 23:01 janeksz

@janeksz Your ip table is fine

Ok, so when you use route rules, the 6lbr servers interface isn't connected directly to you local network. Thus, you can't use DHCP or access to 6lbr directly.

So you have to enable ip forwarding (in your case ipv6 forwarding) on your rpi sysctl -w net.ipv6.conf.all.forwarding=1

Use masquerade too in sixx mode on your rpi sudo ip6tables -t nat -A POSTROUTING -o sixxs -j MASQUERADE

DO NOT FORGET that you can't reach the bbbb::/64 network directly on a client because the local network router (ie your internet box) does either not listen to that network and cannot reach the 6lbr serveur interface.

Only your rpi knows how to reach the bbbb network via the rules in the ip tables The way I used to resolve that problem is to create a rule in the ip table of the client saying that in order to reach the bbbb network, you have to pass through the local network interface of your pi. On a debian client machine, it would be sudo route -A inet6 add bbbb::/64 gw YOUR_RPIS_WLAN_IPV6_ADDR dev wlan0 take a look here for windows route manipulation http://www.colorconsole.de/cmd/en/Windows_7/netsh/interface/ipv6/add/route.htm

(that works for ipv4, I tested it 2 times howerver, I don't have any ipv6 network and router configured so I can't test it but the mechanisms are exactly the same)

I m trying to set up an ARP on the rpi so there will be no need of such route rules, the 6lbr interface will be seen as a part of the local network thus, enabling DHCP, direct addressing ... but this is not my priority right now

Tell me if you succeed. I keep you up to date for the arp

florian-popup avatar Jan 25 '17 07:01 florian-popup

@florian-popup Thank you for providing such detailed information, I will try to digest it and improve the documentation :) Maybe your configuration could be simplified by switching to SmartBridge mode and statically configure the 6LBR IPv6 address and prefix. With that the bbbb::/64 is no longer needed and you could only keep the fd00::/64 routing.

@janeksz Related to https://github.com/cetic/6lbr/issues/237#issuecomment-274698558, I looked at it and it's actually a bug. The .ip file is not updated when the IPv4 configuration is changed. I will fix that.

If you can modify the configuration of your WiFi AP and if it is sufficiently advanced, you could configure it to add a Route Information Option in the IPv6 network configuration to create the routes for the fd00::/64 (and bbbb::/64) subnets via the RPi link local wlan address. This is what 6LBR is doing to create the route to the WSN when in Router mode.

laurentderu avatar Jan 26 '17 09:01 laurentderu

@florian-popup, @laurentderu , thank you both. I am away for a few days. I couldn't make it work for now, will have a look again later.

janeksz avatar Jan 26 '17 10:01 janeksz

Hello everyone, I have already built the 6lbr many times, but since yesterday I am having problems. I'm trying to create a new system and when I click on the [bbbb :: 100] the sensor page, says connection failed. It will be a new update?

MarCast avatar Jan 27 '17 11:01 MarCast

@MarCast, try to return to the last working version (hardware and software) and then change one thing at a time. That is, what I do, when in trouble. Good luck.

janeksz avatar Jan 29 '17 03:01 janeksz

@florian-popup thanks for your message above on wlan0.

In my case, I am trying the simple pi setup as shown in the page below:

https://github.com/cetic/6lbr/wiki/Example-1:-Hello-6LBR

Instead of connecting eth0 to another computer, I have plugged it directly into the network. (The RJ45 cable of the Pi.)

So in that case, what is the correct routing command to be applied so that I can bring up [bbbb::100] in the browser? Currently it refuses to connect.

Thanks for any help.

electronut avatar Feb 10 '17 04:02 electronut