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

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
主站蜘蛛池模板: 利辛县| 齐齐哈尔市| 林州市| 富裕县| 奉化市| 依安县| 青龙| 滕州市| 田东县| 格尔木市| 图木舒克市| 如皋市| 常山县| 阿鲁科尔沁旗| 嵊州市| 广宗县| 长阳| 德令哈市| 云安县| 特克斯县| 临猗县| 合江县| 攀枝花市| 邳州市| 洞头县| 涟源市| 云和县| 荆门市| 高邮市| 察哈| 玉山县| 邹平县| 磐安县| 余江县| 宾川县| 白沙| 仁化县| 三穗县| 富川| 武平县| 横山县|