how do I set a static IP on a beaglebone black ? On a raspberry pi I could just nano /etc/network/interfaces and add:
iface eth0 inet static
address 192.168.2.110
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255
gateway 192.168.2.1
but this did not work on my BBB, even after a reboot it seems to ignore the file. After a lot of searching some folks mentioned uEnv.txt. On my system I found it on /boot
root@beaglebone:/boot# ls
am335x-bone.dtb omap2420-h4.dtb omap4-panda-a4.dtb omap5-evm.dtb
am335x-boneblack.dtb omap3-beagle-xm.dtb omap4-panda-es.dtb uEnv.txt
am335x-evm.dtb omap3-beagle.dtb omap4-panda.dtb uImage
am335x-evmsk.dtb omap3-evm.dtb omap4-sdp.dtb uImage-3.8.13
am335x-tester.dtb omap3-tobi.dtb omap4-var-som.dtb
root@beaglebone:/boot#
root@beaglebone:/boot# cat uEnv.txt
optargs=run_hardware_tests quiet
root@beaglebone:/boot#
can I just insert ipaddr=x.x.x.x in this file ? does it have to go before or after the current line ? or is there a better way to set the static IP ?
thanks
how to set a static IP on a BBB
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 1
- Joined: Wed Jun 27, 2012 5:16 pm
Re: how to set a static IP on a BBB
To set a static IP address is slightly complicated by the fact that it's using a package called connman, so is probably ignoring /etc/network/interfaces. SSH into the Beaglebone Black and type:
cd /usr/lib/connman/test
./get-services
You should get a page of blurb like this:
root@beaglebone:/usr/lib/connman/test# ./get-services
[ /net/connman/service/ethernet_9059ae559121_cable ]
IPv6.Configuration = { Method=auto Privacy=disabled }
AutoConnect = true
Name = Wired
Nameservers = [ 192.168.1.254 ]
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.254 Method=dhcp Address=192.168.1.74 }
Timeservers = dbus.Array([dbus.String(u'192.168.1.254')], signature=dbus.Signature('s'), variant_level=1)
IPv6 = { }
Domains = [ home ]
Ethernet = { Interface=eth0 MTU=1500 Method=auto Address=90:59:AE:55:91:21 }
Security = [ ]
Proxy.Configuration = { }
Type = ethernet
Immutable = false
IPv4.Configuration = { Method=dhcp }
The first line gives you a crucial service name you'll need, here it's ethernet_9059ae559121_cable but obviously those numbers will vary per your mac address. Substitute that number into these commands (here I'm setting for Google DNS 8.8.8.8 and 8.8.4.4, and my router 192.168.1.254 if it's connected into my home network, and a static ip of 192.168.1.33):
./set-nameservers ethernet_9059ae559121_cable 8.8.8.8 8.8.4.4
./set-ipv4-method ethernet_9059ae559121_cable manual 192.168.1.33 255.255.255.0 192.168.1.254
At this point, your SSH session will freeze, because the BBB is no longer on the IP address you were connecting to. To kill it, type ~. (tilde-full stop), try rebooting the bone and try SSH to your newly assigned fixed IP.
cd /usr/lib/connman/test
./get-services
You should get a page of blurb like this:
root@beaglebone:/usr/lib/connman/test# ./get-services
[ /net/connman/service/ethernet_9059ae559121_cable ]
IPv6.Configuration = { Method=auto Privacy=disabled }
AutoConnect = true
Name = Wired
Nameservers = [ 192.168.1.254 ]
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.254 Method=dhcp Address=192.168.1.74 }
Timeservers = dbus.Array([dbus.String(u'192.168.1.254')], signature=dbus.Signature('s'), variant_level=1)
IPv6 = { }
Domains = [ home ]
Ethernet = { Interface=eth0 MTU=1500 Method=auto Address=90:59:AE:55:91:21 }
Security = [ ]
Proxy.Configuration = { }
Type = ethernet
Immutable = false
IPv4.Configuration = { Method=dhcp }
The first line gives you a crucial service name you'll need, here it's ethernet_9059ae559121_cable but obviously those numbers will vary per your mac address. Substitute that number into these commands (here I'm setting for Google DNS 8.8.8.8 and 8.8.4.4, and my router 192.168.1.254 if it's connected into my home network, and a static ip of 192.168.1.33):
./set-nameservers ethernet_9059ae559121_cable 8.8.8.8 8.8.4.4
./set-ipv4-method ethernet_9059ae559121_cable manual 192.168.1.33 255.255.255.0 192.168.1.254
At this point, your SSH session will freeze, because the BBB is no longer on the IP address you were connecting to. To kill it, type ~. (tilde-full stop), try rebooting the bone and try SSH to your newly assigned fixed IP.
- jimk123
- Posts: 708
- Joined: Sun Dec 26, 2010 7:04 pm
Re: how to set a static IP on a BBB
this is what I get :
I tried this both with the usb cable and a serial cable and in both cases get-services returns nothing. I should also mention the board is brand new and SSH did not work either and no another post here was told to delete dropbear_rsa_host_key which fixed that problem.
this is the version info and on the header pin a paper tag says A6
root@beaglebone:/usr/lib/connman/test# uname -a
Linux beaglebone 3.8.13 #1 SMP Wed Sep 4 09:09:32 CEST 2013 armv7l GNU/Linux
root@beaglebone:~# cd /usr/lib/connman/test
root@beaglebone:/usr/lib/connman/test# ./get-services
root@beaglebone:/usr/lib/connman/test#
seems like something is missing ?
root@beaglebone:/usr/lib/connman/test# ls -al
total 140
drwxr-xr-x 2 root root 4096 Mar 18 2013 .
drwxr-xr-x 3 root root 4096 Mar 18 2013 ..
-rwxr-xr-x 1 root root 1118 Jul 3 2013 backtrace
-rwxr-xr-x 1 root root 2144 Jul 3 2013 connect-vpn
-rwxr-xr-x 1 root root 889 Jul 3 2013 disable-tethering
-rwxr-xr-x 1 root root 348 Jul 3 2013 disconnect-vpn
-rwxr-xr-x 1 root root 1334 Jul 3 2013 enable-tethering
-rwxr-xr-x 1 root root 233 Jul 3 2013 get-global-timeservers
-rwxr-xr-x 1 root root 621 Jul 3 2013 get-proxy-autoconfig
-rwxr-xr-x 1 root root 1277 Jul 3 2013 get-services
-rwxr-xr-x 1 root root 229 Jul 3 2013 get-state
-rwxr-xr-x 1 root root 1512 Jul 3 2013 list-services
-rwxr-xr-x 1 root root 2120 Jul 3 2013 monitor-connman
-rwxr-xr-x 1 root root 2799 Jul 3 2013 monitor-services
-rwxr-xr-x 1 root root 571 Jul 3 2013 service-move-before
-rwxr-xr-x 1 root root 485 Jul 3 2013 set-domains
-rwxr-xr-x 1 root root 386 Jul 3 2013 set-global-timeservers
-rwxr-xr-x 1 root root 982 Jul 3 2013 set-ipv4-method
-rwxr-xr-x 1 root root 1115 Jul 3 2013 set-ipv6-method
-rwxr-xr-x 1 root root 496 Jul 3 2013 set-nameservers
-rwxr-xr-x 1 root root 1274 Jul 3 2013 set-proxy
-rwxr-xr-x 1 root root 491 Jul 3 2013 show-introspection
-rwxr-xr-x 1 root root 5796 Jul 3 2013 simple-agent
-rwxr-xr-x 1 root root 390 Jul 3 2013 test-clock
-rwxr-xr-x 1 root root 351 Jul 3 2013 test-compat
-rwxr-xr-x 1 root root 4702 Jul 3 2013 test-connman
-rwxr-xr-x 1 root root 1610 Jul 3 2013 test-counter
-rwxr-xr-x 1 root root 2079 Jul 3 2013 test-manager
-rwxr-xr-x 1 root root 285 Jul 3 2013 test-new-supplicant
-rwxr-xr-x 1 root root 8951 Jul 3 2013 test-session
-rwxr-xr-x 1 root root 1333 Jul 3 2013 test-supplicant
root@beaglebone:/usr/lib/connman/test#
thanks
I tried this both with the usb cable and a serial cable and in both cases get-services returns nothing. I should also mention the board is brand new and SSH did not work either and no another post here was told to delete dropbear_rsa_host_key which fixed that problem.
this is the version info and on the header pin a paper tag says A6
root@beaglebone:/usr/lib/connman/test# uname -a
Linux beaglebone 3.8.13 #1 SMP Wed Sep 4 09:09:32 CEST 2013 armv7l GNU/Linux
root@beaglebone:~# cd /usr/lib/connman/test
root@beaglebone:/usr/lib/connman/test# ./get-services
root@beaglebone:/usr/lib/connman/test#
seems like something is missing ?
root@beaglebone:/usr/lib/connman/test# ls -al
total 140
drwxr-xr-x 2 root root 4096 Mar 18 2013 .
drwxr-xr-x 3 root root 4096 Mar 18 2013 ..
-rwxr-xr-x 1 root root 1118 Jul 3 2013 backtrace
-rwxr-xr-x 1 root root 2144 Jul 3 2013 connect-vpn
-rwxr-xr-x 1 root root 889 Jul 3 2013 disable-tethering
-rwxr-xr-x 1 root root 348 Jul 3 2013 disconnect-vpn
-rwxr-xr-x 1 root root 1334 Jul 3 2013 enable-tethering
-rwxr-xr-x 1 root root 233 Jul 3 2013 get-global-timeservers
-rwxr-xr-x 1 root root 621 Jul 3 2013 get-proxy-autoconfig
-rwxr-xr-x 1 root root 1277 Jul 3 2013 get-services
-rwxr-xr-x 1 root root 229 Jul 3 2013 get-state
-rwxr-xr-x 1 root root 1512 Jul 3 2013 list-services
-rwxr-xr-x 1 root root 2120 Jul 3 2013 monitor-connman
-rwxr-xr-x 1 root root 2799 Jul 3 2013 monitor-services
-rwxr-xr-x 1 root root 571 Jul 3 2013 service-move-before
-rwxr-xr-x 1 root root 485 Jul 3 2013 set-domains
-rwxr-xr-x 1 root root 386 Jul 3 2013 set-global-timeservers
-rwxr-xr-x 1 root root 982 Jul 3 2013 set-ipv4-method
-rwxr-xr-x 1 root root 1115 Jul 3 2013 set-ipv6-method
-rwxr-xr-x 1 root root 496 Jul 3 2013 set-nameservers
-rwxr-xr-x 1 root root 1274 Jul 3 2013 set-proxy
-rwxr-xr-x 1 root root 491 Jul 3 2013 show-introspection
-rwxr-xr-x 1 root root 5796 Jul 3 2013 simple-agent
-rwxr-xr-x 1 root root 390 Jul 3 2013 test-clock
-rwxr-xr-x 1 root root 351 Jul 3 2013 test-compat
-rwxr-xr-x 1 root root 4702 Jul 3 2013 test-connman
-rwxr-xr-x 1 root root 1610 Jul 3 2013 test-counter
-rwxr-xr-x 1 root root 2079 Jul 3 2013 test-manager
-rwxr-xr-x 1 root root 285 Jul 3 2013 test-new-supplicant
-rwxr-xr-x 1 root root 8951 Jul 3 2013 test-session
-rwxr-xr-x 1 root root 1333 Jul 3 2013 test-supplicant
root@beaglebone:/usr/lib/connman/test#
thanks
- jimk123
- Posts: 708
- Joined: Sun Dec 26, 2010 7:04 pm
Re: how to set a static IP on a BBB
what's missing was an Ethernet cable once I plugged that in get-services returned data
working through the set commands now...
working through the set commands now...
- jimk123
- Posts: 708
- Joined: Sun Dec 26, 2010 7:04 pm
Re: how to set a static IP on a BBB
SUCCESS ! thank you so much RorschachUK ! excellent instructions...
- wbp
- Posts: 260
- Joined: Mon Mar 07, 2011 1:18 pm
Re: how to set a static IP on a BBB
how do you change the ip address for the USB ethernet port??? I have searched and searched an cannot find anything. Connman doesn't seem to deal with this port.
our subnet is 192.168.1, not 192.168.7. I can only get to the BBB using PuTTY to the COMxx port.
Thanks!
our subnet is 192.168.1, not 192.168.7. I can only get to the BBB using PuTTY to the COMxx port.
Thanks!
Please be positive and constructive with your questions and comments.