- pfSense 2 Cookbook
- Matt Williamson
- 654字
- 2021-04-09 21:16:41
Configuring the DHCP server
This recipe describes how to configure the DHCP service in pfSense. The DHCP service assigns an IP address to any client who requests one.
Getting ready
PfSense can only be configured as a DHCP server for interfaces configured with a static IP address. Using the examples in this book, that includes the LAN and DMZ interfaces but not the WAN. This example recipe will configure the DHCP server for your DMZ interface.
How to do it...
- Browse to Services | DHCP Server.
- Choose the DMZ tab.
- Check Enable DHCP server on DMZ interface:
- Choose a Range of IP addresses for DHCP clients to use. This range must be contiguous and within the Available range listed above the Range:
- Save the changes and the DHCP service will be started.
- Apply the changes, if necessary.
How it works...
A DHCP server accepts requests from clients and assigns them an available IP address.
There’s more...
A DHCP server fulfills a client request by handing out the first available IP address. This means that it’s very likely that a client will receive a different IP address with every request.
In order to ensure that a client always receives the same IP address, we can create static DHCP mapping. See the next recipe, Creating static DHCP mappings, for more information.
Deny Unknown Clients
Enabling this option ensures that only clients with static DHCP mappings will receive an IP address. DHCP requests from all other clients will be ignored.
This is different from Enable static ARP entries where unknown clients will receive an IP address, although they won’t be able to communicate with the firewall (on that interface) in anyway.
DNS Servers
Specify any DNS server to be automatically assigned to our DHCP clients. If left blank, pfSense will automatically assign DNS servers to our clients in one of the following two ways:
- If DNS Forwarder is enabled, then the IP address of the interface is used. This is because the DNS Forwarder turns the pfSense machine itself into a DNS server, so the IP of the pfSense machine (that is, the gateway, which varies by interface) is assigned to each client.
- If DNS Forwarder isn’t enabled, then the DNS Servers configured on the General Setup page are used. And of course if, Allow DNS server list to be overridden by DHCP/PPP on WAN is enabled in General Setup, then the DNS servers obtained through the WAN will be used instead.
Gateway
The interface gateway will be provided to clients by default (that is, the static IP of the interface), but can be overridden here if necessary.
Domain Name
The domain name specified in General Setup is used by default, but an alternative can be specified here.
Default Lease Time
An alternative lease time can be specified here for clients who do not request a specific expiration time. The default is 7200 seconds.
Maximum Lease Time
An alternative maximum lease time can be specified for clients that ask for a specific expiration time. The default is 86400 seconds.
Failover Peer IP
CARP-configured systems can specify a fail-over IP address here. See CARP configuration in the Configuring CARP firewall failover recipe in Chapter 6, Redundancy, Load Balancing, and Failover for more information.
Static ARP
Enabling static ARP entries will only allow clients with DHCP mappings to communicate with the firewall on this interface. Unknown clients will still receive an IP address, but all communication to the firewall will be blocked.
This is different from Deny Unknown Clients where unknown clients won’t even receive an IP address.
Additional BOOTP/DHCP Options
Enter any custom DHCP option here. Visit http://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xml for a list of options.
See also
- The Creating static DHCP mappings recipe
- The Configuring CARP firewall failover recipe in Chapter 6, Redundancy, Load Balancing, and Failover
- Sakai CLE Courseware Management
- Puppet 2.7 Cookbook
- Windows Phone 7 Silverlight Cookbook
- ADempiere 3.6 Cookbook
- 中文版Rhino 5.0完全自學(xué)教程(第3版)
- 二維計算機(jī)繪圖教程:二維CAD工程師取證全程指導(dǎo)
- WordPress Theme Design
- 中文版CorelDRAW X6基礎(chǔ)培訓(xùn)教程(第2版)
- 有趣的Flutter:從0到1構(gòu)建跨平臺App
- PowerPoint 2013從新手到高手(超值版)
- Photoshop手繪從新手到高手
- 3ds Max 印象 影視粒子特效全解析
- LaTeX論文寫作教程
- Science Teaching with Moodle 2.0
- 3ds Max-Photoshop游戲模型制作全攻略