Ubuntu10 安裝DHCP Server設定,兩張網卡eth0 eth1
eth0:192.168.66.128
eth1:192.168.137.128
將eth1設定為dhcp網段
1.安裝DHCP Server
#apt-get install dhcp3-server
2.設定將eth1網段使用DHCP
#vim /etc/default/dhcp3-server
INTERFACES="eth1"
3.設定分發IP
#vim /etc/dhcp3/dhcpd.conf
檔案裡面有分全域變數與區域變數
subnet 192.168.137.0 netmask 255.255.255.0 {
#設定Gateway
option routers 192.168.137.128;
option subnet-mask 255.255.255.0;
#設定DNS
option domain-name-servers 168.95.1.1 ,168.95.192.1;
#設定分配的IP區段
range dynamic-bootp 192.168.137.10 192.168.137.20;
default-lease-time 21600;
max-lease-time 43200;
}
設定固定MAC Address給予固定IP Address
host Server {
#要固定的MAC Address
hardware ethernet 00:12:34:qw:14:14;
#給他一個固定的IP
fixed-address 192.168.20.20;
}
4.重新啟動DHCP Server
#/etc/init.d/dhcp3-server restart
留言列表