开发环境
开发板:A33-Vstar
开发板系统:Linux
Ubuntu版本:Ubuntu14.04
编译器:arm-linux-gnueabi-gcc
-------------------------------------------
Net-tools 包含一系列程序,构成了 Linux 网络的基础。
安装下列程序: arp, dnsdomainname (link to hostname), domainname (link to hostname), hostname, ifconfig, nameif, netstat, nisdomainname (link to hostname), plipconfig, rarp, route, slattach 和 ypdomainname (link to hostname)
- arp用来操作核心的ARP(地址解析协议)的高速缓存,通常用来增加、删除一个条目以及转储ARP高速缓存。
- dnsdomainname显示系统的DNS域名。
- domainname显示系统的 NIS/YP 域名。
- hostname用来设置或显示系统的主机名。
- ifconfig 用来配置网络接口。
- nameif基于MAC地址给网络界面命名。
- netstat可以显示网络连接、路由列表、界面状态、虚拟连接等信息。
- nisdomainname 同domainname。
- plipconfig 用来优化PLIP设备的参数以加快该设备的速度。
- rarp 和arp命令类似,处理操作系统的RARP(逆向地址解析协议)表。
- route 用来管理IP路由表。
- slattach 将某个网络接口对应为串行线,例如将一个通常的终端线添加为某种网络模。
- ypdomainname同domainname.
1. 下载net-tools-1.60
2. 解压后进入net-tools-1.60/ 目录,执行:make config进行配置
将x.25 等相关配置关闭,否则编译会报错,最终配置如下。(某些配置关闭或开启不影响编译成功)
Does your system support GNU gettext? (I18N) [n]
*
* Protocol Families.
*
UNIX protocol family (HAVE_AFUNIX) [y]
INET (TCP/IP) protocol family (HAVE_AFINET) [y]
INET6 (IPv6) protocol family (HAVE_AFINET6) [n]
Novell IPX/SPX protocol family (HAVE_AFIPX) [y]
Appletalk DDP protocol family (HAVE_AFATALK) [y]
AX25 (packet radio) protocol family (HAVE_AFAX25) [y]
NET/ROM (packet radio) protocol family (HAVE_AFNETROM) [y]
Rose (packet radio) protocol family (HAVE_AFROSE) [n]
X.25 (CCITT) protocol family (HAVE_AFX25) [n]
Econet protocol family (HAVE_AFECONET) [n]
DECnet protocol family (HAVE_AFDECnet) [n]
Ash protocol family (HAVE_AFASH) [n]
*
* Device Hardware types.
*
Ethernet (generic) support (HAVE_HWETHER) [y]
ARCnet support (HAVE_HWARC) [y]
SLIP (serial line) support (HAVE_HWSLIP) [y]
PPP (serial line) support (HAVE_HWPPP) [y]
IPIP Tunnel support (HAVE_HWTUNNEL) [y]
STRIP (Metricom radio) support (HAVE_HWSTRIP) [y]
Token ring (generic) support (HAVE_HWTR) [y]
AX25 (packet radio) support (HAVE_HWAX25) [y]
Rose (packet radio) support (HAVE_HWROSE) [n]
NET/ROM (packet radio) support (HAVE_HWNETROM) [y]
X.25 (generic) support (HAVE_HWX25) [n]
DLCI/FRAD (frame relay) support (HAVE_HWFR) [y]
SIT (IPv6-in-IPv4) support (HAVE_HWSIT) [n]
FDDI (generic) support (HAVE_HWFDDI) [n]
HIPPI (generic) support (HAVE_HWHIPPI) [n]
Ash hardware support (HAVE_HWASH) [n]
(Cisco)-HDLC/LAPB support (HAVE_HWHDLCLAPB) [n]
IrDA support (HAVE_HWIRDA) [y]
Econet hardware support (HAVE_HWEC) [n]
*
* Other Features.
*
IP Masquerading support (HAVE_FW_MASQUERADE) [n]
Build iptunnel and ipmaddr (HAVE_IP_TOOLS) [n]
Build mii-tool (HAVE_MII) [n]
3. 添加新版linux缺失的头文件
将if_tr.h和if_strip.h复制到net-tools-1.60/ 下(头文件可在LXR上下载)
4. 修改源码
1)net-tools-1.60/lib/strip.c
将#include
改为#include "if_strip.h"
2)net-tools-1.60/hostname.c
在switch的default:后加上break;
3)net-tools-1.60/lib/tr.c
将#include 改为#include "if_tr.h"
4)net-tools-1.60/lib/inet_sr.c
在switch的default:后加上break;
5)net-tools-1.60/Makefile,修改编译器
#ifeq ($(origin CC), undefined)
CC = arm-linux-gnueabi-gcc
#endif
5. 执行:make,生成的net工具会在net-tools-1.60/下,将需要的命令工具下载到开发板即可。