Skip to first unread message

Enric Climent

unread,
Feb 13, 2015, 5:02:09 AM2/13/15
to beagl...@googlegroups.com
Hi! I put latest jessie debian snapshot from here http://elinux.org/Beagleboard:BeagleBoneBlack_Debian

Well, i want to have an ip to the beaglebone. I put this in /etc/network/interfaces:

auto eth0
iface eth0 inet static
 #your static IP
 address 192.168.1.26
 #your gateway IP
 gateway 192.168.1.1


But when restart the ip are 192.168.1.130 (provided by DHCP server). If after reboot i execute /etc/init.d/networking restart then ip change to 192.168.1.26 but if i ping 192.168.1.130 the beagle responds correctly.

So Any ideas? Thanks!

COG

unread,
Feb 13, 2015, 7:42:38 AM2/13/15
to beagl...@googlegroups.com
Try this:


auto eth0 
iface eth0 inet static
    address 192.168.1.26
    netmask 255.255.255.0
    gateway 192.168.1.1

That worked for me.

Enric Climent

unread,
Feb 13, 2015, 11:49:31 AM2/13/15
to beagl...@googlegroups.com
That is like i have but the problem is that when reboot the beaglebone i lose the configuration until i reboot networking manually. 

El divendres, 13 febrer de 2015 13:42:38 UTC+1, COG va escriure:

COG

unread,
Feb 13, 2015, 12:27:03 PM2/13/15
to beagl...@googlegroups.com
Did you include the netmask 255.255.255.0 line? You should probably send the 'interfaces' (Assuming your using Debian: /etc/network/interfaces) file as an attachment so follks can check it out.

Enric Climent

unread,
Feb 13, 2015, 12:37:07 PM2/13/15
to beagl...@googlegroups.com
Yes, ok this night i will attach it ;) thanks!

El divendres, 13 febrer de 2015 18:27:03 UTC+1, COG va escriure:

Enric Climent

unread,
Feb 14, 2015, 12:21:25 PM2/14/15
to beagl...@googlegroups.com
Ok, here is my /etc/network/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 static
  address 192.168.1.26
  netmask 255.255.255.0
  gateway 192.168.1.1
# 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

It wirks but i must restart networking service on startup. (/etc/init.d/networking restart)
If i dont restart it eth0 doesnt have any configuration with no ip no gateway and no netmask assigned.
What can i do ?
Thanks!

El divendres, 13 febrer de 2015 18:37:07 UTC+1, Enric Climent va escriure:

Bruce Boyes

unread,
Feb 15, 2015, 11:46:45 AM2/15/15
to beagl...@googlegroups.com
Does the router/dhcp server config have to be considered? On my routers I usually make < .100 fixed IP and start dhcp service above that. If your router is not configured that way I wonder what would happen? I'll try this myself since now I am curious. (So far on BBB I've just been using DHCP.)

Brian Anderson

unread,
Feb 16, 2015, 10:44:33 PM2/16/15
to beagl...@googlegroups.com
Enric,

I think your problem may be related to ConnMan.  ConnMan is a network manager that is installed on the Jessie test images.  It manages your network connections, including eth.  Any settings you have in /etc/network/interfaces is overriden by ConnMan, and thus this is why you see a DHCP assigned address rather than the static address configured in /etc/network/interfaces when you reboot.

You can disable ConnMan (not recommended), tell ConnMan to not manage eth0 on your behalf and manage things yourself (again, not recommended), or use ConnMan to setup a static IP address.  Using ConnMan to setup a static IP address will be "persistent", that is it will survive reboots.  This is pretty simple:

First, determine the "service" name of your ethernet:

connmanctl services

Using the appropriate ethernet service, tell connman to setup a static IP address for that service:

sudo connmanctl config <service> --ipv4 manual <ip_addr> <netmask> <gateway> --nameservers <dns_server>

You will need to pick an IP address compatible with your network and router.

For example:

$ connmanctl services
*AO Wired                ethernet_d05fb8ed4f78_cable
$ sudo connmanctl config ethernet_d05fb8ed4f78_cable --ipv4 manual 10.0.1.100 255.255.255.0 10.0.1.1 --nameservers 8.8.8.8

