Skip to content

sliptty/start_network.sh: configure global address for SLIP interface#13572

Merged
benpicco merged 5 commits intoRIOT-OS:masterfrom
miri64:sliptty/enh/global-addr
Mar 8, 2020
Merged

sliptty/start_network.sh: configure global address for SLIP interface#13572
benpicco merged 5 commits intoRIOT-OS:masterfrom
miri64:sliptty/enh/global-addr

Conversation

@miri64
Copy link
Copy Markdown
Member

@miri64 miri64 commented Mar 6, 2020

Contribution description

This way hosts without pre-configured IPv6 addresses can also reach global addresses within a downstream network.

I also piggy-backed some fixes and doc updates for the -e parameter to the script. The parameter came in late in #10477 so those fell through.

Testing procedure

From the host ping the global address of the downstream interface of the examples/gnrc_border_router application from the SLIP interface. Without this change it won't work (some ping implementations ignore the -I argument but print a warning like ping6: Warning: source address might be selected on device other than: sl0), with this change it will.

My testing went as follows:

Terminal 1

$ RIOT_CI_BUILD=1 USE_SLIP=1 make -C examples/gnrc_border_router/ -j16 flash --no-print-directory term
Building application "gnrc_border_router" for "samr21-xpro" with MCU "samd21".

   text	   data	    bss	    dec	    hex	filename
  79164	    140	  22296	 101600	  18ce0	/home/mlenders/Repositories/RIOT-OS/RIOT/examples/gnrc_border_router/bin/samr21-xpro/gnrc_border_router.elf
/home/mlenders/Repositories/RIOT-OS/RIOT/dist/tools/edbg/edbg  --target samr21 --verbose --file /home/mlenders/Repositories/RIOT-OS/RIOT/examples/gnrc_border_router/bin/samr21-xpro/gnrc_border_router.bin --verify || /home/mlenders/Repositories/RIOT-OS/RIOT/dist/tools/edbg/edbg  --target samr21 --verbose --file /home/mlenders/Repositories/RIOT-OS/RIOT/examples/gnrc_border_router/bin/samr21-xpro/gnrc_border_router.bin --verify --program
Debugger: ATMEL EDBG CMSIS-DAP ATML2127031800008319 01.1A.00FB (S)
Clock frequency: 16.0 MHz
Target: SAM R21G18 (Rev D)
Programming......................................................................................................................................................................................................................................................................................................................... done.
Verification......................................................................................................................................................................................................................................................................................................................... done.
sudo sh /home/mlenders/Repositories/RIOT-OS/RIOT/dist/tools/sliptty/start_network.sh 2001:db8::/64 /dev/ttyACM0 115200
Device "sl0" does not exist.
net.ipv6.conf.all.forwarding = 1
Activated forwarding for all interfaces.
Deactivate with
    sudo sysctl -w net.ipv6.conf.all.forwarding=0
when not desired without this script
net.ipv6.conf.sl0.accept_ra = 2
Starting dispatch. TUN: 3, Stream: 4, In: 0, Out: 1
uhcp_client(): sending REQ...
got packet from fe80::e304:f552:244f:5f3a port 48209
uhcp: push from fe80::e304:f552:244f:5f3a:48209 prefix=2001:db8::/64
gnrc_uhcpc: uhcp_handle_prefix(): add compression context 0 for prefix 2001:db8::28ab:dc15:5401:6478/64
gnrc_uhcpc: uhcp_handle_prefix(): configured new prefix 2001:db8::28ab:dc15:5401:6478/64
ifconfig
ifconfig
Iface  7 
          MTU:65535  HL:64  RTR  
          RTR_ADV  
          Link type: wired
          inet6 addr: fe80::2  scope: link  VAL
          inet6 group: ff02::2
          inet6 group: ff02::1
          inet6 group: ff02::1:ff00:2
          
Iface  6  HWaddr: 67:E7  Channel: 26  Page: 0  NID: 0x23
          Long HWaddr: 2A:AB:DC:15:54:01:64:78 
           TX-Power: 0dBm  State: IDLE  max. Retrans.: 3  CSMA Retries: 4 
          AUTOACK  ACK_REQ  CSMA  L2-PDU:102 MTU:1280  HL:64  RTR  
          RTR_ADV  6LO  IPHC  
          Source address length: 8
          Link type: wireless
          inet6 addr: fe80::28ab:dc15:5401:6478  scope: link  VAL
          inet6 addr: 2001:db8::28ab:dc15:5401:6478  scope: global  VAL
          inet6 group: ff02::2
          inet6 group: ff02::1
          inet6 group: ff02::1:ff01:6478

Terminal 2

[mlenders@sarajevo RIOT]<3 ping6 -I sl0 2001:db8::28ab:dc15:5401:6478
PING 2001:db8::28ab:dc15:5401:6478(2001:db8::28ab:dc15:5401:6478) from fdea:dbee:f::1 sl0: 56 data bytes
64 bytes from 2001:db8::28ab:dc15:5401:6478: icmp_seq=1 ttl=64 time=19.4 ms
64 bytes from 2001:db8::28ab:dc15:5401:6478: icmp_seq=2 ttl=64 time=19.5 ms
64 bytes from 2001:db8::28ab:dc15:5401:6478: icmp_seq=3 ttl=64 time=19.5 ms
64 bytes from 2001:db8::28ab:dc15:5401:6478: icmp_seq=4 ttl=64 time=19.6 ms
64 bytes from 2001:db8::28ab:dc15:5401:6478: icmp_seq=5 ttl=64 time=19.6 ms
64 bytes from 2001:db8::28ab:dc15:5401:6478: icmp_seq=6 ttl=64 time=19.4 ms
64 bytes from 2001:db8::28ab:dc15:5401:6478: icmp_seq=7 ttl=64 time=19.5 ms
64 bytes from 2001:db8::28ab:dc15:5401:6478: icmp_seq=8 ttl=64 time=19.4 ms
^C

Issues/PRs references

Follow-up to #10477 and #10480.

@miri64 miri64 requested review from benpicco and bergzand March 6, 2020 10:57
@miri64 miri64 added Area: network Area: Networking Area: tools Area: Supplementary tools Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: skip compile test If set, CI server will run only non-compile jobs, but no compile jobs or their dependent jobs labels Mar 6, 2020
Copy link
Copy Markdown
Contributor

@benpicco benpicco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, please squash!

@miri64 miri64 force-pushed the sliptty/enh/global-addr branch from 99af29e to 0bd58bd Compare March 8, 2020 13:46
@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Mar 8, 2020

Squashed

@benpicco benpicco merged commit 2cc3d38 into RIOT-OS:master Mar 8, 2020
@miri64 miri64 deleted the sliptty/enh/global-addr branch March 8, 2020 16:26
@leandrolanzieri leandrolanzieri added this to the Release 2020.04 milestone Mar 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: network Area: Networking Area: tools Area: Supplementary tools CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: skip compile test If set, CI server will run only non-compile jobs, but no compile jobs or their dependent jobs Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants