安装DHCP
来自Ubuntu中文
跳到导航跳到搜索
安装DHCP
例如 假设 "eth0" 是我们的网络卡的介面 IP Address Range: 192.168.0.100 to 192.168.0.200 Subnet Mask: 255.255.255.0 DNS Servers: 202.188.0.133, 202.188.1.5 Domains: tm.net.my Gateway Address: 192.168.0.1 |
sudo apt-get install dhcp3-server sudo cp /etc/default/dhcp3-server /etc/default/dhcp3-server_backup sudo gedit /etc/default/dhcp3-server
- 搜寻这一行文字
... INTERFACES=""
- 用下面这一行取代
INTERFACES="eth0"
- 保存编辑过的文件 (范例)
sudo cp /etc/dhcp3/dhcpd.conf /etc/dhcp3/dhcpd.conf_backup sudo gedit /etc/dhcp3/dhcpd.conf
- 搜寻这一段文字
... # option definitions common to all supported networks... option domain-name "example.org"; option domain-name-servers ns1.example.org, ns2.example.org; default-lease-time 600; max-lease-time 7200; ...
- 用下面这几行取代
# option definitions common to all supported networks... #option domain-name "example.org"; #option domain-name-servers ns1.example.org, ns2.example.org; #default-lease-time 600; #max-lease-time 7200;
- 搜寻这一段文字
... # A slightly different configuration for an internal subnet. #subnet 10.5.5.0 netmask 255.255.255.224 { # range 10.5.5.26 10.5.5.30; # option domain-name-servers ns1.internal.example.org; # option domain-name "internal.example.org"; # option routers 10.5.5.1; # option broadcast-address 10.5.5.31; # default-lease-time 600; # max-lease-time 7200; #} ...
- 用下面这几行取代
# A slightly different configuration for an internal subnet. subnet 192.168.0.0 netmask 255.255.255.0 { range 192.168.0.100 192.168.0.200; option domain-name-servers 202.188.0.133, 202.188.1.5; option domain-name "tm.net.my"; option routers 192.168.0.1; option broadcast-address 192.168.0.255; default-lease-time 600; max-lease-time 7200; }
- 保存编辑过的文件 (范例)
sudo /etc/init.d/dhcp3-server restart
1