(若不使用中继代理 到这里即可一下是中继代理需要的192.168.38.x网段的配置注意预留的名字ns不能相同,下面的为ns1)
subnet 192.168.38.0 netmask 255.255.255.0 {
# --- default gateway
option routers 192.168.38.1;
option subnet-mask 255.255.255.0;
# option nis-domain "domain.org";
# option domain-name "domain.org";
# option domain-name-servers 192.168.13.220;
option time-offset -18000; # Eastern Standard Time
# option ntp-servers 192.168.1.1;
# option netbios-name-servers 192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
# option netbios-node-type 2;
range dynamic-bootp 192.168.8.120 192.168.13.167; (这里设置地址池)
range dynamic-bootp 192.168.8.169 192.168.13.254; (预留168给特定mac)
default-lease-time 21600;
max-lease-time 43200;
# we want the nameserver to appear at a fixed address
host ns1 {
next-server marvin.RedHat.com;
hardware ethernet 00:0C:29:0A:4B:EE; (为特定mac预留IP 这里为虚拟机A预留)
fixed-address 192.168.8.168;
}
}
4.重启服务测试吧
虚拟机R的两块网卡分别位于(VMnet2,VMnet3)
虚拟机S(dhcpserver)与虚拟机A(dhcp-client)位于(VMnet2)
service network restart
service dhcpd restart
虚拟机A与虚拟机B(中继代理)位于(VMnet3)
添加中继代理虚拟机B dhcrelay对dhcp服务器的解析
vi /etc/sysconfig/dhcrelay
DHCPSERVERS="192.168.8.2"
service dhcrelay start
service network restart
