In the previous article, we discussed the installation of Zentyal in two scenarios. In this article, lets consider DHCP, DNS and a captive portal set-up.
Zentyal installation creates default settings that are not suitable for a production environment. Here, we will look at how to overrun those settings and create custom settings. I will start with DNS, then discuss the steps to be taken for DHCP, followed by a captive portal.
The DNS set-up
In my previous article, we had set up a domain name, which we will now use for setting up our DNS. The steps for configuration are as follows:
1. Open the Zentyal dashboard by using the IP address configured.
2. The URL will be https://your-ip-address.
3. Enter the user ID and password.
4. In the dashboard, you will see different categories like Core, Infrastructure, Office, etc. Click DNS under Infrastructure.
5. Select Enable transparent DNS cache. With this setting, DNS will cache all the DNS requests, which will be routed through an internal DNS server. The clients have to use Zentyal as their gateway. Also enable the Firewall module by traversing to Module Status under the Core section. Click the Save changes button on the top left of the screen to save the settings and enable the service.
6. The next option is DNS forwarder. With this option, all the DNS requests that come to the server will first be searched in local cache. If not found, they will be forwarded to external forwarders. Select Add New and give your router address, and ISP-supplied gateway. VirtualBox users need to enter their DHCP gateway address. Click the Save changes button on the top left of the screen to save the settings and enable the service.
7. The next sub-category is Domains. This will list all the local domains. Click on the button under Domain IP addresses and remove your public IP from this using the Delete button under Action. Click the Save changes button on the top left of the screen to save the settings and enable the service.
8. Click on the back button of your browser and click on the button under Hostname. Then click on the button under IP address and delete your public IP from here too. This removal will prevent your public IPs from serving DNS requests from the Web. Click Save changes at the top left of the screen to save the settings and enable the service.
The DNS has almost been setup. We will now set up the DHCP server. Follow the steps below:
1. Click DHCP under Infrastructure.
2. Uncheck Enabled to stop DHCP requests on the external interface. Click Save changes at the top left of the screen to save the settings and enable the service.
3. Click Configuration of eth1 to set up DHCP.
4. Click Custom IP address and add 172.22.22.1 for the default gateway.
5. For the search domain, select Zentyal domain.
6. For the primary nameserver, select Custom and add 220.127.116.11.
7. For the secondary nameserver, add 18.104.22.168.
8. For NTP server, set Local Zentyal NTP.
9. Click the Change button to temporarily save changes.
10. Under DHCP ranges, you can see the interface IP address set as 172.22.22.1, the subnet as 172.22.22.0/24 and the available range as 172.22.22.1 172.22.22.254. To provide the IP address to clients, you need to set up the DHCP range. Click the Add new button under Ranges. Under Name enter lan; under From enter 172.22.22.2, and under To enter 172.22.22.254. Click Add, and then click the Save changes button at the top left of the screen to save the settings.
11. Then click Dynamic DNS options.
12. Select Enabled under the Dynamic DNS options and click the Change button. Click the Save changes button at the top left of the screen to save the settings.
13. In the end, click on Modules status under Core.
14. Select DHCP and click on the Save changes button at the top left of the screen to save the settings and enable the service.
Captive portal set-up
With these settings, clients will get IP addresses automatically. The next part involves setting up the captive portal. As discussed earlier, it is used to limit access to the network. Follow the steps below:
1. Click Captive portal under Gateway.
2. Select Limit Bandwidth usage.
3. Define the bandwidth quota. Enter the size in MBs.
4. Select the period for that quotafrom Day, Week and Month. Hit Change to save.
5. Click Checkbox enabled under captive interfaces and then click the Save changes button at the top left of the screen to save settings and enable the service.
With all the steps mentioned earlier, you will be able to configure and set up DNS, DHCP and captive portal on your server.
Test the configuration
To test the configuration on a client, which could be Windows or Linux, remove any IPs from the interface of the client. Connect it to the network. Wait for a few seconds. Your client will receive an IP address from the server. To check the IP address received on the client, type the following command:
on your Windows clients.
And for Linux clients, type
$ ifconfig eth0
Things you might miss
Heres a list of some of the commonly missed settings during set-up. If you missed them, you can configure them from the dashboard.
1. If you missed the IP set-up, then follow the steps below:
- Click Network under Core, then click Interfaces.
- You can now set the external interface (eth0) from here. You can also set the internal interface (eth1).
- Click Save Changes.
2. If you missed the gateway, follow the steps below:
- Click on Network under Core, then click Gateway.
- Click Add new.
- Provide the name to the gateway.
- Provide the IP address of the gateway.
- Select Default checkbox.
- Click Save Changes.
3. If you missed some of the components from the installation, follow the steps below:
- Click Software Management under Core.
- Click Zentyal components.
- Then select any component that you have missed during installation.
- In the end, click Install to install the component.
In my next tutorial I will discuss the HTTP proxy, traffic shaping, firewalls and users, and computers.