cetic / 6lbr

A deployment-ready 6LoWPAN Border Router solution based on Contiki
github.com/cetic/6lbr/wiki
Other
337 stars 194 forks source link

how to open the web page in Smart-Bridge mode? #347

Closed steven3w closed 6 years ago

steven3w commented 7 years ago

Hi,

With CC1310 and beaglebone black, I have tried Raw, and bridge, they work well. Now I try smart-bridge, I can ping the sensor in the host, but I can not open the web page.

The 6lbr.conf: /etc/6lbr/6lbr.conf

MODE=ROUTER

MODE=SMART-BRIDGE

RAW_ETH=0 BRIDGE=0 CREATE_BRIDGE=0 DEV_BRIDGE=br0 DEV_TAP=tap0 DEV_ETH=eth0 RAW_ETH_FCS=0 DEV_RADIO=/dev/ttyUSB0 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

The 60dev file is as follow:

#!/bin/bash
#ifup eth0
ip -6 address add fd00::2/64 dev tap0
sysctl -w net.ipv4.conf.all.forwarding=1
sysctl -w net.ipv6.conf.all.forwarding=1

/usr/lib/6lbr/bin/nvm_tool --print /etc/6lbr/nvm.dat Reading nvm file '/etc/6lbr/nvm.dat' Channel : 24 PAN ID : abcd

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

Eth network prefix : bbbb:: Eth network prefix length : 64 Eth IP address : bbbb::100 Eth default router : bbbb::109 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 : : 19 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 : 256

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 : False NAT 64 static port mapping Enabled : True NAT 64 RFC-6052 prefix : True NAT 64 address : 192.168.16.222 NAT 64 netmask : 255.255.255.0 NAT 64 gateway : 192.168.16.1

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


eth0      Link encap:Ethernet  HWaddr 80:30:dc:5e:f4:05
          inet addr:192.168.16.137  Bcast:192.168.16.255  Mask:255.255.255.0
          inet6 addr: fe80::8230:dcff:fe5e:f405/64 Scope:Link
          inet6 addr: bbbb::3/128 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:15147 errors:0 dropped:3 overruns:0 frame:0
          TX packets:1240 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2778484 (2.6 MiB)  TX bytes:189966 (185.5 KiB)
          Interrupt:40

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:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

tap0      Link encap:Ethernet  HWaddr 02:0a:0b:0c:0d:0e
          inet6 addr: fd00::2/64 Scope:Global
          inet6 addr: fe80::a:bff:fe0c:d0e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:906 errors:0 dropped:0 overruns:0 frame:0
          TX packets:34 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:78012 (76.1 KiB)  TX bytes:5561 (5.4 KiB)

usb0      Link encap:Ethernet  HWaddr 80:30:dc:5e:f4:00
          inet addr:192.168.7.2  Bcast:192.168.7.255  Mask:255.255.255.0
          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)      

the /var/log/6lbr.log is as follows:

Fri Nov 13 03:00:09 CST 2015 : Starting 6LBR /usr/lib/6lbr/bin/cetic_6lbr_smart_bridge -c /etc/6lbr/nvm.dat -o /etc/6lbr/nvm.conf -s /dev/$ Contiki-6lbr-1.4.1 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 2015-11-13 3:00:09.615203: NOTICE: 6LBR: Starting 6LBR version 1.4.1 (Contiki-6lbr-1.4.1) 2015-11-13 3:00:09.616932: INFO: ETH: 6LBR watchdog started (interval: 60) 2015-11-13 3:00:09.633288: INFO: PLUGIN: Loading /usr/lib/6lbr/plugins/dummy.so 2015-11-13 3:00:09.633641: ERROR: PLUGIN: Could not open /usr/lib/6lbr/plugins/dummy.so : /us$ 2015-11-13 3:00:09.642096: INFO: PLUGIN: Loading /usr/lib/6lbr/plugins/lwm2m.so 2015-11-13 3:00:09.642401: ERROR: PLUGIN: Could not open /usr/lib/6lbr/plugins/lwm2m.so : /us$ 2015-11-13 3:00:09.643949: INFO: NVM: NVM Magic : 2009 2015-11-13 3:00:09.644009: INFO: NVM: NVM Version : 5 2015-11-13 3:00:09.644042: INFO: CONFIG: Loading configuration : /etc/6lbr/nvm.conf 2015-11-13 3:00:09.644153: WARN: CONFIG: Can not open /etc/6lbr/nvm.conf : No such file or di$ 2015-11-13 3:00:09.644225: NOTICE: 6LBR: Log level: 30 (services: ffffffff) 2015-11-13 3:00:09.644246: INFO: MAC: Using 'csma' mac driver 2015-11-13 3:00:09.653846: INFO: SLIP: SLIP started on /dev/ttyUSB0 2015-11-13 3:00:09.667461: INFO: SCMD: Started br-cmd process 2015-11-13 3:00:09.667675: INFO: BR-RDC: Reset SLIP Radio 2015-11-13 3:00:09.667730: INFO: BR-RDC: Fetching MAC address 2015-11-13 3:00:09.669758: ERROR: BR-RDC: br-rdc: failed to parse 2 2015-11-13 3:00:09.672802: ERROR: SLIP: Unknown command 2015-11-13 3:00:09.673145: ERROR: SLIP: Unknown command
2015-11-13 3:00:09.677135: INFO: BR-RDC: Got MAC: 00:12:4b:00:0e:cb:f1:eb 2015-11-13 3:00:10.667953: INFO: ETH: TAP Ethernet interface init 2015-11-13 3:00:10.693586: INFO: TAP: opened device /dev/tap0 2015-11-13 3:00:10.694011: INFO: TAP: Running 6lbr-ifup script '/usr/lib/6lbr/6lbr-ifup' net.ipv4.conf.all.forwarding = 1 net.ipv6.conf.all.forwarding = 1 yes tap0 Link encap:Ethernet HWaddr 02:0a:0b:0c:0d:0e inet6 addr: fd00::2/64 Scope:Global inet6 addr: fe80::a:bff:fe0c:d0e/64 Scope:Link UP BROADCAST RUNNING 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:500 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

