Difference between revisions of "Beaglebone"

From Steak Wiki
Jump to navigationJump to search
(Created page with "==PocketBeagle== Connected via usb. Opens up cloud9 IDE, and gives you a web server connected arduino like interface to program the AM355x CPU. ===GNU\Linux Sharing internet...")
 
Line 3: Line 3:
  
 
===GNU\Linux Sharing internet with Pocketbeagle over USB===
 
===GNU\Linux Sharing internet with Pocketbeagle over USB===
Had some trouble with this today. This guide: https://elementztechblog.wordpress.com/2014/12/22/sharing-internet-using-network-over-usb-in-beaglebone-black/ does NOT work. These guides are also duds: https://unix.stackexchange.com/questions/520528/sharing-internet-using-network-over-usb-in-raspberry-zero-based-on-beaglebone
+
Had some trouble with this today. This guide: https://elementztechblog.wordpress.com/2014/12/22/sharing-internet-using-network-over-usb-in-beaglebone-black/ does NOT work. These guides are also no good: https://unix.stackexchange.com/questions/520528/sharing-internet-using-network-over-usb-in-raspberry-zero-based-on-beaglebone
  
 
You don't need to setup a bridge. It might work that way, but its not required. What works is the following:
 
You don't need to setup a bridge. It might work that way, but its not required. What works is the following:
Line 24: Line 24:
  
 
net.ipv4.ip_forward=1
 
net.ipv4.ip_forward=1
net.ipv6.conf.default.forwarding=1
 
net.ipv6.conf.all.forwarding=1
 
  
 
Afterwards it is advisable to double-check forwarding is enabled as required after a reboot.
 
Afterwards it is advisable to double-check forwarding is enabled as required after a reboot.
Line 31: Line 29:
 
With iptables
 
With iptables
  
# iptables -t nat -A POSTROUTING -o internet0 -j MASQUERADE
+
# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
 
# iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
 
# iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
# iptables -A FORWARD -i net0 -o internet0 -j ACCEPT
+
# iptables -A FORWARD -i usb0 -o eth0 -j ACCEPT
 
</pre>
 
</pre>
  

Revision as of 02:15, 11 March 2020

PocketBeagle

Connected via usb. Opens up cloud9 IDE, and gives you a web server connected arduino like interface to program the AM355x CPU.

GNU\Linux Sharing internet with Pocketbeagle over USB

Had some trouble with this today. This guide: https://elementztechblog.wordpress.com/2014/12/22/sharing-internet-using-network-over-usb-in-beaglebone-black/ does NOT work. These guides are also no good: https://unix.stackexchange.com/questions/520528/sharing-internet-using-network-over-usb-in-raspberry-zero-based-on-beaglebone

You don't need to setup a bridge. It might work that way, but its not required. What works is the following:

Enable packet forwarding

Check the current packet forwarding settings:

# sysctl -a | grep forward

You will note that options exist for controlling forwarding per default, per interface, as well as separate options for IPv4/IPv6 per interface.

Enter this command to temporarily enable packet forwarding at runtime:

# sysctl net.ipv4.ip_forward=1

Edit /etc/sysctl.d/30-ipforward.conf to make the previous change persistent after a reboot for all interfaces:

/etc/sysctl.d/30-ipforward.conf

net.ipv4.ip_forward=1

Afterwards it is advisable to double-check forwarding is enabled as required after a reboot.
Enable NAT
With iptables

# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
# iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
# iptables -A FORWARD -i usb0 -o eth0 -j ACCEPT

ref: https://wiki.archlinux.org/index.php/Internet_Sharing

At this point, you will have ip routing, but DNS isn't setup yet. To get DNS working put your preferred name server in /etc/resolv.conf

nameserver 192.168.1.1