[linux]ubuntu14.04搭建dhcp server

Installation

To install DHCP server on Ubuntu 14.04 server, enter the following command:

sudo apt-get install isc-dhcp-server -y

Configuration
1.
sudo vim /etc/default/isc-dhcp-server
   
   
[...]
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="eth1"
  
  
[...]

2.
sudo cp /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf_bk
   
   
sudo vim /etc/dhcp/dhcpd.conf
[...]
# A slightly different configuration for an internal subnet.
 subnet 192.168.1.0 netmask 255.255.255.0 {
 range 192.168.1.20 192.168.1.30;//自动分配的IP地址范围
# option domain-name-servers server.unixmen.local;//
# option domain-name "unixmen.local";
# option routers 192.168.1.1;
 option broadcast-address 192.168.1.255;
 default-lease-time 600;
 max-lease-time 7200;
 }
[...]
host passacaglia {
  hardware ethernet 00:50:C2:BD:23:97;//指定MAC地址
  filename "per_image_signed.bin";//为该MAC地址的主机定义一个boot filename.
#  server-name "toccata.fugue.com";
}
[...]


   
   

host fantasia {
  hardware ethernet 40:16:9f:f0:12:f9;//指定MAC地址
  fixed-address 10.188.6.10;//为该MAC地址分配固定IP
}
[...]


Start
service isc-dhcp-server start/restart/stop/status

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值