The repository shows the different methods for internet sharing over the USB between the PC and Beagle Bone Board.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Gerardo Marx Chávez-Campos 8f0962a294 updating Readme 2 months ago
Readme.md updating Readme 2 months ago
connections.png Windows and GNU/Linux methods 1 year ago
ipok.png Windows and GNU/Linux methods 1 year ago
methodology.jpg Windows and GNU/Linux methods 1 year ago
nc.png Windows and GNU/Linux methods 1 year ago
properties.png Windows and GNU/Linux methods 1 year ago
share.png Windows and GNU/Linux methods 1 year ago
tcp.png Windows and GNU/Linux methods 1 year ago
wrong-ip.png Windows and GNU/Linux methods 1 year ago

Readme.md

Internet sharing

Internet sharing between a PC and the BeagleBone boards can be done on any OS. Thus, the next sections will indicate the different instructions for enabling internet sharing.

Windows PC

The following guide is based on 1. In the cmd application, run the next command to determine the connection IP between your PC and the BBB:

ping 192.168.7.2

Pinging 192.168.7.2 with 32 bytes of data:
Reply from 192.168.7.2: bytes=32 time=1ms TTL=64
Reply from 192.168.7.2: bytes=32 time=2ms TTL=64
Reply from 192.168.7.2: bytes=32 time=1ms TTL=64
Reply from 192.168.7.2: bytes=32 time=2ms TTL=64

Ping statistics for 192.168.7.2:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 1ms, Maximum = 2ms, Average = 1ms
	

if you get 0% loss, then the BBB has a network connection between PC and BBB:

BBB        <---->    Windows PC

192.168.7.2 192.168.7.1

Next, open the network connection application to identify the internet connection adapter and the BBB-USB connection:

Network Connection

In my case, the Ethernet connection is the one with the Internet, while the Ethernet 4 is the BeagleBone; notice that the BB indicates a Remote NDIS Compatibel Device.

Networks

Then, the network with an internet connection must be shared with the BBB. Therefore, make right-click on the Ethernet connection with the internet and select options:

options

then click on the Sharing tab and enable the Internet Connection Sharing as shown below. Now, you have to select one network connection to share the internet; remember that, in my case, it is Ethernet 4 (Remote NDIS Compatible Device).

share option

After that, we should open the Remote NDIS Compatibel Device network connection properties by right-clicking on its icon:

then select the Internet Protocol Version 4(TCP/IPv4) and click on the properties button; at this point, you will probably lose the connection between the BBB and Windows. Also, the OS will make some undesirable changes in the assigned IP to the PC; it is wrong (it must be 192.168.7.1)

next, we have to solve this error assignment by clicking on the Obtain an IP address automatically option or writing the correct IP by yourself

Finally, we have to indicate to the BBB the IP used for any outside requests using the next commands in the BBB's Shell:

sudo /sbin/route add default gw 192.168.7.1

and then check with ping 8.8.8.8 command.

sudo sh -c 'echo "nameserver 8.8.8.8" >> /etc/resolv.conf'

GNU/Linux

In the PocketBeagle, console type the following

ifconfig usb0 192.168.7.2
route add default gw 192.168.7.1

In the linux console of host system type

$ sudo su
#wlan0 is my internet facing interface, eth5 is the PocketBeagle USB connection
$ ifconfig eth5 192.168.7.1
$ iptables --table nat --append POSTROUTING --out-interface wlan0 -j MASQUERADE
$ iptables --append FORWARD --in-interface eth5 -j ACCEPT
$ echo 1 > /proc/sys/net/ipv4/ip_forward

Incase network not accessible then type the following in BBB terminal

sudo su
echo "nameserver 8.8.8.8" >> /etc/resolv.conf

References