Linux文件系统--udhcpc动态获取ip配置
2011-10-08 22:15
387 查看
简介
系统环境:
Loongson-1B开发板(mips32指令集)、Linux3.0.0内核、Busybox1.19.2
编译环境:
Ubuntu10.04、gcc-3.4.6-2f
[*]Networking support -->
Networking support
Networking options -->
[*]Packet socket
[*]IP:kernel level autoconfiguration
[*] IP:DHCP support
[*]Network packet filtering framework(Netfilter) --> //下层子选项可不作配置
如下图:
1.2、配置Busybox,使能以下选项:
Networking Utilities
[*]udhcp server (udhcpd)
[*] dhcprelay
[*] Lease display utility (dumpleases)
[*]udhcp client (udhcpc)
[*] Verify that the offered address is free,using ARP ping
如下图:
1.3、使用Busybox下的simple.script
进入busybox目录:busybox1.19.2/example/udhcp/,拷贝文件simple.script到根文件系统的/usr/share/udhcpc/目录下,更名为default.script,再将default.script中RESOLV_CONF=”/etc/resolv.conf”更改为RESOLV_CONF=”/tmp/resolv.conf”。
(说明:由于测试使用Cramfs文件系统,etc目录不可写,运行udhcpc无法在/etc目录下创建resolv.conf文件。)
1.4、拷贝工具
重新编译安装busybox,将安装文件拷至根文件系统目录,运行udhcpc即可动态获取IP。
系统环境:
Loongson-1B开发板(mips32指令集)、Linux3.0.0内核、Busybox1.19.2
编译环境:
Ubuntu10.04、gcc-3.4.6-2f
1.配置过程
1.1、配置Linux内核使能DHCP相关选项:[*]Networking support -->
Networking support
Networking options -->
[*]Packet socket
[*]IP:kernel level autoconfiguration
[*] IP:DHCP support
[*]Network packet filtering framework(Netfilter) --> //下层子选项可不作配置
如下图:
1.2、配置Busybox,使能以下选项:
Networking Utilities
[*]udhcp server (udhcpd)
[*] dhcprelay
[*] Lease display utility (dumpleases)
[*]udhcp client (udhcpc)
[*] Verify that the offered address is free,using ARP ping
如下图:
1.3、使用Busybox下的simple.script
进入busybox目录:busybox1.19.2/example/udhcp/,拷贝文件simple.script到根文件系统的/usr/share/udhcpc/目录下,更名为default.script,再将default.script中RESOLV_CONF=”/etc/resolv.conf”更改为RESOLV_CONF=”/tmp/resolv.conf”。
(说明:由于测试使用Cramfs文件系统,etc目录不可写,运行udhcpc无法在/etc目录下创建resolv.conf文件。)
1.4、拷贝工具
重新编译安装busybox,将安装文件拷至根文件系统目录,运行udhcpc即可动态获取IP。
相关文章推荐
- Linux文件系统使用udhcpc动态获取ip配置
- udhcpc动态获取ip配置
- CentOS配置通过DHCP的方式动态获取IP
- 批处理自动配置IP(静态IP)和批处理自动获取IP(动态IP):有线、无线均可使用此脚本
- 使用配置文件动态获取WebService地址
- 用nginx转发请求tomcat 如何配置访问日志获取真实ip
- DHCP:开发板上动态获取ip的2种方法
- 在 Windows Azure 网站中配置动态 IP 地址限制
- 从配置文件中获取IP,并分段显示
- 在 Windows Azure 网站中配置动态 IP 地址限制
- 如何在CentOS中把网卡设置成动态获取IP
- 动态获取Nhibernate的ORM配置信息,实现系统历史记录功能
- springcloud结合rabbitmq动态获取配置
- fedora 11 上配置 dhcp 获取ip 问题解决
- java执行shell命令 获取ip配置信息
- netsh命令设置静态和动态获取IP
- Ubuntu 14.04用配置文件配置静态IP和动态IP
- 详解在使用CDN加速时Nginx获取用户IP的配置方法
- Linux系统下设置静态IP或自动获取动态IP的简单方法
- Linux下获取系统的IP,子网掩码,网关,MAC和配置文件的修改