You should then see the new address using the "ip" command:

$ ip addr show dev eth0
2: eth0: <BROADCAST,MULTICAST,DYNAMIC,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether d0:5f:b8:ed:4f:78 brd ff:ff:ff:ff:ff:ff
    inet 10.0.1.100/24 brd 10.0.1.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::d25f:b8ff:feed:4f78/64 scope link
       valid_lft forever preferred_lft forever

You should now also be able to "ping" an address such as "google.com".

You can revert back to a DHCP configuration simply as follows:

$ sudo connmanctl config ethernet_d05fb8ed4f78_cable --ipv4 dhcp

It would be best if you have a FTDI serial cable so you can see what is going on at the console in case something goes wrong.  Actually, it would be best to issues these commands from the console rather than ssh'ing.

Hope this helps

ba

Enric Climent

unread,
Feb 17, 2015, 9:22:13 AM2/17/15
to beagl...@googlegroups.com


El dimarts, 17 febrer de 2015 4:44:33 UTC+1, Brian Anderson va escriure:
Ok thanks i try it. For now i get static ip writing simple script and save it at /etc/init.d :
#!bash
/etc/init.d/networking restart

after:
# update-rc.d fixnet defaults

And now i get static ip when reboot bbb.
So i try understant how connman works and will edit configuration for static ip at eth0.
Thanks a lot bro ;)

marko...@gmail.com

unread,
Dec 11, 2015, 9:46:27 AM12/11/15
to BeagleBoard
This worked perfectly.
Thank you.

Jeroavf

unread,
Feb 22, 2016, 7:36:25 AM2/22/16
to BeagleBoard
Thanks a lot Brian , I spent the whole sunday trying to find why static ip configurations was being "discarded" after reboot  and found your answer. 
I followed the instructions about  ConnMan configuration for static ip and now BBB it's functioning with static ip after reboot. 
Regards ,
Jeronimo

rudydelo...@gmail.com

unread,
Mar 19, 2016, 11:52:46 PM3/19/16
to BeagleBoard
Thanks Brian!!

This worked for me. 
Was tearing my hair out going from Wheezy to Jessie

yoda zhong

unread,
Jul 5, 2016, 5:22:42 PM7/5/16
to BeagleBoard
Thanks Brian,
Your post helped me. :)

Yin Ke

unread,
Sep 11, 2016, 2:04:42 PM9/11/16
to BeagleBoard
Hi Eric,
I followed your comment exactly and update /etc/network/interfaces file:
===========================================================

# The primary network interface
auto eth0
iface eht0 inet static

    address 192.168.1.26
    netmask 255.255.255.0
    gateway 192.168.1.1
#iface eth0 inet dhcp

# Example to keep MAC address between reboots
#hwaddress ether DE:AD:BE:EF:CA:FE
==========================================================
Then I "/etc/init.d/networking restart" or "reboot", but my eth0's ip address is still got from dhcp, e.g. 192.168.1.112.
Can you give more hint?
Thanks.

Jeffrey Ke

Paul Wolfson

unread,
Sep 11, 2016, 7:30:53 PM9/11/16
to beagl...@googlegroups.com

Alvaro Miranda Aguilera

unread,
Sep 11, 2016, 7:30:54 PM9/11/16
to beagl...@googlegroups.com
Hi

Check NetworkManager is not running.

Alvaro.

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/efeb7bd0-83f6-4876-a148-e5bcdd82a355%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

saurabh...@gmail.com

unread,
Jun 8, 2018, 11:40:32 AM6/8/18
to BeagleBoard

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 tried to configure it using command "connmanctl". But when I give command 

#connmanctl services


I do not get anything on my terminal window.


Please Note: I want to configure gateway for my ethernet over USB interface.



Kindly inform me if you need any information from me.



Thanks and regards

saurabh Jain
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.



--

Rudy Misek

unread,
Jun 18, 2018, 7:06:14 AM6/18/18
to BeagleBoard
Hi Saurahb,

The reason #connmanctl services is not returning anything, is because it's probably not installed
I'm guessing you're using an older Debian image 
Jessie and above have connman (connection manager) and use it by default

