Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
network_protocol_programming_lab:2_2_access_general [2022/04/13 16:18] – created fangenoorthnetwork_protocol_programming_lab:2_2_access_general [2022/04/18 17:37] (current) – [Internet Connection sharing via USB] fangenoorth
Line 1: Line 1:
-This page is still being built!! 
- 
- 
 ====== Accessing the BeagleBone Black ====== ====== Accessing the BeagleBone Black ======
  
-As already mentioned the default username is **debian** and the default password is **temppwd**. You might want to change these with the ''passwd'' command executed as the //debian// user (not root).+The default username to log onto the BeagleBone Black is **debian** and the default password is **temppwd**. You might want to change these later with the ''passwd'' command executed as the //debian// user (not root).
  
 Now we need a way to access our freshly installed Debian OS. There are three possible ways to do so: Now we need a way to access our freshly installed Debian OS. There are three possible ways to do so:
Line 64: Line 61:
  
 ==== Internet Connection sharing via USB ==== ==== Internet Connection sharing via USB ====
 +
 +It is possible to share the internet connection (e.g. via ethernet or WiFi) with the BeagleBone Black. On Linux this works consistently and also with multiple BeagleBones connected at the same time. On Windows it works a little less consistent and so far we could only make it work with one BeagleBone at a time (you can SSH into both BeagleBones at the same time, but only one of them will be able to access the internet). This setup might be useful for you if you are unable to plug the BeagleBones into a router via ethernet. Note that the connection speed will be rather limited, usually around ''100 kbit/s''.
 +
 +A tutorial on how to set this up on a Windows host can be found [[https://ofitselfso.com/BeagleNotes/HowToConnectPocketBeagleToTheInternetViaUSB.php|here]].
 +
 +=== Connection sharing on a Linux host ===
 +
 +Run the following commands as ''root'' on your laptop/desktop. The name of the interfaces can be found out by executing the ''ip link'' command on your host PC, replace the placeholders in the commands with your actual interface names. Note that the last command needs to be run as often as many BeagleBones you wish to share your internet connection to (e.g. twice for two BeagleBones).
 +
 +<code bash>
 +sysctl net.ipv4.ip_forward=1
 +iptables --table nat --append POSTROUTING --out-interface <host interface to be shared> -j MASQUERADE
 +iptables --append FORWARD --in-interface <interface of BBB> -j ACCEPT  
 +</code>
 +
 +These commands enable forwarding of IP packets between the interfaces, where your host PC does NAT.
 +
 +Now we need to configure the forwarding on the BeagleBones. So enter the following as ''root'':
 +
 +<code bash>
 +ip route add default via 192.168.6.1
 +echo "nameserver 8.8.8.8" >> /etc/resolv.conf
 +</code>
 +
 +The first commands sets a default route, so that all outgoing IP packets get sent to the host PC. Note that you might have to change the third octet of the IP address if you have connected multiple BeagleBones via USB and changed their IP addresses earlier. The second command configures a DNS server to enable the BeagleBones to resolve domain names.
 +
 +Now the BeagleBone(s) should be connected to the internet. You can verify this by executing ''ping google.com'' or similar.
 +
 +Note that these settings are not persistent across reboots. You have to enter all commands, on your host as well as on the BeagleBones, again after a reboot.
 +
network_protocol_programming_lab/2_2_access_general.1649859495.txt.gz · Last modified: 2022/04/13 16:18 by fangenoorth
CC Attribution-Noncommercial-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0