官术网_书友最值得收藏!

  • 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...

  1. Browse to Services | DHCP Server.
  2. Choose the DMZ tab.
  3. Check Enable DHCP server on DMZ interface:
  4. 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:
  5. Save the changes and the DHCP service will be started.
  6. 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.

Dynamic DNS

Enable clients to automatically register with the Dynamic DNS domain specified.

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
主站蜘蛛池模板: 龙井市| 师宗县| 沈阳市| 安国市| 莲花县| 喀喇沁旗| 灵川县| 宁化县| 宁南县| 商河县| 鲁甸县| 罗平县| 锡林郭勒盟| 温宿县| 盐边县| 新巴尔虎右旗| 唐山市| 辽阳县| 衡山县| 长乐市| 枣强县| 临猗县| 平利县| 泊头市| 定州市| 天门市| 常熟市| 台东市| 闽清县| 夹江县| 民县| 永平县| 盐山县| 通州市| 宜春市| 顺平县| 安国市| 海淀区| 贵德县| 扬中市| 巴林左旗|