This section provides an example for configuring a firewall as a DHCP client that applies to a DHCP server (carrier device) for an IPv4 address to access the Internet.
As shown in Figure Networking diagram of accessing the Internet through DHCP, the FW functions as an egress gateway and connects PCs on an intranet to the Internet. The network plan is as follows:
After the firewall obtains IPv4 addresses from the DHCP server, the DHCP server sends the default route to the DHCP client. The next hop address of the default route is the carrier's device. Therefore, no extra default route is required in this networking.
[FW] dns resolve
# dns resolve dns server unnumbered interface GigabitEthernet0/0/1 # dns proxy enable # dhcp enable # interface GigabitEthernet0/0/1 undo shutdown ip address dhcp-alloc # interface GigabitEthernet0/0/3 undo shutdown ip address 10.3.0.1 255.255.255.0 dhcp server mask 255.255.255.0 dhcp select interface dhcp server gateway-list 10.3.0.1 dhcp server dns-list 10.3.0.1 # firewall zone trust set priority 85 add interface GigabitEthernet0/0/3 # firewall zone untrust set priority 5 add interface GigabitEthernet0/0/1 # security-policy rule name sec_policy_1 source-zone trust destination-zone untrust source-address 10.3.0.0 mask 255.255.255.0 action permit rule name sec_policy_2 source-zone trust destination-zone local source-address 10.3.0.0 mask 255.255.255.0 service dns action permit rule name sec_policy_3 source-zone local destination-zone untrust service dns action permit # nat-policy rule name policy_nat_1 source-zone trust egress-interface GigabitEthernet0/0/1 source-address 10.3.0.0 24 action source-nat easy-ip # return