Introduction
The BBB is configured by default to use the dynamic host configuration protocol (DHCP) for the allocation of its wired and wireless IP address. Network routers typically run a DHCP server that allocates a pool of addresses to devices attached to the network. While DHCP works well for most devices on a local network, it can cause difficulties if you wish to make the BBB visible outside a home firewall via port forwarding. This is because DHCP devices may receive a different IP address each time they boot (depending on the router’s lease time).
The following description details the steps required to set your IP address to be static under Debian and Angstrom.
Static IP Address under Debian
[Updated April 2015] To set the IP address to be static under Debian is quite straightforward. You can simply alter the /etc/network/interfaces configuration file to manually specify the address (e.g., 192.168.1.80 in this case), the network mask, and the network gateway. Use an editor, such as nano, to edit the /etc/network/interfaces file and For example, the settings for my network, which has a common configuration, are as follows:
molloyd@beaglebone:~$ uname -a
Linux beaglebone 3.8.13-bone70 #1 SMP Fri Jan 23 02:15:42 UTC 2015 armv7l GNU/Linux
molloyd@beaglebone:~$ cd /etc/network
molloyd@beaglebone:/etc/network$ sudo nano interfaces
[sudo] password for molloyd:
And, edit the interfaces file as follows:
molloyd@beaglebone:/etc/network$ more interfaces
…
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.80
netmask 255.255.255.0
gateway 192.168.1.1
…
# Ethernet/RNDIS gadget (g_ether)
iface usb0 inet static
address 192.168.7.2
netmask 255.255.255.0
network 192.168.7.0
gateway 192.168.7.1
…
The BBB then has a static IP address after reboot. The same procedure applies to other adapter entries, such as the wlan0 wireless Ethernet adapter. Do not pick an address that is within the DHCP pool or assigned to another device, or it will result in IP conflicts on the network. After you reboot the BeagleBone and connect via USB-over-Internet (or directly to the new static IP address) you can view your configuration as follows:
molloyd@beaglebone:~$ ifconfig
eth0 Link encap:Ethernet HWaddr d0:5f:b8:fe:39:93
inet addr:192.168.1.80 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::d25f:b8ff:fefe:3993/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:672 errors:0 dropped:0 overruns:0 frame:0
TX packets:130 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:107438 (104.9 KiB) TX bytes:15588 (15.2 KiB)
Interrupt:40
…
Static IP Address Under Angstrom
The current configuration in this part is Angstrom on Beaglebone Black with:
$ uname -a:
Linux beaglebone 3.8.11 #1 SMP Wed May 8 07:34:27 CEST 2013 armv7l GNU/Linux
On my network I have configured the router so that it gives out DHCP addresses in the range 100-255, so below 100 is available to be fixed. So, just be careful that you choose a static address that does not clash with an existing device on your network.
My current setup is available through ifconfig as:
root@beaglebone:/etc/network# ifconfig
eth0 Link encap:Ethernet HWaddr C8:A0:30:AB:32:3A
inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::caa0:30ff:feab:323a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1855 errors:0 dropped:0 overruns:0 frame:0
TX packets:424 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:232957 (227.4 KiB) TX bytes:55698 (54.3 KiB)
Interrupt:56
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:234 errors:0 dropped:0 overruns:0 frame:0
TX packets:234 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:19082 (18.6 KiB) TX bytes:19082 (18.6 KiB)
usb0 Link encap:Ethernet HWaddr A2:CB:A9:A8:0B:F4
inet addr:192.168.7.2 Bcast:192.168.7.3 Mask:255.255.255.252
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
loopback is the way for a device to refer to itself using localhost or the ip address 127.0.0.1. The adapter usb0 describes the network adapter that is referred to in the “Getting started with the Beaglebone” guide where you can connect to your Beaglebone via USB with the fixed address: 192.168.7.2.
Using Connman
We want to change eth0 to use a static address. The Angstrom distribution on the Beaglebone Black uses connman which claims that it:
provides a daemon for managing internet connections within embedded devices running the Linux operating system. The Connection Manager is designed to be slim and to use as few resources as possible, so it can be easily integrated. It is a fully modular system that can be extended, through plug-ins, to support all kinds of wired or wireless technologies. Also, configuration methods, like DHCP and domain name resolving, are implemented using plug-ins. The plug-in approach allows for easy adaption and modification for various use cases.
Go to the directory: /var/lib/connman and you can see that there is a directory ethernet***. You can see that the settings appear in the file settings. In my case the ethernet is: ethernet_c8a030ab323a_cable
root@beaglebone:/var/lib/connman# ls -al
total 16
drwxr-xr-x 3 root root 4096 Jan 1 2000 .
drwxr-xr-x 18 root root 4096 Jan 1 2000 ..
drwx------ 2 root root 4096 Jan 1 2000 ethernet_c8a030ab323a_cable
-rw------- 1 root root 68 Jan 1 2000 settings
root@beaglebone:/var/lib/connman# cd ethernet_c8a030ab323a_cable/
root@beaglebone:/var/lib/connman/ethernet_c8a030ab323a_cable# ls
data settings settings.ODU2WW
root@beaglebone:/var/lib/connman/ethernet_c8a030ab323a_cable# more settings
[ethernet_c8a030ab323a_cable]
Name=Wired
AutoConnect=true
Modified=2000-01-01T01:18:21.869401Z
IPv4.method=dhcp
IPv4.DHCP.LastAddress=192.168.1.100
IPv6.method=auto
IPv6.privacy=disabled
To change the values you should not modify these files – instead, go to the directory: /usr/lib/connman/test and you can see a list of scripts that allow you to make changes to your network configuration. The full list of connman scripts is:
root@beaglebone:/usr/lib/connman/test# ls -al
total 140
drwxr-xr-x 2 root root 4096 Mar 18 12:46 .
drwxr-xr-x 3 root root 4096 Mar 18 12:46 ..
-rwxr-xr-x 1 root root 1118 May 6 15:13 backtrace
-rwxr-xr-x 1 root root 2144 May 6 15:13 connect-vpn
-rwxr-xr-x 1 root root 889 May 6 15:13 disable-tethering
-rwxr-xr-x 1 root root 348 May 6 15:13 disconnect-vpn
-rwxr-xr-x 1 root root 1334 May 6 15:13 enable-tethering
-rwxr-xr-x 1 root root 233 May 6 15:13 get-global-timeservers
-rwxr-xr-x 1 root root 621 May 6 15:13 get-proxy-autoconfig
-rwxr-xr-x 1 root root 1277 May 6 15:13 get-services
-rwxr-xr-x 1 root root 229 May 6 15:13 get-state
-rwxr-xr-x 1 root root 1512 May 6 15:13 list-services
-rwxr-xr-x 1 root root 2120 May 6 15:13 monitor-connman
-rwxr-xr-x 1 root root 2799 May 6 15:13 monitor-services
-rwxr-xr-x 1 root root 571 May 6 15:13 service-move-before
-rwxr-xr-x 1 root root 485 May 6 15:13 set-domains
-rwxr-xr-x 1 root root 386 May 6 15:13 set-global-timeservers
-rwxr-xr-x 1 root root 982 May 6 15:13 set-ipv4-method
-rwxr-xr-x 1 root root 1115 May 6 15:13 set-ipv6-method
-rwxr-xr-x 1 root root 496 May 6 15:13 set-nameservers
-rwxr-xr-x 1 root root 1274 May 6 15:13 set-proxy
-rwxr-xr-x 1 root root 491 May 6 15:13 show-introspection
-rwxr-xr-x 1 root root 5796 May 6 15:13 simple-agent
-rwxr-xr-x 1 root root 390 May 6 15:13 test-clock
-rwxr-xr-x 1 root root 351 May 6 15:13 test-compat
-rwxr-xr-x 1 root root 4702 May 6 15:13 test-connman
-rwxr-xr-x 1 root root 1610 May 6 15:13 test-counter
-rwxr-xr-x 1 root root 2079 May 6 15:13 test-manager
-rwxr-xr-x 1 root root 285 May 6 15:13 test-new-supplicant
-rwxr-xr-x 1 root root 8951 May 6 15:13 test-session
-rwxr-xr-x 1 root root 1333 May 6 15:13 test-supplicant
Here we can use the get-services script to give you a list of the current services:
root@beaglebone:/usr/lib/connman/test# ./get-services
[ /net/connman/service/ethernet_c8a030ab323a_cable ]
IPv6.Configuration = { Method=auto Privacy=disabled }
AutoConnect = true
Name = Wired
Nameservers = [ 192.168.1.1 ]
Provider = { }
Favorite = true
Domains.Configuration = [ ]
Timeservers.Configuration = dbus.Array([], signature=dbus.Signature('s'), variant_level=1)
State = online
Proxy = { Method=direct }
Nameservers.Configuration = [ ]
IPv4 = { Netmask=255.255.255.0 Gateway=192.168.1.1 Method=dhcp Address=192.168.1.100 }
Timeservers = dbus.Array([dbus.String(u'192.168.1.1')], signature=dbus.Signature('s'), variant_level=1)
IPv6 = { }
Domains = [ home.gateway ]
Ethernet = { Interface=eth0 MTU=1500 Method=auto Address=C8:A0:30:AB:32:3A }
Security = [ ]
Proxy.Configuration = { }
Type = ethernet
Immutable = false
IPv4.Configuration = { Method=dhcp }
Importantly, you can see the name of your ethernet service at the top. In my case it is: ethernet_c8a030ab323a_cable. You will need this below for the following two steps.
Step 1 – Setting the Nameservers
The first thing we need to do is set the nameserver(s) manually, as once you go through step 2, removing dhcp support, this setting will likely be lost. If you wish to use the nameserver that you currently have as above (192.168.1.1 in my case), simply call the script set-nameservers (note: 8.8.8.8 is the Google Public DNS – always a useful backup DNS if your local DNS fails):
root@beaglebone:/usr/lib/connman/test# ./set-nameservers
Usage: ./set-nameservers
root@beaglebone:/usr/lib/connman/test# ./set-nameservers ethernet_c8a030ab323a_cable 192.168.1.1 8.8.8.8
Setting nameserver to ['192.168.1.1', '8.8.8.8']
root@beaglebone:/usr/lib/connman/test#
Step 2- Changing the Network Settings
We want to change our adapter settings to use a static IP address, so using the set-ipv4-method script you can see the usage as:
root@beaglebone:/usr/lib/connman/test# ./set-ipv4-method
Usage: ./set-ipv4-method <service> [off|dhcp|manual <address> [netmask] [gateway]]
So, for my network I want to use the ip address 192.168.1.80 with a netmask of 255.255.255.0 and a gateway of 192.168.1.1, so my call will be:
./set-ipv4-method ethernet_c8a030ab323a_cable manual 192.168.1.80 255.255.255.0 192.168.1.1
The output will be:
root@beaglebone:/usr/lib/connman/test# ./set-ipv4-method ethernet_c8a030ab323a_cable manual 192.168.1.80
255.255.255.0 192.168.1.1
Setting method manual for ethernet_c8a030ab323a_cable
And the ssh client connection should likely freeze as the IP address of your Beaglebone should have changed. To kill your shh client session type ~. (i.e. tilda followed by a full stop) in your frozen shell window and this should terminate the ssh client session. Give the Beaglebone a few seconds to reboot and then from your desktop client you should be able to:
molloyd@molloyd-VirtualBox:~/Desktop$ ssh 192.168.1.80 -l root
The authenticity of host '192.168.1.80 (192.168.1.80)' can't be established.
RSA key fingerprint is b6:b0:e7:16:87:86:9e:e9:cc:23:a7:c5:99:03:9c:58.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.80' (RSA) to the list of known hosts.
root@192.168.1.80's password:
root@beaglebone:~#
Test that your nameservers setting is working correctly:
root@beaglebone:/usr/lib/connman/test# ping derekmolloy.ie
PING derekmolloy.ie (79.140.142.22) 56(84) bytes of data.
64 bytes from lb1.reg365.net (79.140.142.22): icmp_req=1 ttl=56 time=18.3 ms
64 bytes from lb1.reg365.net (79.140.142.22): icmp_req=2 ttl=56 time=18.0 ms
etc.
And you are done.
Dear Sir,
I am a beginner in linux. I am using PUTTY for ssh connection to my BBB. Should I have a static IP .? What is the use of having static IP. I would kindly request you to help me knowing about static ip theory. Thank you sir.
On my network the DHCP changes the address all the time even though I have a long lease time. The problem with that is that every time I go to connect to my Beaglebone it has changed its address and I have to rescan my network to find it. So, for one it’s annoying. The only time it becomes important is if you with to create a virtual server – so, say you wanted to make your Beaglebone available as a webserver for your house. You would use the virtual servers mapping in your router to make this available outside of your internal network. In this case you would have to have a static IP address so the the virtual server mapping would work correctly.
Derek,
Your DHCP server can be configured to always assign the same IP to your BeagleBone. This works based on the BeagleBone’s MAC address. Consult the configuration of your DHCP server to set this up.
Parakshit,
On a small network, such as your house, a statically assign IP address means you are not dependant on some other device (whatever is acting as your DHCP server such as a home router) in order to get your IP address. Imagine if you lose power and this causes your DHCP server to get fried, meanwhile your BBB comes back online but there is no one to tell it an IP! Or, even if the DHCP server isn’t fried, the BBB may boot faster than the DHCP server and it won’t be there. At the very least DHCP is extra network traffic that isn’t necessary, and your BBB will boot faster when its IP is statically assigned.
I tried to change to a static IP on the BBB and it drove me crazy: I typed ./get-services and nothing happened, then ./set-ip4v-method and several error messages on the screen.
There is a trivial reason. Because what you forget to mention: There must be a connected cable plugged in for your method to work! No cable, no change of IP address, no fun.
Thanks Fritz, connecting the cable made Derek’s guidelines work.
Ronny
Hi, i’m very interested in beagle, i want to make my beagle have 2 IP: IP static as default IP, and another IP from DHCP server. so if it can’t get IP from server, it still have default IP.
BWT is beaglebone/angstrom support vlan 802.1q ..?
Camilo,Sorry, I didn’t have this problem, so I don’t have a good idea of what would cause it.You can get the stauts of the Cloud9 service with this command:# systemctl stauts cloud9.serviceIf cloud9 failed to start, this will give the error message. If cloud9 isn’t running, you can try starting it manually:# systemctl start cloud9.serviceIf you haven’t installed the latest packages yet, or updated to the latest kernel (3.2.11+ now), you should give that a try. I had a problem with a different node.js service, bone101, which was fixed after an opkg update in February, but I still don’t know what caused the problem.You should try asking in the Beagleboard Google Group, if you haven’t already. There is a good chance that someone else has had this problem and could recommend ways to fix it.Dan.
Thanks for posting this. Do these instructions apply to setting a wireless IP address to static as well? I want to run my BBB “headless” so I need to know the IP address without too much fuss.
Do you know if it possible to change the fixed address used to connect to the beaglebone via the usb-to-ethernet adapter which is listed as “usb0”?
I would like to be able ssh into multiple beaglebones by connecting them with usb to my desktop.
I appreciate any help you can give me!
@ Fritz: right you are, glad you posted this and I read it just before they had to take me off.
i got this error once i tried to use set-ipv4-methodTraceback (most recent call last): File ./set-ipv4-method , line 19, in pierortpes = service.GetProperties() File /usr/lib/python2.7/site-packages/dbus/proxies.py , line 68, in __call__ return self._proxy_method(*args, **keywords) File /usr/lib/python2.7/site-packages/dbus/proxies.py , line 143, in __call__ **keywords) File /usr/lib/python2.7/site-packages/dbus/connection.py , line 630, in call_blocking message, timeout)dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method GetProperties with signature on interface net.connman.Service doesn’t existand yes, i changed the service ID and the ip as needed but i got this error, i get the same error even if i tried a wrong service ID, so it seems that it doesn’t execute a thing at all
Hi,Connman is started by seytsmctl, so it can be stopped with seytsmctl stop connman.service and prevented from starting at bootup with seytsmctl disable connman.service . There is also a connman script in /etc/init.d it appears that this script has no effect, but if connman is still running when you reboot then you should delete /etc/init.d/connman too.Dan.
Followed the instructions meticulously, but when trying to SSH I get “server unexpectedly closed network connection”. Checked the settings once again, all correct. Tried to connect via the browser to the fixed IP-address of the BBB, this works! What could possibly be going wrong?
It works – thank you so much!
you are genius – i have been looking for this for so long time…
cat uart1_txdname: uart1_txd.uart1_txd (0x44e10984/0 984 = 0 0000), b NA, t NAmode: OMAP_PIN_OUTPUT | OMAP_MUX_MODE0signals: uart1_txd | mmc2_sdwp | NA | i2c1_scl | NA | pr1_uart0_txd_mux1 | NA | gpio0_15root@omap:/sys/kernel/debug/omap_mux# cat uart1_rxdname: uart1_rxd.uart1_rxd (0x44e10980/0 980 = 0 0030), b NA, t NAmode: OMAP_PIN_OUTPUT | OMAP_MUX_MODE0signals: uart1_rxd | mmc1_sdwp | NA | i2c1_sda | NA | pr1_uart0_rxd_mux1 | NA | gpio0_14root@omap:/sys/kernel/debug/omap_mux# cat uart1_rtsnname: uart1_rtsn.uart1_rtsn (0x44e1097c/0x97c = 0 0030), b NA, t NAmode: OMAP_PIN_OUTPUT | OMAP_MUX_MODE0signals: uart1_rtsn | NA | d_can0_rx | i2c2_scl | spi1_cs1 | NA | NA | gpio0_13root@omap:/sys/kernel/debug/omap_mux# cat uart1_ctsnname: uart1_ctsn.uart1_ctsn (0x44e10978/0 978 = 0 0000), b NA, t NAmode: OMAP_PIN_OUTPUT | OMAP_MUX_MODE0signals: uart1_ctsn | NA | d_can0_tx | i2c2_sda | spi1_cs0 | NA | NA | gpio0_12For UART2:root@omap:/sys/kernel/debug/omap_mux# cat spi0_d0name: spi0_d0.uart2_txd (0x44e10954/0 954 = 0 0001), b NA, t NAmode: OMAP_PIN_OUTPUT | OMAP_MUX_MODE1signals: spi0_d0 | uart2_txd | i2c2_scl | NA | NA | NA | NA | gpio0_3root@omap:/sys/kernel/debug/omap_mux# cat spi0_sclkname: spi0_sclk.uart2_rxd (0x44e10950/0 950 = 0 0031), b NA, t NAmode: OMAP_PIN_OUTPUT | OMAP_MUX_MODE1signals: spi0_sclk | uart2_rxd | i2c2_sda | NA | NA | NA | NA | gpio0_2root@omap:/sys/kernel/debug/omap_mux# cat lcd_data9name: lcd_data9.uart2_rtsn (0x44e108c4/0x8c4 = 0x002e), b NA, t NAmode: OMAP_PIN_OUTPUT | OMAP_MUX_MODE6signals: lcd_data9 | gpmc_a13 | NA | mcasp0_fsx | NA | NA | uart2_rtsn | gpio2_15root@omap:/sys/kernel/debug/omap_mux# cat lcd_data8name: lcd_data8.uart2_ctsn (0x44e108c0/0x8c0 = 0 0006), b NA, t NAmode: OMAP_PIN_OUTPUT | OMAP_MUX_MODE6signals: lcd_data8 | gpmc_a12 | NA | mcasp0_aclkx | NA | NA | uart2_ctsn | gpio2_14We aren’t seeing aithynng in the RTS pin of any of the 2 ports. (But the communication works).Thank you very much, we look forward for any help on this issue. We’ve posted this on the BeagleBone google group but it’s still pending moderation.
I am still having trouble setting my wireless to be static. I have followed the directions and steps 1 and 2 proceed normally with no errors and with every indication that the process has worked. When I reboot BBB (running Angstrom that came with it) it reverts back to DHCP. I know this becacuse IFCONFIG reports the old DHCP address previously assigned. When I check the settings file in the directory with the service name I see that it says settings are DHCP. In short, the settings dont seem to stick!
Any help or suggestions would be greatly appreciated.
@William Miller: I managed to get a static ip with wifi by adding a service that starts on boot, and calls a bash script who does all the connection steps. Replace strings where necessary.
nano /lib/systemd/system/wifiboot.service
[Unit]
Description=Wifi Static IP
[Service]
WorkingDirectory=/home/root
ExecStart=/wifiboot.sh
[Install]
WantedBy=multi-user.target
nano /home/root/wifiboot.sh
chmod -R 777 /home/root/wifiboot.sh
#!/bin/sh –
systemctl restart connman.service
sleep 10
/usr/lib/connman/test/set-nameservers wifi_0013efd01052_54502d4c494e4b5f463736393432_managed_psk 192.168.1.1 8.8.8.8
sleep 5
/usr/lib/connman/test/set-ipv4-method wifi_0013efd01052_54502d4c494e4b5f463736393432_managed_psk manual 192.168.1.86 255.255.255.0 192.168.1.1
#enable service
systemctl enable wifiboot.service
systemctl start wifiboot.service
#disable service
systemctl disable wifiboot.service
#test connman connection
/usr/lib/connman/test/test-connman connect wifi_0013efd01052_54502d4c494e4b5f463736393432_managed_psk
/usr/lib/connman/test/test-connman disconnect wifi_0013efd01052_54502d4c494e4b5f463736393432_managed_psk
Thanks for posting this. I will try it sometime early next week.
Hi,Are you sure that the connman daeomn is installed and running? If you are using the Angstrom demo image, then Connman almost certainly is running (unless it crashed), but if you are using Ubuntu or you built a custom Angstrom image (e.g. using narcissus) then perhaps it isn’t.You can check if connman is running with# ps aux | grep connmand It should indicate that /usr/sbin/connmand is running.If it isn’t, then the good news is that you can set your IP address the normal way, by editing /etc/network/interfaces. If you can’t get connman configuration to work, then you might want to uninstall or disable the connman daeomn you can then set your address using /etc/network interfaces. I know that some Beaglebone users have done this rather than mess around with connman you can check the Beagleboard Google Group for instructions. As far as I know, connman isn’t required in order to use any features of the Beaglebone or Beagleboard it’s just a different way of configuring those services.Dan.
Thanks for the tutorial! Do you have any hints how Connman can be accessed programmatically from C++? Thanks in advance.
I used this information to gtrneaee a script to set static IP address on my BeagleBone#! /bin/sh# manualIPADD= 192.168.13.205 NETMASK= 255.255.255.0 GATEWY= 192.168.13.254 NAMESRV= 192.168.13.254 CABLE=
/usr/lib/connman/test/get-services | grep /net | awk { split( $2 , a , / )} { print a[5] }'
echo /usr/lib/connman/test/set-ipv4-method $CABLE manual $IPADD $NETMASK $GATEWYecho /usr/lib/connman/test/set-nameservers $CABLE $NAMESRVecho echo ETH Cable : $CABLEecho IP Address : $IPADDecho Net Mask : $NETMASKecho Gate way : $GATEWYecho Name Server : $NAMESRVecho /usr/lib/connman/test/get-servicesIt seems to work except that the name server is in set in /etc/resolv.conf. when I look at the contents it only has the loop back IP set. Is this a bug in connman?Hi,
I have recently got hold of a beaglebone black which I talk to using SSH. I went through the update and upgrade but on the first occasion the repository was not reachable for some (but not all) of the files. Wget returned an error. I looked on the web and found some comments about the repository not being available but a quick check with a browser on another PC showed that there was no apparent problem. I thought it might be something to do with resolving the domain name and indeed the contents of /etc/resolv.conf had one nemeserver in it and it was the loop back address. I changed this to my own DNS server address after setting up a static IP address in the DHCP server (I run my own DHCP and DNS servers) and the upgrade went fairly smoothly although it took a very long time.
I have subsequently powered down and re-booted and connman reports the DNS address correctly so the DHCP is working (and I get my correct IP address and so on). However, resolv.conf has reverted to 127.0.0.1.
I did have some really difficult issues with the RPi around getting the thing to reliably retain the DNS server address and this was eventually resolved by using DHCP and setting a fixed address in the DHCP tables so my device always has the same address when I am at home and picks up another address if I go elsewhere – this is after all why it was designed this way. Can you explain what is going on with RESOLV.CONF?
sir,
i had done every step explained in your blog..i checked whether the ip has changed by loging in through usb and tried ifconfig
the ip has changed.
but while login throufh my static ip it says connection time out…what can i do??
Dear sir,
I am new to this BBB. According to your tutorials, I can connect my PC (Win 8 Pro) with BBB (with default Angstrom distribution) through SSH (PuTTY) at address 192.168.7.2. GPIOs, I2C and other things are working fine but I am having some issue with the internet connection to my BBB, like when I type “opkg update” on the command line it replies “wget: bad address “feeds.angstrom-distribution.org”” and it fails to download. My PC is connected to the internet by a WiMax USB dongle and the BBB is connected to the PC via straight-through Ethernet cable. So, for my case is it possible to tether the internet connection of my PC to the BBB via the Ethernet cable? If it is yes, then how? Or how can I get access to the internet in my BBB. Pls guide me.
Nice post Derek. Should note that if /var/lib/connman/test directory doesn’t exist run the following package update:
opkg install connman-tests
This may be a change in the distro from when you posted this tutorial, to the current version I’m using:
Linux beaglebone 3.8.13 #1 SMP Wed Jun 5 11:21:00 CEST 2013 armv7l GNU/Linux
Package Output:
sh-4.2# opkg install connman-tests
Upgrading connman-tests on root from 1.4-r18.0.13 to 1.4-r18.0.15…
Downloading http://feeds.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/base/connman-tests_1.4-r18.0.15_armv7a-vfp-neon.ipk.
Configuring connman-tests.
Nice post Derek.
After applying all the changes I couldn’t ping any website, eg. ping http://www.google.com.
Searching the internet I found also resolv.conf should be changed setting the nameserver from 127.0.0.1 to the used nameserver:
cd /etc
resolv.conf
# Generated by Connection Manager
nameserver 192.168.0.1
This solved the problem.
Hi Derek,
I still cannot ping any web site.
I was able to change my ip: (192.168.1.90), then my ssh terminal frooze and logged me out. Now I cannot shh to my beaglebone using 192.168.7.2, but when changed my host computer local connection to 192.168.1.70 it connect just fine (to 192.168.1.90)
I also tried:
# Generated by Connection Manager
nameserver 192.168.1.1
but the nameserver changes back to 127.0.0.1 every time i boot up.
Note:In the end I just wanted to use :
git clone git://github.com/derekmolloy/boneDeviceTree
Any ideas?
Hello Professor,
I have USB based 3G internet connection. I want to connect LAN port of laptop to BBB’s RJ45. Now, I want to share internet connection between BBB and USB dongle through LAPTOP.
I have angstrom distribution on BBB & Vista on laptop. Please suggest further.
I tried to use ICS to share connection between USB dongle & LAN port of laptop. ICS assigns static IP to LAN port. Now I can not connect to BBB.
I have posted this query on below link but still not got reply
https://groups.google.com/forum/#!searchin/beagleboard/vinayak$20aghor/beagleboard/0k55SPkCWdk/QKdbRf_a6fQJ
Please help
Vinayak
Hi Derek,
I got to the part where the network settings are changed and a manual ipaddress is set, it said it did this but my shell did not freeze nor can I log in to a ssh on this new ip address. Any help would be much appreciated.
Is your issue resolved.I am facing the same problem.
I was getting the error “DBus.Error.UnknownMethod: Method GetProperties with signature on interface net.connman.Service doesn’t exist” that was mentioned above.
After some research, I figured out an easier way to set the network settings…
Edit /var/lib/connman/default.profile
[ethernet_XXXXXXX_cable]
IPv4.method=manual
IPv4.local_address=192.168.1.20
IPv4.gateway=192.168.1.1
IPv4.netmask_prefixlen=24
Nameservers=192.168.1.1;
**note – [ethernet_XXXXXXX_cable] represents the name of your ethernet service
systemctl restart connman.service
Thanks Gene,
Derek
sir,
it was very help full to get the knowledge about the beaglebone black, excellent work!!
sir,m trying to do a small project about the edge detection in the openCV,capturing video through the beaglebone black,all m doing s referring to your streaming video,…but i m getting struck in middle,its comming like u missing codec missing,when m trying to convert ma output.raw file to output.mp4,i tried with some other formats also like avi,mpej,png,..i dint get the output!! please help me out in this sir,it will be wise for me
thank you
abhishek
A caveat on setting a static ip in /var/lib/connman/default.profile…
Connman sets the nameserver in /etc/resolv.conf to 127.0.0.1 when starting up causing DNS lookups to fail.
I tried using the connman set-nameservers but its failed with the same error (DBus.Error.UnknownMethod). So as a workaround here is what worked for me…YMMV.
1. Create a script call connman_resolv in /usr/bin/
#!/bin/bash
NAMESERVER=
cat /var/lib/connman/default.profile | grep -i nameservers= | sed 's/nameservers=//I'
if [ -n “$NAMESERVER” ] ; then
echo “” > /etc/resolv.conf
OLDIFS=$IFS
IFS=”;”
for i in $NAMESERVER ; do
echo “Adding server: $i”
echo “nameserver $i” >> /etc/resolv.conf
done
IFS=$OLDIFS
fi
2. chmod 755 connman_resolv
3. Add “ExecStartPost=/usr/bin/connman_resolv” to “[Service]” section of /lib/systemd/system/connman.service
4. systemctl –system daemon-reload
5. systemctl restart connman.service
DNS lookups should hopefully work now.
hello, when I connect to my network, the name beaglebone change to dhcppc29 , always in the promtp appear dhcppc29 , how i change it?
best regards
sorry for my english.
I have a zyxel router. In the admin there are options to set ip addresses for devices as static. Can I do this for the beaglebone and not do it on the beaglebone per your tutorial?
If you have access to the router in which you are configuring the static IP I’ve found it way easier to setup a DHCP reservation for your BeagleBones Hardware/MAC address.
execute ifconfig -> get HWaddr from eth0 section
Find out how to set a DHCP reservation on your specific router, only info you need to provide is:
– Description (e.g. BeagleBone Black)
– HWaddr (aka MAC address)
– Desired Local IP (e.g. 10.0.1.2)
Sláinte
(P.S. Dr. Molloy, your tutorials with BB have been very helpful for my senior design project. I’ll have to buy you a beer next time I visit Dublin.)
I want to set gateway and nameserver to 192.168.7.1 on usb0 interface. setting them through “route” and “resolv.conf” is temporary. How can I do this through connman. “/var/lib/connman” has only “settings” file.
Hi,
how I can connect my to Internet beaglebone whit NO-IP.
Using OS for default of beaglebone.
Dr. Molloy,
Your tutorials for both the BBB and RPi have been great help to me learning these platforms, and learning embedded Linix. I’ve learned a lot and enjoy watching your video in addition to reading your many written ones here.
On issue that has me pulling my hair out (and there’s not much left to pull at my age), though, is trying to get the Beaglebone Black running Debian (7.5-2014-05-14 image) to accept a DNS nameserver setting.Debian doesn’t have connman like Angstrom, but your advice in this tutorial has helped me to at least get connected to the Internet over the USB connection with my PC (running Win 7 with ICS enabled).
Through PuTTY I can ping 192.168.7.1 just fine, as well as 8.8.8.8, so I am connected to the outside world. I cannot, however, ping http://www.google.com or anything else requiring a DNS lookup.
Through advice here and elsewhere on the web I’ve tried adding “nameserver 8.8.8.8” to /etc/resolv.conf, and dns-nameservers 8.8.8.8 to the usb0 clause in /etc/network/interfaces. It appears from what I read across the web that these work in Angstrom, so my issue must be with the way registering the nameservers is being handled in Debian. I am also able to connect a Raspberry Pi this way, and have no problem resolving the IP addresses through the DNS server. Any advice that you or any of the participants here might have to help me solve this issue will be greatly appreciated!
Thanks Mitch,
Modifying /etc/network/interfaces and adding the line:
dns-nameservers 8.8.8.8
on its own in the Debian image should work fine. I’ll have to try that again in work as maybe something has changed with the latest image.
Derek.
Derek,
Thanks so much for the quick reply. One question: By “on its own” do you mean on a non-indented line by itself in /etc/network/interfaces? I had it in the indented clause following the inet usb0…
Incidentally, I was able to get the DNS service working, at least temporarily, by manually adding “nameserver 192.168.7.1” to the /etc/resolv.conf file (in addition to “nameserver 8.8.8.8” in the same file). This proved temporary, though, since as soon as I plugged the same BBB board into a wired Ethernet connection served by my home router with DHCP, the /etc/resolv.conf file was changed back to:
domain gateway.2wire.net
search gateway.2wire.net
nameserver 192.168.1.254
which are the defaults for that connection (and work fine under the wired Ethernet condition).
Apparently the /etc/resolv.conf file is automagically rewritten when I reboot under different network environments – I have more to learn 🙂
Any insight you have time to share, though, will again certainly be appreciated.
In the mean time, though, I am up and running – just curious to learn more!
Thanks again,
Mitch
Hi,
I am embedding the BBB into a baseboard(my circuit).The USB connections are pulled to the board and its working fine.
The Ethernet jack in the BBB is LPJ0011BBNL.I have replaced it with a Pulse’s J0011D01BNL.The pin configuration are reversed.i.e the Tx and Rx pins are reversed.I have taken care to connect the proper signal to the exact pin of the connector. I power up the board with a 5V 4 Amp voltage.I have failed to get my ethernet working for both Android and Linux Angstorm booted by the SD card.
PS: I have another new BBB where for both Android and Linux Angstorm the ethernet(LPJ0011BBNL) is working fine.
Can you offer me some help and light into my problem?
Thanks and Regards
Polash
Hi Polash, I don’t see why not. That might be a good question for Gerald Coley, the architect of the BBB. Derek.
Dr. Molloy,
I’m trying to establish an ad hoc network connection between my BeagleBone Black (running the latest Debian distribution) and a MacBook and a Windows 7 computer. The application is a mobile robot in which I can not SSH to the BBB on the robot using a USB serial connection since I will be running Python code to enable the robot to navigate autonomously. I’ve successfully set up the WiFi on the BBB.
I wish to use a WiFi ad hoc (or peer-to-peer) network to avoid having to connect to the robot through a router. I just want to connect wirelessly, via a SSH Terminal session, to the BBB on the robot to modify and run Python programs.
Do you know of a good tutorial to do this? I see that a similar question was asked further up but I’m not sure it was answered by anyone. Any help is greatly appreciated! Like the commenters before me, your lessons and videos have been truly invaluable to someone coming from an Arduino.
Thanks!
I’ve been unable to successfully complete the apt-get connman install running Ubuntu (BBB-eMMC-flasher-ubuntu-14.04-console-2014-06-05-2gb) on my BeagleBone Black. Anybody else been having problems? Thanks
According to beaglebone getting started …i hv successfully done the first two steps….bt into the third step….i had scan the ip address through advance port scanner and after this i got ssh ip address 192.168.7.2….then configured the ssh-putty setting. i hv login as root my bbb and wrote some comand n i got sever host browser :3000..so.. when i type 192.168.7.2:3000…into chrome… it display cloud9 into tab bar….nthing any content on the web page…..what should i do..?
should i hv write some more command or any further process required for tht..???
plz info me…it very important to me…..
Hi Derek,
I have recetly upgraded my BBB to the latest Debian image. I want to SSH into my BBB through the Ethernet port. I tried to edit the interfaces file in the /etc/network directory. I am using PuTTy to connect to my device. But i am unable to do so. This is the content of my interfaces file.
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet dhcp
# Example to keep MAC address between reboots
#hwaddress ether DE:AD:BE:EF:CA:FE
# The secondary network interface
#auto eth1
#iface eth1 inet dhcp
# WiFi Example
#auto wlan0
#iface wlan0 inet dhcp
# wpa-ssid “essid”
# wpa-psk “password”
# Ethernet/RNDIS gadget (g_ether)
# … or on host side, usbnet and random hwaddr
# Note on some boards, usb0 is automaticly setup with an init script
iface usb0 inet static
address 192.168.7.2
netmask 255.255.255.0
network 192.168.7.0
gateway 192.168.7.1
Please help me on this matter.
Regards
Sounak Ranjan Das
Hi Sonak, Your configuration file looks good. Use zenmap (windows) or mmap (Linux) to find the BBB on your network. You should also be able to connect via USB and type ifconfig. Kind regards, Derek.
Hello Derek,
I’ve done all the steps but when I try to connect to the BBB the connection is refused:
ssh: connect to host 192.168.1.80 port 22: Connection refused
Did I do something wrong?
in beaglebone when i log in putty and when i give command ifconfig then in eth0 inet address,bcast and mask address is not showing kindly help me how to dis
play it
Hi Derek. In the folder /var/lib/connman there’re several ethernet folders just like ethernet_XXXXXXXXXXXX_cable. Which of them should I use? or Can I delete all and the OS will create a new one??
Hello!
I’ve made the following change in BeagleBone Black C (Debian):
nano /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.0.100
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1
But after reboot this configuration doesn’t work. It begins to work only after
the command: /etc/init.d/networking restart
Is performed.
Please, tell me how to make this configuration run at startup.
Thank you!
Hi!
That’s me again.
I have found the answer to my previous question.
The configuration has not worked because I have installed connman in Debian.
So I have removed it and now everything is OK.
Michael, Thanks for the update! I had the same exact issue and this was driving me crazy. I tried so many things to try to fix it but your suggestion was the key.
Dear Developers,
I am trying to do permanent configuration for default gateway in my debian(beaglebone black) machine by settings my network IP for interface usb0 and usb1 as static and doing following configuration in file “/etc/network/interfaces”
iface usb0 inet static
address 192.168.7.2
netmask 255.255.255.252
gateway 192.168.7.1
dns-nameservers 8.8.8.8 8.8.8.4
iface usb1 inet static
address 192.168.6.2
netmask 255.255.255.252
gateway 192.168.6.1
dns-nameservers 8.8.8.8 8.8.8.4
But after I restart my machine I notice that 192.168.7.1 and 192.168.6.1 are not set as default gateway.
And I have to do it again by giving following commands:
route add default gw 192.168.7.1 usb0
route add default gw 192.168.6.1 usb1
So please inform me how can I configure default gateway in debian machine so that it stay configured even after restart.
Kindly inform me if you need any information from me.
Thanks and regards
saurabh Jain
Hi Derek,
Thank you very much for your blog. Discovering connman is less disorienting with your explanations.
I finally managed to set up a nice configuration for the eth0 port. However, I broke usb0 ! (don’t ask me how). ifconfig still displays initial informations.
Do you have a better advice than “re-install the system from SD with the latest Debian image” ?
Hi Derek,
I am working on an project where i need to use beaglebone as an client/server application.For that i need to communicate my PC with the board using LAN cable.But unfortunately i am not able to establish connection.Moreover when i communicate using the default ip i.e 192.168.7.2 (Using Usb) it works fine but i need to communicate using LAN port for establishing connection.So do you have any advise on what should be done?
Hi there, when you are logged on to the BBB using 192.168.7.2 and the Ethernet cable is plugged in, type ifconfig. That will provide you with the dhcp address for your network (e.g., 192.168.1.108). Do this before you set the IP address to be static so that you know it works correctly. Depending on your network infrastructure (e.g., in a university), you may not be permitted to set your address to be static. Kind regards, Derek.
Well, I can’t find connmgr, opkg or anything else. Any simple pointer for a noob?
Hello Derek (or anyone that may know the answer to this question),
I am trying to verify the IP address that is established when connecting to the BBB using Ethernet.
To this end, I have set up an SSH connection using 192.168.7.2, and I type “ifconfig” in the terminal while the BBB is connected to my PC via Ethernet. When I do that, an IP address never appears. All is something like:
Link encap:Ethernet Hwaddr c8:a0:30:a6:89:76
inet6 addr: fe80::caa0:30ff:fea6:8976/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU: 1500 Metric:1
Rx packets……………..
…….
Note, I have noticed that when I connect the BBB to the Ethernet plug in the wall, an IP address DOES appear, as it should. I get the above described issue when connecting the BBB to a PC via Ethernet.
Thanks!
After running all those commands the beagle bone isn’t even being picked up by my network
I am running Debian on an Element 14 BBB, I opened the interfaces file on nano, I made the changes suggested above and added the netmask and address entries, I pressed Exit, save yes, then there is another prompt which I am not sure what to do, so I hit enter again, and I am back at the command line.
I am unable to ping the new static address from another computer, so I run ifconfig on the BBB and it show inet6 and an IPV6 address, but when I nano the interfaces files again, the settings I configured are still the same.
Any help is most welcomed, thank you.
hello Mr. Derek
i’m running Debian on Beaglebone black and i came across with a little issue.
I’ve been trying to configure the beaglebone black with a static ip modifiying /etc/network/interfaces as follows :
auto eth0
allow-hotplug eth0
iface eth0 inet static
address 192.168.100.90
netmask 255.255.255.0
gateway 192.168.100.1
so i configure nameservers modifiying /etc/resolv.conf afterwards
nameserver 192.168.100.1
nameserver 192.168.100.1
Then i could observe that after enable the static ip with the command service networking restart the network parameters are set on network configuration. But, when i unplugged the ethernet cable the configuration of bbb get lost and takes the dhcp configuration.
is there a method to disable dhcp when i configure static ip on beaglebone black?
what is the appropiate way if i wanted to switch dhcp and ip through bash script?
is it posible do to so?
thank you very much ! and i hpe you can help me .
Best regards.
GNU nano 2.2.6 File: /etc/network/interfaces
auto lo
iface lo inet loopback
auto wlan0
iface wlan0 inet static
wpa-ssid “Phynart Technologies”
wpa-psk “phynarthomeintelligence@prototype”
address 192.168.1.115
netmask 255.255.255.0
gateway 192.168.1.1
iface usb0 inet static
address 192.168.7.2
netmask 255.255.255.0
network 192.168.7.0
gateway 192.168.7.1
Is it right to assign static ip like this??
Because whenever I try to change that address from -.-.-.115 to anything like -.4 or -.10 or -.114 Its not changing, after rebooting when I ifconfig it is showing wlan0 address as 192.168.1.115 only?
Hi Derek,
I have been trying to use a BBB with two interfaces, one via ethernet eth0 with a IP camera, another one, usb wifi module (wlan0) to get internet.
It seems that the preference always is the eth0, so I don’t get internet (any ping to a websites work), eth0 is the priority over the wlan0 interface; if I unplugged the cable, the connection is working again. So, I can not keep access to the ip camera and internet at the same time.
googling… I see to use IFMETRIC (inside /etc/network/interfaces), a good tool for establish a routing. I put metric 1 for wlan0
and metric 10 for eth0, In order to give priority to the wlan0.
With a Raspi, works reallly fine. BUT with the BBB is pretty difficult, This hardware omit anything I have tried. After rebooting, it starts fine, after that, once again it put the eth0 over the wlan0, and the internet is gone.
What can I do, to solve this, and always get two the interfaces work, one with internet, another one with local access.
thanks.
On Debian 8 (Jessie), I found that changes to /etc/network/interfaces only stay valid until next reboot. So, you need to use connman in order to make permanent changes for network adapters.
First list services using connmanctl command:
connmanctl services
You should now get a list of available services.
To set a static IP address of your BeagleBone Black, netmask, default gateway and DNS use connmanctl as follows:
sudo connmanctl config –ipv4 manual –nameservers
I hope this helps.
The original post I got this from can be found here: https://groups.google.com/forum/#!topic/beagleboard/yfNwIk_dWlg.
Thanks to Brian Anderson for the original comment.
Hi Derek
I got trouble when try connect ethernet cable . Using angstrom so easy to connect ethernet , when i ifconfig there show the ip address to connect eth0 . But using debian i cant see any ip address of eth0 , even setting ip adr in etc/network/interface they show ip when ifconfig but i cant use that to do the same thing like usb0 ip 192.168.7.2. So what should i do 🙁
THANKS
Derek – good post but please update to include removal of connman for Debian Jessie. I spent quite some time working out why my static allocation was not working and it was all due to connman taking the reigns. Simply sudo apt-get remove connman AFTER setting up /etc/network/interfaces (removing connman causes SSH to die). Then reboot.
AWESOME! Thank you! Finally! Added this to my OneNote book so I never have to chase my tail on this issue again!!!
Derek… PLEASE add this to your page. It is so frustrating when you change /etc/network/interfaces to what you want and then have it not work at reboot.
Now I just have to figure out how to get shutdown -r now to actually reboot the BBB. shutdown -h now doesn’t work either with Jessie. I found this https://github.com/beagleboard/image-builder/commit/0b7dcfbd5ddd852116288c80106f20e1af5c4987 but haven’t tried it yet.
A lingering problem from connman … my /etc/resolv.conf file is still a symbolic link. I cannot resolve any host names and cannot modify or create a resolv.conf file for this reason.
resolv.conf -> /var/run/connman/resolv.conf
Is it safe to delete the link and recreate the resolvconf using nano? The image I installed also has dnsmasq which added a update.d directory in my resolvconf directory. This is different than a slightly older debian installed in my other BBB.
Any thoughts?
I went ahead and unlinked the symlink using (as root)
# unlink /etc/resolv.conf
then
# nano /etc/resolv.conf
populated it with my DNS servers as usual
nameserver 8.8.8.8
nameserver 192.168.0.1
and saved it (it worked this time), then restarted networking
# /etc/init.d/networking stop && /etc/init.d/networking start
and it worked. WOOHOO!
FYI for anyone that has DNS problems with 4.1.15 (yes, terminator-skynet version lol) after removing connman.
I think I basically have your Debian setup, except the USB connection is unresponsive to ping or ssh. I can ssh in via the network and I can screen using the cable to the header pins.
I’ve included all the diagnostic info I can think of below.
Based on the setup in this lab, USB would be really useful. Any ideas you have would be much appreciated.
[ jstoner@beaglebone:~ ]
2s $> uname -a
Linux beaglebone 3.8.13-bone79 #1 SMP Tue Oct 13 20:44:55 UTC 2015 armv7l GNU/Linux
[ jstoner@beaglebone:~ ]
0s $> cat /etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback
# Ethernet/RNDIS gadget (g_ether)
# … or on host side, usbnet and random hwaddr
# Note on some boards, usb0 is automaticly setup with an init script
iface usb0 inet static
address 192.168.7.2
netmask 255.255.255.0
network 192.168.7.0
gateway 192.168.7.1
auto eth0
iface eth0 inet static
address 192.168.80.2
netmask 255.255.255.0
network 192.168.80.0
gateway 192.168.80.1
[ jstoner@beaglebone:~ ]
0s $> ifconfig
eth0 Link encap:Ethernet HWaddr 78:a5:04:ee:39:2d
inet addr:192.168.80.2 Bcast:192.168.80.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:40
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:194 errors:0 dropped:0 overruns:0 frame:0
TX packets:194 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:18398 (17.9 KiB) TX bytes:18398 (17.9 KiB)
usb0 Link encap:Ethernet HWaddr 78:a5:04:ee:39:20
inet addr:192.168.7.2 Bcast:192.168.7.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
[ jstoner@beaglebone:~ ]
0s $>
Recently installed the following image on my BBB:
BBB-eMMC-flasher-ubuntu-14.04.3-console-armhf-2016-01-14-2gb
I set a static ip address in /etc/network/interfaces, but /etc/resolv.conf was not updated with the dns-nameservers. (even on reboot). So I got no internet connection.
auto eth0
iface eth0 inet static
address 192.168.0.201
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 8.8.8.8 192.168.0.1
In case somebody have the same problem and using the same image, follow the instructions below.
So after a bit research I discovered that dnsmasq upstart service was overlapping the settings to /etc/resolv.conf. So I disabled it with the following command:
update-rc.d -f dnsmasq remove
Reboot and you should now see the /etc/resolv.conf file updated.
Hopefully Beagle Bone Black can now communicate with the outside world:
root@arm:~# ping google.com
Hope this helped!
Thanks to Marko Tikvic … after searching several hours …..
Simply remove connman and everything works after an reboot (if you are connected by ssh, the link will be lost…)
sudo apt-get remove connman
Hello everybody,
I have a very peculiar issue with a BBB running the Angstrom distribution.
For whatever reason when the board boots up the usb0 Ethernet interface is by default disabled (which means I can not log in using the 192.168.7.2 address).
If i bring the interface up manually (by running “ifconfig usb0 up”) then everything is fine.
The problem is that I would like this to happen automatically, every time the board boots up.
I trying writing a small script into the /etc/init.d/ directory that executes the above command but still no luck.
Any ideas/suggestions would be greatly appreciated.
Thank
Hi Derek,
nice post, as always. I agree with the commenters above. If you added the following just under where interfaces is
edited in the psot it would save a lot of time…
Best…
mce
molloyd@beaglebone:~$ cd /etc
molloyd@beaglebone:/etc$ sudo nano resolv.conf
[sudo] password for molloyd:
And, edit the resolv.conf file as follows:
molloyd@beaglebone:/etc$ more resolv.config
nameserver 192.168.1.1
nameserver 8.8.8.8
nameserver 8.8.4.4
Hello sir,
I got all the thing which your explain,but sir when I try this on my
own machine there is problem I am try to ping google.com or any other side on Beaglebone consol
why it is happen plz give some hints
I tried this but no matter what i do i cannot set a static ip on my BBB rev C. I am using debian 8.4.
Hi Derek,
I’ve been really struggling with internet connection on Beaglebone. I have been getting it to wok, but after I restarted my laptop, it stopped working. When I try to ping 8.8.8.8, it just wouldn’t connect and I have made sure I did everything you said. Please help. Thank you!
Amelia Bian
Hi,
I try to use a static ip. But it works only if I execute this command:
sudo /etc/init.d/networking restart
But if I restart the system I get the dynamic ip (dhcp).
I can copy the command “sudo /etc/init.d/networking restart” in “/etc/rc.local” but this is not the best solution. Can anybody help me?
Hi Derek, good afternoon.
My name is Marcos, I would like to know how can I make a p2p connection with the beaglebone and an android app, because I wouldn’t like to make a port forwarding in my router. Thank You.
Hoping someone can help. My BBB is losing the IP address if the network cable is unplugged and then plugged back in.
I am using debian and the RJ45 based network interface. It is configured for static IP. Everything is just as it should be when the machine boots. If the network cable is physically disconnected and then reconnected the network interface seems to come back to life (the lights on the network switch indicate activity) but I cannot ping the machine. It appears to have lost the IP address.
This BBB is in an instrument housing. I have no serial console access, so my debugging has been a bit hampered. Surprisingly, I was able to duplicate the behavior on a laptop running a Ubuntu desktop. Much of my googling seems to reference Network Manager, but my understanding is that this is not running on the BBB Debian.
Is there a way to force the network interface to remain active when the cable is unplugged. I think this would be a brute force way to solve this issue. Other ideas welcome. I will grab some more info when I next have physical access to the unit.
Thanks for any feedback. And thanks for the site and all the info Derek!!
Derek, thanks for writing this up. I’ve also got one of your books and that’s been incredibly helpful as well. I was going to mention how utterly preposterous it is that it takes this much explanation just to set your static ip address, but I figured you would reject my post in that case. So there, I mentioned it anyways. And thanks again writing it all up. I mean it. I would never get through a single day with one of these things without grabbing how-to things like this off the web or a couple of well chosen books.
-cb
I just got my BBB, so it’s relatively new. From whatever else I’ve read on the web, I thought Angstrom was the default OS on this thing. But according to uname -a, it looks like Debian. And now I’m reading other things on the web where people are saying things like, “No one’s update the Angstrom site in four years”. And they mostly say that Angstrom is a POS (which does not mean Point of Sale). Can anyone shed any light on this?
hi derek,
I am a new user to beaglebone. i’ve purchased beaglebone black. i tried connecting it to my host(ubuntu 16.04). i did as mentioned in getting started guide from beagleboard.org installed the udev rules. now the problem is when i connect bbb when my host already running, it does not connect. says destination host unreachable. and sometimes no route to the host. i use ssh to connect. bbb is shown as enx38d26993f39b in ifconfig entry in the host pc. i see its not assigned 192.168.7.1 ip. i have to manually assign this ip to ssh to 192.168.7.2 which is bbb by default. so i added enx38d26993f39b in my /etc/network/interfaces and assign it static ip. but for reasons i dont know it does not work. i have to manually assign enx38d26993f39b ip 192.168.7.1 in order to ssh.
can you help here. i wanted if i connect my board to host. i dont have to deal with IPs it should configure that automatically.
Hi Derek,
Is the above method valid for Debian Jessie and stretch?
Thanks
Derek,
I am setting up the BBB black 4G. I did factory reset using the following link:
https://old.ghielectronics.com/community/forum/topic?id=23763
This image does not have wicd folder under /etc. I really need to understand that how new version of the BBB OS works for the network manager-settings.conf
After lots of research I found that new OS takes Connman from your blog. I would really appreciate how can i activate wired ethernet IP address?
Dear Developers,
I am trying to do permanent configuration for default gateway in my debian(beaglebone black) machine by settings my network IP for interface usb0 and usb1 as static and doing following configuration in file “/etc/network/interfaces”
iface usb0 inet static
address 192.168.7.2
netmask 255.255.255.252
gateway 192.168.7.1
dns-nameservers 8.8.8.8 8.8.8.4
iface usb1 inet static
address 192.168.6.2
netmask 255.255.255.252
gateway 192.168.6.1
dns-nameservers 8.8.8.8 8.8.8.4
But after I restart my machine I notice that 192.168.7.1 and 192.168.6.1 are not set as default gateway.
And I have to do it again by giving following commands:
route add default gw 192.168.7.1 usb0
route add default gw 192.168.6.1 usb1
So please inform me how can I configure default gateway in debian machine so that it stay configured even after restart.
Additionally I have also tried to use “connmanctl” method as mentioned in above post. But unfortunately I do not get anything when I run command “connmanctl services” (case when my BBB is connected to my PC using only usb).
Kindly inform me if you need any information from me.
Thanks and regards
saurabh Jain
Hi Derk,
Firstly a huge thanks for your tutorials and the fantastic book from which I learned a tremendous amout. However, I’ve since bought a newer board and things have changed and some of your exercises don’t run, especially concerning the PRU which now uses remoteproc instead of UIO. I see you have a new book out in Jan 2019, will you be covering this new feature and any other changes?
The biggest problem with /etc/network/interfaces is that you can only use a /24 mask such as 255.255.255.0 ; if you try a /23 mask such as 255.255.254.0 it doesn’t work – will not set it.
Hi, I’ve followed the instructions to the letter. I can get my laptop talking to the BeagleBone, pinging back and forth on the local network using Putty. I changed my settings on my home Wifi to allow sharing. But, when I look at my BeagleBone status on Control Panel >> Network and Internet >> Network Connections >> Linux USB Ethernet/RNDIS Gadget it says, “IPv4 Connectivity: No network access”.
I don’t see too many people talking about this. Why would it say that? My home Wifi says: “IPv4 Connectivity: Internet”. That’s what I would want it to say. Is it possible to change that status? This might be a problem other people are having too.