Answers ( 1 )

  1. 2017-01-07 02:01

    I will assume that you have successfully installed the necessary drivers and the beaglebone shows up in your list of network interfaces. Once that is the case, make sure you have properly configured the IP address and netmask. For the default beaglebone connection this looks something like this: networking setup

    Once that is done, verify that you can connect to the beaglebone:

    mac$ ssh root@
    Debian GNU/Linux 7 Debian Image 2015-11-12
    default username:password is [debian:temppwd]
    Last login: Thu Nov 12 19:06:13 2015 from mac.local

    You are now ready to setup the nat, to allow the beaglebone to share your network connection. For that, first find the name of the network interface that's associated with your beaglebone:

    $ ifconfig | grep -C 3
        ether 04:a3:16:ad:6c:4d
        inet6 fe80::6a3:16ff:fead:6c4d%en9 prefixlen 64 scopeid 0x4
        inet netmask 0xfffffffc broadcast
        nd6 options=1<PERFORMNUD>
        media: autoselect
        status: active

    Then, activate ip forwarding and set the appropriate firewall rule:

    mac$ sudo sysctl net.inet.ip.forwarding=1
    net.inet.ip.forwarding: 0 -> 1
    mac$ echo "nat on en0 from en9:network to any -> (en0)" | sudo pfctl -f - -e
    pfctl: Use of -f option, could result in flushing of rules
    present in the main ruleset added by the system at startup.
    See /etc/pf.conf for further details.
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf enabled

    Naturally, you need to substitute en9 for the interface name you found in the previous step. Also, if you already have the firewall enabled, you'll want to manually add that to the firewall configuration.

    Lastly, we need to set up the default gateway:

    mac$ ssh root@
    beaglebone# route add default gw usb0
    beaglebone# ping
    PING ( 56(84) bytes of data.
    64 bytes from icmp_req=1 ttl=54 time=16.6 ms
    64 bytes from icmp_req=2 ttl=54 time=20.5 ms

    If everything worked, you should see the ping replies come in. If you can't connect to the beaglebone anymore, deactivate the firewall pfctl -d and verify that the rule was correct. If you can connect to the beaglebone, but the ping doesn't succeed, verify the routing table (route on the beaglebone, the nat table on the mac pfctl -s nat, and make sure that you ran the sysctl).

◀ Go back