buildroot系统设置静态ip,搭建dhcp服务器
1,配置静态ipnano /etc/network/interfaces默认内容不要动,加入:iface lo inet loopback#auto eth0#iface eth0 inet dhcpauto eth0iface eth0 inet staticaddress 192.168.8.123netmask 255.255.255.0gateway 192.168.8.1如果ip配置失败
·
1,配置静态ip
nano /etc/network/interfaces 默认内容不要动,加入:
iface lo inet loopback
#auto eth0
#iface eth0 inet dhcp
auto eth0
iface eth0 inet static
address 192.168.8.123
netmask 255.255.255.0
gateway 192.168.8.1
如果ip配置失败用/etc/init.d/network restart检查一下报错信息
2,配置dhcp服务器
ubuntu下:
sudo apt-get install isc-dhcp-serve
buildroot下menuconfig打开dhcp-serve这个选项
vi /etc/dhcp/dhcpd.conf
subnet 192.168.18.0 netmask 255.255.255.0 {
range 192.168.18.120 192.168.18.128;
option routers 192.168.18.2;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.18.255;
option domain-name-servers 192.168.18.1, 192.168.18.2;
}
IP地址范围为:192.168.18.120-192.168.18.128
默认网关:192.168.18.1
子网掩码:255.255.255.0
dns:192.168.18.1, 192.168.18.2
可根据需要修改上述配置文件,完成后重启服务 sudo service isc-dhcp-server restart。
更多推荐
已为社区贡献1条内容
所有评论(0)