09-Application security

HomeSupportResource CenterConfigure & DeployConfiguration ExamplesH3C Access Controllers Configuration Examples(V7)-6W10209-Application security
02-URL Filtering Configuration Examples
Title Size Download
02-URL Filtering Configuration Examples 80.67 KB

 

H3C Access Controllers

Comware 7 URL Filtering

Configuration Examples

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Copyright © 2021 New H3C Technologies Co., Ltd. All rights reserved.

No part of this manual may be reproduced or transmitted in any form or by any means without prior written consent of New H3C Technologies Co., Ltd.

Except for the trademarks of New H3C Technologies Co., Ltd., any trademarks that may be mentioned in this document are the property of their respective owners.

The information in this document is subject to change without notice.



Introduction

The following information provides an example of configuring URL filtering.

Prerequisites

The following information applies to Comware 7-based access controllers and access points. Procedures and information in the examples might be slightly different depending on the software or hardware version of the access controllers and access points.

The configuration examples were created and verified in a lab environment, and all the devices were started with the factory default configuration. When you are working on a live network, make sure you understand the potential impact of every command on your network.

The following information is provided based on the assumption that you have basic knowledge of URL filtering and security policy.

General restrictions and guidelines

This example is supported only in E5568P01 and later.

Example: Configuring URL filtering

Network configuration

As shown in Figure 1, the switch acts as a DHCP server to assign IP addresses to the AP and client. The AP and AC establish CAPWAP tunnels in VLAN 100. The client accesses the wireless network in VLAN 200.

Configure a URL filtering policy on the AC so the AC performs the following operations:

·     Permits the client to access website http://www.sina.com on the IP network.

·     Drops and logs packets that match the Pre-Game URL category.

·     Drops and logs packets that do not match any filtering rule in the URL filtering policy.

Figure 1 Network diagram

 

Restrictions and guidelines

Use the serial ID labeled on the AP's rear panel to specify an AP.

Procedures

Configuring the AC

1.     Configure interfaces on the AC:

# Create VLAN 100 and VLAN-interface 100, and assign an IP address to the VLAN interface. The AP will obtain this IP address to establish CAPWAP tunnels with the AC.

<AC> system-view

[AC] vlan 100

[AC-vlan100] quit

[AC] interface vlan-interface 100

[AC-Vlan-interface100] ip address 192.1.1.1 24

[AC-Vlan-interface100] quit

# Create VLAN 200 and VLAN-interface 200, and assign an IP address to the VLAN interface. The client will access the wireless network in this VLAN.

[AC] vlan 200

[AC-vlan200] quit

[AC] interface vlan-interface 200

[AC-Vlan-interface200] ip address 192.2.1.1 24

[AC-Vlan-interface200] quit

# Set the link type of GigabitEthernet 1/0/1 (the interface connected to the switch) to trunk. Remove the interface from VLAN 1, allow traffic from VLAN 100 and VLAN 200 to pass through the interface, and set the PVID of the interface to 100.

[AC] interface gigabitethernet 1/0/1

[AC-GigabitEthernet1/0/1] port link-type trunk

[AC-GigabitEthernet1/0/1] undo port trunk permit vlan 1

[AC-GigabitEthernet1/0/1] port trunk permit vlan 100 200

[AC-GigabitEthernet1/0/1] port trunk pvid vlan 100

[AC-GigabitEthernet1/0/1] quit

2.     Configure a wireless service:

# Create service template 1 and enter service template view.

[AC] wlan service-template 1

# Set the SSID to service.

[AC-wlan-st-1] ssid service

# Assign the client to VLAN 200 after it comes online.

[AC-wlan-st-1] vlan 200

# Enable the service template.

[AC-wlan-st-1] service-template enable

[AC-wlan-st-1] quit

3.     Configure the AP:

# Create a manual AP named ap1, and specify the AP model.

[AC] wlan ap ap1 model WAP722S-HI

# Set the serial ID to 219801A2F98205P0031.

[AC-wlan-ap-ap1] serial-id 219801A2F98205P0031

# Enter the view of radio 1 and bind service template 1 to the radio.

[AC-wlan-ap-ap1] radio 1

[AC-wlan-ap-ap1-radio-1] service-template 1

# Enable radio 1.

[AC-wlan-ap-ap1-radio-1] radio enable

[AC-wlan-ap-ap1-radio-1] quit

# Enter the view of radio 2 and bind service template 1 to the radio.

[AC-wlan-ap-ap1] radio 2