2015-11-13 3:00:11.330561: INFO: ETH: Eth MAC address : 02:00:0e:cb:f1:eb
2015-11-13 3:00:11.330892: INFO: LLSEC: Using 'nullsec' llsec driver 2015-11-13 3:00:11.330973: INFO: 6LBR: Security layer initialized 2015-11-13 3:00:11.333354: ERROR: SLIP: Unknown command 2015-11-13 3:00:11.333663: INFO: HTTP: Starting webserver on port 80 2015-11-13 3:00:11.334148: INFO: NODECFG: Node Config init 2015-11-13 3:00:11.334244: INFO: NODECFG: No node_config.conf file specified 2015-11-13 3:00:11.334324: INFO: 6LBR: Tentative local IPv6 address fe80::212:4b00:ecb:f1eb 2015-11-13 3:00:11.334554: INFO: 6LBR: Tentative global IPv6 address fd00::100 2015-11-13 3:00:11.334670: INFO: 6LBR: Checking addresses duplication 2015-11-13 3:00:11.337262: INFO: 6LBR: Configured as DODAG Root fd00::100 2015-11-13 3:00:11.337530: INFO: 6LBR: Starting IP64 2015-11-13 3:00:11.337643: INFO: 6LBR: IPv4 address : 192.168.16.222 2015-11-13 3:00:11.337729: INFO: 6LBR: Starting as SMART-BRIDGE 2015-11-13 3:00:11.338854: INFO: CONFIG: Loading configuration : /etc/6lbr/nvm.conf 2015-11-13 3:00:11.338984: WARN: CONFIG: Can not open /etc/6lbr/nvm.conf : No such file or di$ 2015-11-13 3:00:11.341281: INFO: UDPS: UDP server started CoAP push started
CoAP server started 2015-11-13 3:00:11.341571: INFO: DNS: DNS proxy started 2015-11-13 3:00:11.341653: INFO: CONFIG: Loading configuration : /etc/6lbr/nvm.conf 2015-11-13 3:00:11.341762: WARN: CONFIG: Can not open /etc/6lbr/nvm.conf : No such file or di$ 2015-11-13 3:00:11.341839: INFO: 6LBR: CETIC 6LBR Started RD client started

the /var/log/6lbr.ip
fd00::100

with the above settings, and a sensor with ipv6=fd00::212:4b00:a27:c794, I can ping it successfully in the host.

My question is how to open the web page in Smart-bridge mode?

The reason I have to use the smart-bridge is that in the https://github.com/cetic/6lbr/wiki/6LBR-Interface-Configuration, it said that

Important note: Your Ethernet driver must support Promiscuous mode! If not the bridge won't work properly and you will have intermittent connectivity with 6LBR. The Ethernet driver of the Beaglebone does not support promiscuous mode!

Best regards

Dr. Steven Dong

laurentderu commented 6 years ago

You are confusing the configuration of the 6LBR interface and the operational mode. SmartBridge mode is not related at all with the bridge configuration of the 6LBR tap interface.

The bridge configuration of the interface means the tap interface of 6LBR is bridged with the Ethernet interface of your host.

SmartBridge oeprational mode means that the WSN network is in the same subnet as your Ethernet segment.