开发板上的dhcp 获取ip方式
2011-01-19 16:20
239 查看
**************dhcp
开发板上使用的udhcpc udhcpd两个工具都可以从busybox里面直接编译得来
PC上使用的dhcp工具可以使用 sudo apt-get install udhcpc
sudo apt-get install udhcpd
用PC做udhcpd服务器,开发板从PC获取ip(反过来是一样的)
PC上: sudo vi /etc/udhcpd.conf
udhcpd.conf在busybox里面有一个原型: busybox-1.14.2/examples/udhcp/udhcpd.conf
修改三个地方:start/end/option dns
start 192.168.4.200 #default: 192.168.0.20
end 192.168.4.254 #default: 192.168.0.254
//分配ip的区间
#Examles
opt dns 192.168.1.2 192.168.1.10
option subnet 255.255.255.0
opt router 192.168.1.2
opt wins 192.168.1.10
option dns 192.168.4.127 # appened to above DNS servers for a total of 3
option domain local
option lease 864000
//option dns 192.168.4.127做服务器的机器的ip地址
用网线把PC和开发板连接起来。
好了之后 sudo udhcpd
开发板上运行 udhcpc 这样就可以从PC获取ip
开发板上使用的udhcpc udhcpd两个工具都可以从busybox里面直接编译得来
PC上使用的dhcp工具可以使用 sudo apt-get install udhcpc
sudo apt-get install udhcpd
用PC做udhcpd服务器,开发板从PC获取ip(反过来是一样的)
PC上: sudo vi /etc/udhcpd.conf
udhcpd.conf在busybox里面有一个原型: busybox-1.14.2/examples/udhcp/udhcpd.conf
修改三个地方:start/end/option dns
start 192.168.4.200 #default: 192.168.0.20
end 192.168.4.254 #default: 192.168.0.254
//分配ip的区间
#Examles
opt dns 192.168.1.2 192.168.1.10
option subnet 255.255.255.0
opt router 192.168.1.2
opt wins 192.168.1.10
option dns 192.168.4.127 # appened to above DNS servers for a total of 3
option domain local
option lease 864000
//option dns 192.168.4.127做服务器的机器的ip地址
用网线把PC和开发板连接起来。
好了之后 sudo udhcpd
开发板上运行 udhcpc 这样就可以从PC获取ip
相关文章推荐
- DHCP:开发板上动态获取ip的2种方法
- CentOS配置通过DHCP的方式动态获取IP
- DHCP:解析开发板上动态获取ip的2种实现方法详解
- DHCP:开发板上动态获取ip的2种方法
- DHCP:解析开发板上动态获取ip的2种实现方法详解
- shell 根据用户的要求修改ip获取方式 并修改ip以及掩码
- 不能上网诡异问题||强制linux DHCP 客户端重新获取IP (dhclient)
- 分享PHP获取客户端IP的几种不同方式
- 网速太慢 源于DHCP偶遇IP自动获取引发
- linux 下三种方式获取本机IP地址
- 获取客户端ip的方式(适用于公网与局域网)
- 通过DHCP方式实现主机地址等信息的动态获取
- 生成二维码 加密解密类 TABLE转换成实体、TABLE转换成实体集合(可转换成对象和值类型) COOKIE帮助类 数据类型转换 截取字符串 根据IP获取地点 生成随机字符 UNIX时间转换为DATETIME\DATETIME转换为UNIXTIME 是否包含中文 生成秘钥方式之一 计算某一年 某一周 的起始时间和结束时间
- 一种IP的获取方式
- Centos 7开启网卡打开DHCP自动获取IP
- OpenStack虚机dhcp失败,获取不到小网IP
- LinuxDHCP中继,DHCP服务IP自动获取
- 【实验】通过DHCP服务器来实现不同VLAN间PC的IP自动获取
- 获取本机外网IP的方式笔记