本人是用VM测试的 VM提供分组功能 对于模拟局域网比较好
1。确认安装DHCP
rpm -qa |grep dhcp*
查看
确认真的安装上(碟,ISO文件上有)
2。然后
cp /usr/share/doc/dhcp-xxxxx/dhcp.conf.sample /etc/dhcpd.conf
拿到dhcp的模板
3.组建一个192.168.213.0/24的子网
vi /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
subnet 192.168.213.0 netmask 255.255.255.0 {
option routers 192.168.213.254;
option subnet-mask 255.255.255.0;
option nis-domain "domain.org";
#option domain-name "domain.org";
#option domain-name-servers 192.168.1.1;
option time-offset -18000; # Eastern Standard Time
# option ntp-servers 192.168.1.1;
# option netbios-name-servers 192.168.1.1;
# option netbios-node-type 2;
range dynamic-bootp 192.168.213.1 192.168.213.200;
default-lease-time 21600;
max-lease-time 43200;
# we want the nameserver to appear at a fixed address
host ns {
next-server marvin.redhat.com;
hardware ethernet 12:34:56:78:AB:CD;
fixed-address 192.168.1.254;
}
}
注意:很方便的ipcalc^_^
(可以使用ipcalc查询子网的相关信息
ipcalc -nmb 192.168.213.0/24
掩码NETMASK=255.255.255.0
广播BROADCAST=192.168.213.255
网络号NETWORK=192.168.213.0)
注意::
LIN客户机:vi /etc/sysconfig/network
将networking=no修改yes 开机自动加载网卡
以及vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0 网卡选择
BOOTPROTO=dhcp 设置通过dhcp获得IP
ONBOOT=yes 开机引导时自动获取ip----对于建立PXE安装有用
WIN客户机就不用说了 将连接改为自动获取就OK
阅读(783) | 评论(0) | 转发(0) |