Beaglebone Linux 101: Assigning a Static IP Address with Connman

Posted on February 6, 2012 by dwatts

My article on configuring Angstrom Linux included instructions for setting a static IP address. Sometime after posting that article, I realized that the instructions work great unless you happen to reboot. Then, the settings reverted to the default of using a DHCP server.

Ooops!

It turns out that this sleight-of-hand is the work, aptly enough, of a package namedConnman.

This newfangled connection manager is, in some ways, a good fit for the Beaglebone, since it was designed to run on memory-constrained embedded Linux systems. It was originally developed for use on 2 Linux platforms that have struggled, Meego and Moblin, but we won’t hold that against it.

However, Connman presents one big problem for Beaglebone users: it’s rather difficult to configure from the command line.

It doesn’t come with a command line configuration tool, but it does provide some well documented APIs that command line applications can use. As such, the best command line interface right now can be found in a package intended to test that the APIs are working correctly: connman-tests.

To install the package:

opkg install connman-tests

This will install a set of Python scripts in /usr/lib/connman/test.

To check your current configuration:

cd /usr/lib/connman/test/
./get-services

The output should look like the following:

[ /net/connman/service/ethernet_405fc276b749_cable ]
IPv6.Configuration = { Method=auto Privacy=disabled }
AutoConnect = false
Proxy.Configuration = { }
Name = Wired
Nameservers = [ 206.47.244.104 206.47.199.155 ]
Provider = { }
Favorite = true
Domains.Configuration = [ ]
State = online
Proxy = { Method=direct }
Nameservers.Configuration = [ ]
LoginRequired = 0
IPv6 = { }
Domains = [ lan ]
Ethernet = { Interface=eth0 MTU=1500 Method=auto 
Address=xx:xx:xx:xx:xx:xx }
Security = [ ]
IPv4.Configuration = { Method=dhcp }
Type = ethernet
Immutable = false
IPv4 = { Netmask=255.255.255.0 Gateway=192.168.1.1 
Method=dhcp Address=192.168.1.161 }

The important thing to note here is the service ID at the top of the output, in my case  ethernet_405fc276b749_cable.  (Dumb name for an ethernet cable, if you ask me.)

You can also get the DNS nameserver and gateway IP addresses from this output, if you don’t already know them.

To change the configuration, you use 2 other scripts, set-ipv4-method and set-nameservers.

The syntax for set-ipv4-method is:

./set-ipv4-method <service> [off|dhcp|manual <address> [netmask] [gateway]]

The service parm is that long string that appears at the top of the output from the get-services script.

So, to set the Beaglebone to use a static IP address of 192.168.1.2, with a gateway of 192.168.1.1, I entered:

./set-ipv4-method ethernet_405fc276b749_cable manual 
192.168.1.2 255.255.255.0 192.168.1.1

To set the DNS nameservers, use set-nameservers.  The syntax is:

./set-nameservers <service> [nameserver*]

In my case, I entered

./set-nameservers ethernet_405fc276b749_cable 206.47.244.104 
206.47.199.155

That’s it: after entering those 2 commands, you’ll be running with the new network settings, no reboot required. (Though, if you plan to blog about it, a reboot is definitely recommended!)

