beaglebone-black 在Angstrom系统中的网络配置方法
Beaglebone Linux 101: Assigning a Static IP Address with Connman
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系统中的网络配置方法的更多相关文章
- 由安装两块网卡的linux系统中引起网络不通想到的
由安装两块网卡的linux系统中引起网络不通想到的 一天,小王突然急匆匆的来找我,他说:"我在机子上刚装的redhat怎么老也ping不通服务器,我网卡的驱动都安装了,ping 自己的两块网 ...
- 修改 /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 ...
- SQLServer—系统中的内存配置
前言: 本文讲述32位和64位系统中的内存配置,在SQLServer 2005/2008中,DBA们往往尝试开启AWE来限制内存.但是,在SQLServer2012以后,这个选项将被弃用,所以不能使用 ...
- 第十七章——配置SQLServer(2)——32位和64位系统中的内存配置
原文:第十七章--配置SQLServer(2)--32位和64位系统中的内存配置 前言: 本文讲述32位和64位系统中的内存配置,在SQLServer 2005/2008中,DBA们往往尝试开启AWE ...
- 双系统中ubuntu的安装方法
双系统中ubuntu的安装方法 注意:给电脑安装双系统时,一定要先装Windows系统,再安装Linux系统! 原因是电脑开机后,要先执行一段bootloader引导程序:再由引导程序启动操作系统.W ...
- L04-VirtualBox中CentOS7网络配置(可连外网)
本文所述的方法在RHEL6.5.RHEL7和CentOS6.5中同样适用. 1.工具:VirtualBox,虚拟机:CentOS7 2.VirtualBox工具中的网络配置 (1)VirtualBox ...
- win764bit系统plsqldeveloper11连接oracle11g64bit配置方法
win764bit系统plsqldeveloper11连接oracle11g64bit配置方法: 原因:plsqldeveloper都是32位的没有64位的程序 准备工作: 1,先要下载instant ...
- 使用SecureCRT连接虚拟机中Linux系统 和 虚拟机网络配置
使用SecureCRT连接步骤:1.首先打开虚拟机,点击左上角的编辑,再点击虚拟网络编辑器(已经进行虚拟网络编辑的忽略此步骤,直接进行第二步) 点击VMnet8网络,点击更改设置,此步骤需要管理员权限 ...
- 【VMware】VMware Workstation中虚拟机网络配置
一直用的vmware的虚拟机以及UVP还有cirtix的虚拟机,然后对vmware workstation却一窍不通,这个怎么了得,下面介绍一下我学习中遇到的问题及解决办法. 一.准备工作: vmwa ...
随机推荐
- S3C2410 实验三——块拷贝、字拷贝(寄存器的理解)
因为笔记做在 evernote 上,博客上就不再重新敲了. http://www.evernote.com/shard/s307/sh/5bd591a1-dbbd-4457-812a-17c08c22 ...
- 解决在IE里预览时弹出:为了有利于保护安全性......
用Dreamweaver做网页,在IE里预览时弹出这个:为了有利于保护安全性,Internet Explorer 已限制此网页运行可以访问计算机的脚本或ActiveX控件. 在页面顶部加段代码就可以了 ...
- bzoj1801
题目就是每行每列最多放两个炮的意思: 首先不难想到状态压缩dp,但是当n,m<=100的时候显然会跪掉: 考虑每行最多就2个点,状压dp浪费了大量的空间 由于每行最多两个点,我们可以直接用f[i ...
- C#常用的命名规范
C#常用的命名规则 Pascal 规则 每个单词开头的字母大写(如 TestCounter). Camel 规则 除了第一个单词外的其他单词的开头字母大写. 如. testCounter. Upper ...
- 【转】VS2010/MFC编程入门之八(对话框:创建对话框类和添加控件变量)
原文网址:http://www.jizhuomi.com/software/153.html 前两讲中鸡啄米为大家讲解了如何创建对话框资源.创建好对话框资源后要做的就是生成对话框类了.鸡啄米再声明下, ...
- htmlparser使用例子(全) 转载
1.import java.net.URL; 2. 3.import junit.framework.TestCase; 4. 5.import org.apache.log4j.Logger ...
- [译]PyUnit—Python单元测试框架(1)
1. 原文及参考资料 原文链接:http://docs.python.org/2/library/unittest.html# 参考文档: http://pyunit.sourceforge.net/ ...
- c#打印机设置,取得打印机列表及相应打印机的所有纸张格式
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...
- Mac OS X Mountain Lion安装Bochs
基本步骤可以看这个帖子 http://hi.baidu.com/any_where/item/990c0acdfbd6542c47d5c003 大体是: 1.安装x11; 2.开启Mac OS X的r ...
- [CODEVS1258]关路灯
题目描述 Description 多瑞卡得到了一份有趣而高薪的工作.每天早晨他必须关掉他所在村庄的街灯.所有的街灯都被设置在一条直路的同一侧. 多瑞卡每晚到早晨5点钟都在晚会上,然后他开始关灯.开始时 ...