[AC-wlan-ap-ap1-radio-2] service-template 1

# Enable radio 2.

[AC-wlan-ap-ap1-radio-2] radio enable

[AC-wlan-ap-ap1-radio-2] quit

[AC-wlan-ap-ap1] quit

4.     Configure an IP address object group named urlfilter and specify subnet 192.2.1.0/24 for the object group.

[AC] object-group ip address urlfilter

[AC-obj-grp-ip-urlfilter] network subnet 192.2.1.0 24

[AC-obj-grp-ip-urlfilter] quit

5.     Configure URL filtering:

# Create a URL category named news, set its severity level to 2000, and enter URL category view.

[AC] url-filter category news severity 2000

# Create URL filtering rule 1 to match HTTP packets that contain host name www.sina.com in the URL.

[AC-url-filter-category-news] rule 1 host text www.sina.com

[AC-url-filter-category-news] quit

# Create a URL filtering policy named urlnews and enter URL filtering policy view.

[AC] url-filter policy urlnews

# In the URL filtering policy, specify action permit for URL category news.

[AC-url-filter-policy-urlnews] category news action permit

# In the URL filtering policy, specify action drop for predefined URL category Pre-Games and enable logging for the matching packets.

[AC-url-filter-policy-urlnews] category Pre-Games action drop logging

# In the URL filtering policy, set the default actions to drop and logging.

[AC-url-filter-policy-urlnews] default-action drop logging

[AC-url-filter-policy-urlnews] quit

6.     Configure a DPI application profile:

# Create a DPI application profile named sec and enter DPI application profile view.

[AC] app-profile sec

# Apply URL filtering policy urlnews to the DPI application profile.

[AC-app-profile-sec] url-filter apply policy urlnews

[AC-app-profile-sec] quit

# Activate the URL filtering policy and rule settings.

[AC] inspect activate

7.     Apply the DPI application profile to a security policy:

# Enter IPv4 security policy view.

[AC] security-policy ip

# Create a rule named urlfilter to permit the traffic from IP addresses in IP address object group urlfilter and apply DPI application profile sec to the security policy.

[AC-security-policy-ip] rule name urlfilter

[AC-security-policy-ip-13-urlfilter] source-ip urlfilter

[AC-security-policy-ip-13-urlfilter] action pass

[AC-security-policy-ip-13-urlfilter] profile sec

[AC-security-policy-ip-13-urlfilter] quit

# Activate rule matching acceleration.

[AC-security-policy-ip] accelerate enhanced enable

[AC-security-policy-ip] quit

Configuring the switch

1.     Configure interfaces on the switch:

# Create VLAN 100 and VLAN-interface 100, and assign an IP address to the VLAN interface. The switch will use this VLAN to forward CAPWAP tunnel traffic between the AC and the AP.

<Switch> system-view

[Switch] vlan 100

[Switch-vlan100] quit

[Switch] interface vlan-interface 100

[Switch-Vlan-interface100] ip address 192.1.1.2 24

[Switch-Vlan-interface100] quit

# Create VLAN 200 and VLAN-interface 200, and assign an IP address to the VLAN interface. This VLAN will be used to forward wireless client packets.

[Switch] vlan 200

[Switch-vlan200] quit

[Switch] interface vlan-interface 200

[Switch-Vlan-interface200] ip address 192.2.1.2 24

[Switch-Vlan-interface200] quit

# Set the link type of GigabitEthernet 1/0/1 (the interface connected to the AC) to trunk. Remove the interface from VLAN 1, allow traffic from VLAN 100 and VLAN 200 to pass through the interface, and set the PVID of the interface to 100.

[Switch] interface gigabitethernet 1/0/1

[Switch-GigabitEthernet1/0/1] port link-type trunk

[Switch-GigabitEthernet1/0/1] undo port trunk permit vlan 1

[Switch-GigabitEthernet1/0/1] port trunk permit vlan 100 200

[Switch-GigabitEthernet1/0/1] port trunk pvid vlan 100

[Switch-GigabitEthernet1/0/1] quit

# Set the link type of GigabitEthernet 1/0/2 (the interface connected to the AP) to trunk. Remove the interface from VLAN 1, allow traffic from VLAN 100 to pass through the interface, and set the PVID of the interface to 100.

[Switch] interface gigabitethernet 1/0/2

[Switch-GigabitEthernet1/0/2] port link-type trunk

[Switch-GigabitEthernet1/0/2] undo port trunk permit vlan 1

