dhcp学习记录
1)安装dhcp服务器
rpm -ivh dhcp-4.1.1-31.P1.el6.i686.rpm
2)修改eth0(网卡)文件
修改并添加部分配置
引号内必需为小写
// 修改
BOOTPROTO="static"
ONBOOT="yes"
// 添加
IPADDR=192.168.132.2
NETMASK=255.255.255.0
GATEWAY=192.168.132.3
3)配置DHCP服务器;
ddns-update-style interim;
ignore client-updates;
default-lease-time 21600;
max-lease-time 43200;
subnet 192.168.132.0 netmask 255.255.255.0 {
range 192.168.132.100 192.168.132.105;
option subnet-mask 255.255.255.0;
option domain-name "yourname.com";
option routers 192.168.132.254;
}
运行
service dhcpd start
4)客户端动态获得IP地址。
克隆出一个服务器地址
因为改动原因所以在此系统改为用了eth1网卡
这一次改动客户端eth1的配置文件
添加代码:
DEVICE=“eth1”
BOOTPROTO=“dhcp”
ONBOOT="yes"
之后就可以验证eth的网络地址了。