首先输入setup
去里面设置开启dhcp
然后安装dhcp-4.1.1-38.P1.el6.i686
然后进入/etc/dhcp/dhcpd.conf
如果你要跨网段分配ip地址必须要有shared-network oraclecsg
ddns-update-style interim;
ignore client-updates;
shared-network oraclecsg{
subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.1; //设置默认网段的IP地址即网关地址
option subnet-mask 255.255.255.0; //设置客户端IP地址的字网掩码
option nis-domain "oraclecsg.com";
option domain-name "company.com"; //指定DNS域名
option domain-name-servers 192.168.1.1; //为客户端指定DNS服务器地址
option time-offset -18000;
range dynamic-bootp 192.168.1.100 192.168.1.154; //动态分配的地址范围
default-lease-time 21600;
max-lease-time 43200;
host ns{ //设置物理地址,为其分配固定的IP地址
next-server marvim.redhat.com;
hardware ethernet 12:34:56:78:AB:CD;
fixed-address 207.175.42.254;
}
}
}