[Switch-GigabitEthernet1/0/2] port trunk permit vlan 100

[Switch-GigabitEthernet1/0/2] port trunk pvid vlan 100

# Enable PoE  on GigabitEthernet 1/0/2.

[Switch-GigabitEthernet1/0/2] poe enable

[Switch-GigabitEthernet1/0/2] quit

2.     Configure DHCP settings:

# Enable DHCP.

[Switch] dhcp enable

# Create a DHCP address pool named vlan100 to assign IP addresses and other configuration parameters to clients on subnet 192.1.1.0/24.

[Switch] dhcp server ip-pool vlan100

[Switch-dhcp-pool-vlan100] network 192.1.1.0 mask 255.255.255.0

# Exclude IP addresses 192.1.1.1 and 192.1.1.2 from dynamic allocation.

[Switch-dhcp-pool-vlan100] forbidden-ip 192.1.1.1 192.1.1.2

# Specify a gateway.

[Switch-dhcp-pool-vlan100] gateway-list 192.1.1.1

[Switch-dhcp-pool-vlan100] quit

# Create a DHCP address pool named vlan200 to assign IP addresses and other configuration parameters to clients on subnet 192.2.1.0/24.

[Switch] dhcp server ip-pool vlan200

[Switch-dhcp-pool-vlan200] network 192.2.1.0 mask 255.255.255.0

# Exclude IP addresses 192.2.1.1 and 192.2.1.2 from dynamic allocation.

[Switch-dhcp-pool-vlan200] forbidden-ip 192.2.1.1 192.2.1.2

# Specify a gateway and a DNS server.

[Switch-dhcp-pool-vlan200] gateway-list 192.2.1.2

[Switch-dhcp-pool-vlan200] dns-list 192.2.1.2

[Switch-dhcp-pool-vlan200] quit

Verifying the configuration

# Verify that the client can access website http://www.sina.com on the IP network. (Details not shown.)

# Verify that the device drops and logs the client's HTTP requests to game resources. (Details not shown.)

Configuration files

·     AC:

#

vlan 100

#

vlan 200

#

object-group ip address urlfilter

 0 network subnet 192.2.1.0 255.255.255.0

#

wlan service-template 1

 ssid service

 vlan 200

 service-template enable

#

interface Vlan-interface100

 ip address 192.1.1.1 255.255.255.0

#

interface Vlan-interface200

 ip address 192.2.1.1 255.255.255.0

#

interface GigabitEthernet1/0/1

 port link-type trunk

 undo port trunk permit vlan 1

 port trunk permit vlan 100 200

 port trunk pvid vlan 100

#

url-filter policy urlnews

 default-action drop logging

 category news action permit

 category Pre-Games action drop logging

#

url-filter category news severity 2000

 rule 1 host text www.sina.com

#

app-profile sec

 url-filter apply policy urlnews

#

wlan ap ap1 model WAP722S-HI

 serial-id 219801A2F98205P00031

 radio 1

  radio enable

  service-template 1

 radio 2

  radio enable

  service-template 1

#

security-policy ip

 rule 13 name urlfilter

  action pass

  profile sec

  source-ip urlfilter

#

·     Switch:

#

 dhcp enable

#

vlan 100

#

vlan 200

#

dhcp server ip-pool vlan100

 gateway-list 192.1.1.1

 network 192.1.1.0 mask 255.255.255.0

 forbidden-ip 192.1.1.1 192.1.1.2

#

dhcp server ip-pool vlan200

 gateway-list 192.2.1.2

 network 192.2.1.0 mask 255.255.255.0

 dns-list 192.2.1.2

 forbidden-ip 192.2.1.1 192.2.1.2

#

interface Vlan-interface100

 ip address 192.1.1.2 255.255.255.0

#

interface Vlan-interface200

 ip address 192.2.1.2 255.255.255.0

#

interface GigabitEthernet1/0/1

 port link-type trunk

 undo port trunk permit vlan 1

 port trunk permit vlan 100 200

 port trunk pvid vlan 100

#

interface GigabitEthernet1/0/2

 port link-type trunk

 undo port trunk permit vlan 1

 port trunk permit vlan 100

 port trunk pvid vlan 100

 poe enable

#

Related documentation

·     Security Policy Command Reference in H3C Access Controllers Command References

·     Security Policy Configuration Guide in H3C Access Controllers Configuration Guides

·     URL Filtering Command Reference in H3C Access Controllers Command References

·     URL Filtering Configuration Guide in H3C Access Controllers Configuration Guides