beaglebone-black 在Angstrom系统中的网络配置方法的更多相关文章

  1. 由安装两块网卡的linux系统中引起网络不通想到的

    由安装两块网卡的linux系统中引起网络不通想到的 一天,小王突然急匆匆的来找我,他说:"我在机子上刚装的redhat怎么老也ping不通服务器,我网卡的驱动都安装了,ping 自己的两块网 ...

  2. 修改 /var/lib/locales/supported.d/local 文件(使用 locale -a 命令查看系统中所有已配置的 locale)

    转自:http://zyxhome.org/wp/cc-prog-lang/c-stdlib-setlocale-usage-note/ http://www.west263.com/info/htm ...

  3. SQLServer—系统中的内存配置

    前言: 本文讲述32位和64位系统中的内存配置,在SQLServer 2005/2008中,DBA们往往尝试开启AWE来限制内存.但是,在SQLServer2012以后,这个选项将被弃用,所以不能使用 ...

  4. 第十七章——配置SQLServer(2)——32位和64位系统中的内存配置

    原文:第十七章--配置SQLServer(2)--32位和64位系统中的内存配置 前言: 本文讲述32位和64位系统中的内存配置,在SQLServer 2005/2008中,DBA们往往尝试开启AWE ...

  5. 双系统中ubuntu的安装方法

    双系统中ubuntu的安装方法 注意:给电脑安装双系统时,一定要先装Windows系统,再安装Linux系统! 原因是电脑开机后,要先执行一段bootloader引导程序:再由引导程序启动操作系统.W ...

  6. L04-VirtualBox中CentOS7网络配置(可连外网)

    本文所述的方法在RHEL6.5.RHEL7和CentOS6.5中同样适用. 1.工具:VirtualBox,虚拟机:CentOS7 2.VirtualBox工具中的网络配置 (1)VirtualBox ...

  7. win764bit系统plsqldeveloper11连接oracle11g64bit配置方法

    win764bit系统plsqldeveloper11连接oracle11g64bit配置方法: 原因:plsqldeveloper都是32位的没有64位的程序 准备工作: 1,先要下载instant ...

  8. 使用SecureCRT连接虚拟机中Linux系统 和 虚拟机网络配置

    使用SecureCRT连接步骤:1.首先打开虚拟机,点击左上角的编辑,再点击虚拟网络编辑器(已经进行虚拟网络编辑的忽略此步骤,直接进行第二步) 点击VMnet8网络,点击更改设置,此步骤需要管理员权限 ...

  9. 【VMware】VMware Workstation中虚拟机网络配置

    一直用的vmware的虚拟机以及UVP还有cirtix的虚拟机,然后对vmware workstation却一窍不通,这个怎么了得,下面介绍一下我学习中遇到的问题及解决办法. 一.准备工作: vmwa ...

随机推荐

  1. module_init宏解析

    在init.h中我们看到 #define module_init(x) __initcall(x); 还看到 #define __initcall(fn) device_initcall(fn) 还有 ...

  2. bzoj1914

    这道题用转化补集的思想一下就很简单了考虑不包括原点的三角形,显然对于一个点,它与原点构成的直线在这条直线同侧的任意两点和这个点构成的三角形一定不是黄金三角形为了避免重复我们只考虑直线上方的两点然后我们 ...

  3. ECC校验优化之路

    引子: 今天上嵌入式课程时,老师讲到Linux的文件系统,讲的重点是Linux中对于nand flash的ECC校验和纠错.上课很认真地听完,确实叹服代码作者的水平. 晚上特地下载了Linux最新的内 ...

  4. [转] Manacher算法详解

    转载自: http://blog.csdn.net/dyx404514/article/details/42061017 Manacher算法 算法总结第三弹 manacher算法,前面讲了两个字符串 ...

  5. [OpenSource]浅谈.Net和Java互相调用的三种方式

    在很多的大型系统开发中,开发工具往往不限制于同一种开发语言,而是会使用多种开发语言的混合型开发.目前Java和.Net都声称自己占85%的市场份额,不管谁对谁错,Java和.Net是目前应用开发的两个 ...

  6. [转]oracle性能调优之--Oracle 10g AWR 配置

    一.ASH和AWR的故事 1.1 关于ASH 我们都知道,用户在ORACLE数据库中执行操作时,必然要创建相应的连接和会话,其中,所有当前的会话信息都保存在动态性能视图V$SESSION中,通过该视图 ...

  7. bzoj 1030 [JSOI2007]文本生成器(AC自动机+DP)

    [题目链接] http://www.lydsy.com/JudgeOnline/problem.php?id=1030 [题意] 给n个小串,随机构造一个长为m的大串,一个串合法当且仅当包含一个或多个 ...

  8. 如何使用 RDP 或 SSH 连接到 Azure 虚拟机

    使用 RDP 或 SSH 连接到 Azure 虚拟机 本文简要概述了如何使用远程桌面控制协议 (RDP) 或安全外壳(Secure Shell,SSH)客户端登录 Azure 虚拟机.它还包括要求和故 ...

  9. HW4.44

    public class Solution { public static void main(String[] args) { double randX; double randY; int hit ...

  10. HDOJ-ACM1017(JAVA)

    问题描述: 简单来说,就是 输入N,然后输入N个数据块,一个数据块包含(n,m),并计算0 < a < b < n 且 (a^2+b^2 +m)/(ab) 为整数.其中a,b只要符合 ...