Can you post what is returned from this command # uname -a

This is the image I'm using ATM (Debian Stretch)
# uname -a
Linux beaglebone 4.4.110-ti-r144 #1 SMP Wed Jan 24 03:00:14 UTC 2018 armv7l GNU/Linux

It uses connman, usb0 and usb1 is blacklisted here root@beaglebone:/# nano /etc/connman/main.conf

[General]
PreferredTechnologies=ethernet,wifi
SingleConnectedTechnology=false
AllowHostnameUpdates=false
PersistentTetheringMode=true
NetworkInterfaceBlacklist=SoftAp0,usb0,usb1

Which means that connman ignores usb0 and usb1

You can change usb0 with # nano /etc/network/interfaces

# 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

## Now done via connmanctl
#auto eth0
#iface eth0 inet static
#    address 192.168.1.152
#    netmask 255.255.255.0
#    gateway 192.168.1.1

# usb0
iface usb0 inet static
    address 192.168.7.5
    netmask 255.255.255.0
    gateway 192.168.7.1

Changes will take effect after rebooting

However you can't do this for usb1, you have to change it here # nano /opt/scripts/boot/autoconfigure_usb1.sh

#!/bin/bash
#
# Copyright (c) 2017 David Lechner <da...@lechnology.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#


#
# Auto-configuring the usb1 network interface:
#
# usb1 is the CDC/ECM gadget connection. It is managed by ConnMan and uses
# tethering so that it serves a DHCP address to attached hosts. The IPv4 subnet
# used by ConnMan is not consistent, so hosts should connect using the mDNS
# name (beaglebone.local) instead of an IP address.
#

# This is probably not needed if autoconfigure_usb0.sh is run first because it
# also waits for /sys/class/net/usb0/
until [ -d /sys/class/net/usb1/ ] ; do
        sleep 1
        echo "g_multi: waiting for /sys/class/net/usb1/"
done

# gadget is not supported by ConnMan provisioning files, so we have to do this
# the ugly way. Advanced users can comment these line to gain full control of
# the usb1 network interface.
#connmanctl enable gadget >/dev/null 2>&1
#connmanctl tether gadget on >/dev/null 2>&1

/sbin/ifconfig usb1 192.168.6.5 netmask 255.255.255.0 || true

Changes will take effect after rebooting

Do this command to confirm changes have been applied after reboot
# ifconfig

eth0: flags=-28605<UP,BROADCAST,RUNNING,MULTICAST,DYNAMIC>  mtu 1500
        inet 192.168.1.190  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::9a84:e3ff:fe05:1194  prefixlen 64  scopeid 0x20<link>
        ether 98:84:e3:05:11:94  txqueuelen 1000  (Ethernet)
        RX packets 8401  bytes 776016 (757.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1723  bytes 201027 (196.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 178

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 2  bytes 176 (176.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2  bytes 176 (176.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

usb0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.7.5  netmask 255.255.255.0  broadcast 192.168.7.255
        ether 98:84:e3:05:11:96  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

usb1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.6.5  netmask 255.255.255.0  broadcast 192.168.6.255
        ether 98:84:e3:05:11:99  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

As for the gateway for USB I'm not sure, I can't seem to set it in the /etc/network/interfaces or /opt/scripts/boot/autoconfigure_usb1.sh

If you manage to do this, can you post the steps you used here

Hope this helps ✌

You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/yfNwIk_dWlg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/fc7180fd-4759-45c6-bf30-1514633fa252%40googlegroups.com.

Saurabh Jain

unread,
Jun 19, 2018, 11:14:46 AM6/19/18
to beagl...@googlegroups.com
Hello Rudy


Thank you very much for your fast response


In my BBB

# uname -a  returns


Linux beaglebone 4.9.78-ti-r94 #1 SMP PREEMPT Fri Jan 26 21:26:24 UTC 2018 armv7l GNU/Linux

Yes, you are right in my BBB also usb0 and usb1 is blacklisted in file /etc/connman/main.conf. I will do the changes and will update you .


Thanks and regards

Saurabh

Reply all
Reply to author
Forward
0 new messages