Chapter 3. Advanced Networking
3.1 Captive Portal
Learning Objectives
- Configure VLANs
- Configure captive portal
Prerequisites:
- Setup Zones
- Some interface configuration
- Configuring VLANs on the GNS3 switch
- Knowledge of previous labs
Scenario: Now let’s push for some advanced networking configurations. Sometimes you just have to push departments into their own VLANs for organization and compliance. Say we have a guest and employee network. We want to prevent communication between the two as much as possible. We would also want to implement some sort of login to access the internet for guests, much like hotels.
![Main scenario](https://opentextbc.ca/wp-content/uploads/sites/445/2022/04/usethisone.png)
Device | Configuration |
---|---|
PaloAlto-1 | management: 192.168.0.1/24 Ethernet1/1: Trunking Ethernet1/1.10: 10.10.10.1/24 Ethernet1/1.20: 20.20.20.1/24 Ethernet1/2: DHCP |
VLAN-10 | eth0: 10.10.10.10/24 GW: 10.10.10.1 DNS: 8.8.8.8 |
VLAN-20 | eth0: 20.20.20.20/24 GW: 20.20.20.1 DNS: 8.8.8.8 |
Management | eth0: 192.168.0.2/24 |
Switchy | e0: Access mode, VLAN 10 e1: Access mode, VLAN 20 e7: dot1q, VLAN 1 |
Zone | Interface |
---|---|
VLAN10 | Ethernet1/1.10 |
VLAN20 | Ethernet1/1.20 |
Outside | Ethernet1/2 |
Configure Sub Interfaces
Under Network > Interfaces. Click on ethernet1/1.
![Ethernet 1/1 configuration](https://opentextbc.ca/wp-content/uploads/sites/445/2023/11/VLAN1.jpg)
In this window, we just want to set the interface type to layer 3.
![Set Interface type to Layer3](https://opentextbc.ca/wp-content/uploads/sites/445/2023/11/VLAN2.jpg)
Then press OK.
Now while ethernet1/1 is still selected, click on add sub interface.
![Add Sub interfaces](https://opentextbc.ca/wp-content/uploads/sites/445/2023/11/VLAN3.jpg)
We want to add 2 sub-interfaces. Here is what you should configure:
Interface | Configuration |
---|---|
Ethernet1/1.10 | Interface Name: 10 Tag: 10 Config tab: – Virtual Router: default – Security Zone: VLAN10 IPv4: – Type: Static – IP: 10.10.10.1/24 |
Ethernet1/1.20 | Interface Name: 20 Tag: 20 Config tab: – Virtual Router: default – Security Zone: VLAN20 IPv4: – Type: Static – IP: 20.20.20.1/24 |
![Verify Sub interfaces](https://opentextbc.ca/wp-content/uploads/sites/445/2023/11/VLAN4.jpg)
Semi-Advanced Security Policies
Well, it’s not really advanced, but under Policies > Security, click Add.
![Add a Security Policy](https://opentextbc.ca/wp-content/uploads/sites/445/2023/11/VLAN5.jpg)
We will be making a policy to allow VLAN10 and VLAN20 into the Outside zone. We can do this by adding multiple zones under the source zone.
![Security Policy Rule - Source Zone](https://opentextbc.ca/wp-content/uploads/sites/445/2023/11/VLAN6.jpg)
Then click OK.
Semi-Advanced NAT Policies
Still not really advanced. But under Policies > NAT, click Add.
![Add a NAT Policy](https://opentextbc.ca/wp-content/uploads/sites/445/2023/11/1-2.jpg)
We want to make a Static NAT policy for the Internet connectivity. But under the Original Packet tab, we can select multiple zones.
![Select the Source Zone in NAT Policy Rule](https://opentextbc.ca/wp-content/uploads/sites/445/2023/11/VLAN7.jpg)
Configure the rest for static NAT, then press OK.
![SNAT Translated Packet Tab](https://opentextbc.ca/wp-content/uploads/sites/445/2023/11/2-1-1.jpg)
Add a User
Under Device > Local User Database > Users. Click Add.
![Add Users](https://opentextbc.ca/wp-content/uploads/sites/445/2023/11/VLAN8.jpg)
Create any user you want with a username and password. Here is an example:
![Add an user Xav](https://opentextbc.ca/wp-content/uploads/sites/445/2023/11/2022-04-23-14-22-00-image.png)
Then click OK.
Create an Authentication Profile
Under Device > Authentication Profile, click Add.
![Add an Authentication Profile](https://opentextbc.ca/wp-content/uploads/sites/445/2023/11/VLAN9.jpg)
Under the Authentication tab, change the type to Local Database.
![Select Local Database](https://opentextbc.ca/wp-content/uploads/sites/445/2023/11/VLAN10.jpg)
Under the Advanced tab, add your user.
![Add user xav as Allow List](https://opentextbc.ca/wp-content/uploads/sites/445/2023/11/2022-04-23-14-27-00-image.png)
Then press OK.
Configure the Captive Portal
Under Device, User Identification in the Authentication Portal Settings tab, click the settings icon.
![Authentication Portal Settings](https://opentextbc.ca/wp-content/uploads/sites/445/2023/11/VLAN11.jpg)
Configure these settings:
Parameter | Value |
---|---|
Enable Authentication Portal | Tick this box |
Authentication Profile | Select the one you created |
Mode | Transparent |
![Authentication Portal Settings - Select Transparent](https://opentextbc.ca/wp-content/uploads/sites/445/2023/11/2022-04-23-14-30-11-image.png)
Then press OK.
Under Network > Zones, click on the VLAN10 zone.
![Select Vlan 10](https://opentextbc.ca/wp-content/uploads/sites/445/2023/11/VLAN12.jpg)
In this window, we just want to tick the Enable User Identification checkbox.
![Enable User Identification](https://opentextbc.ca/wp-content/uploads/sites/445/2023/11/VLAN13.jpg)
Then press OK.
Finally, under Policies > Authentication. Click Add.
![Add an authentication Policy](https://opentextbc.ca/wp-content/uploads/sites/445/2023/11/VLAN14.jpg)
Under the Source tab, add VLAN 10 in the source zone.
![Add the Source Zone](https://opentextbc.ca/wp-content/uploads/sites/445/2023/11/VLAN15.jpg)
Under the Destination tab, add Outside in Destination Zone.
![Add the Destination Zone](https://opentextbc.ca/wp-content/uploads/sites/445/2023/11/VLAN16.jpg)
Under Actions, change the Authentication Enforcement setting, change it to default-web-form.
![Select default-web-form](https://opentextbc.ca/wp-content/uploads/sites/445/2023/11/VLAN17.jpg)
Then press OK.
Test VLANs and Captive Portal
On the VLAN-20 webterm, navigate to any website. If all was right, the desired website should appear.
![Verify your configuration](https://opentextbc.ca/wp-content/uploads/sites/445/2023/11/2022-04-23-14-55-20-image.png)
On the VLAN-10 webterm, navigate to any website. If all was right, you should see a certificate error, accept this. Then you should see a login page.
![Login Page](https://opentextbc.ca/wp-content/uploads/sites/445/2023/11/2022-04-23-14-56-58-image.png)
Enter your credentials and log in. If all was successful, you should see the website appear.
![Verify your configuration](https://opentextbc.ca/wp-content/uploads/sites/445/2023/11/2022-04-23-14-57-51-image.png)