StoneOS-CookbookV5.5R10
StoneOS-CookbookV5.5R10
StoneOS Cookbook
Version 11
TechDocs | docs.hillstonenet.com
Copyright 2023 Hillstone Networks. All rights reserved.
Information in this document is subject to change without notice. The software described in this document is
furnished under a license agreement or nondisclosure agreement. The software may be used or copied only in
accordance with the terms of those agreements. No part of this publication may be reproduced, stored in a
retrieval system, or transmitted in any form or any means electronic or mechanical, including photocopying and
recording for any purpose other than the purchaser's personal use without the written permission of Hillstone
Networks.
Hillstone Networks
Contact Information:
US Headquarters:
Hillstone Networks
Sunnyvale, CA 94089
https://www.hillstonenet.com/about-us/contact/
About this Guide:
This guide gives you configuration instructions of Hillstone NetworksStoneOS user scenarios.
Hillstone Networks
TWNO: TW-CBK-UNI-5.5R10-EN-V11-1/11/2023
Contents
Overview
Target audience 2
StoneOS Versions 2
Reading Sequence 2
Clicking OK or Apply 3
Getting Started
Preparation 5
Preparation 9
Upgrade Steps 10
Configuration Steps 16
1
Allowing Private Network to Access Internet Using SNAT 21
Configuration Steps 22
Configuration Steps 27
Preparation 31
StoneOS 40
Zabbix: 42
Scenario 46
Configuration Steps 47
DNS Proxy 57
Scenario 57
Preparation 58
Configuration Steps 58
Q&A 61
Preparation 62
Configuration Steps 62
Device A 62
2
NETCONF Client 63
Binding the Log Processing Process and Database Storage Process to Core MAX 67
Configuration Roadmap 67
Configuration Steps 68
Routing
Configuration Steps 71
Configuration Steps 80
Configuration Steps 89
Authentication
Configuration Steps 95
Preparation 103
Preparation 113
3
Allowing Internet Access via AD Agent 125
Preparation 125
Preparation 136
VPN
Connection between Two Private Networks Using IPSec VPN (IKEv1) 145
Device A 145
Device B 151
Connection between Two Private Networks Using IPSec VPN (IKEv2) 158
Device A 158
Device B 162
Device A 168
Device B 174
Realizing Dynamic Switch between IPSec Links Using IPSec VPN Smart Link 181
Device A 181
4
Device B 184
Allowing Remote Users to Access a Private Network Using SSL VPN 194
Allowing Remote Users ( PC ) to Access a Private Network Using L2TP over IPSec VPN 222
Allowing Remote Users (iOS/Android) to Access a Private Network Using L2TP over IPSec VPN 241
Connection between Two Private Networks Using GRE over IPSec VPN 256
5
Configuring IPSec VPN 260
Allowing Remote Users ( PC ) to Access a Private Network Using L2TP and SSL VPN 275
High Availability
6
Configuration Steps 318
Making Two Firewalls Working in Hot Standby Mode by Deploying them in HA Peer to Ensure the
Continuity of Service 325
Verification 328
Using Two Devices as Gateways to Forward Business Traffic and Back Up Each Other Based on HSVRP,
which Rnsures Uniterrupted Business Traffic 330
Verification 336
Q&A 349
Threat Prevention
Protecting Internal Servers and Host to Defend Attack via Abnormal Behavior Detection 352
7
Configuration Steps 360
Preparation 375
Data Security
Preparation 382
IPv6
Realizing FTP Service in IPv6-only or IPv4/IPv6 Hybrid Networks Using ALG 399
8
Configuration Steps of Scenario 2 401
Realizing SIP Communication in IPv6-only or IPv4/IPv6 Hybrid Networks Using ALG 408
Realizing Dual-stack Host in IPv4 Network Accessing IPv6 Network Via ISATAP Tunnel 419
Change Log
Cookbook V1 438
Cookbook V2 438
9
Cookbook V3 438
Cookbook V4 439
Cookbook V5 439
Cookbook V6 439
Cookbook V7 440
Cookbook V8 440
Cookbook V9 440
10
StoneOS Cookbook
Overview
StoneOS Cookbook provides configuration examples for you to user Hillstone network security products. This books covers basic get-
ting-started cases, firewall functions, and advanced user scenarios. All configuration uses graphic user interface (GUI), or also known as
web user interface (WebUI), not command line interface.
Each recipe consists of two parts: scenario settings and configuration steps. Topology and screenshot are used to assist you in under-
standing the key information of the case.
StoneOS Cookbook is very helpful in understanding operational logic, and improving efficiency.
Overview 1
StoneOS Cookbook
Before you read the book, there are a few tips you need to know.
Target audience
Cookbook is written with new users in mind. However, if you use this book, you still are required to know how to use WebUI, connect
cables and log in the system. Such information can be found in Getting Started Guide.
StoneOS Versions
With system updates, the user interface is subject to change, and WebUI layout may vary depending on hardware platforms. This cook-
book may not comply with every detail on WebUI, please check your web pages for difference when you use this book.
Reading Sequence
When you open the book, it is better to read it in the sequence below:
3. Go through step key points (marked as "Step1", "Step2") to understand configuration logic;
4. Read the left text and right screen shots to get the details.
5. Configure your device accordingly, but substitute with your own IP address or names.
The step details are explained by combing description text and screenshots. The text on the left gives configuration details, highlights
and notes; the sceenshot on the right is the exact screen capture of this step.
In this cookbook, the chapter "Getting Started" is the prerequisite for other chapters. Other chapters deem that the protected network
has already finished its basic networking settings mentioned in the Getting Started chapter. In other chapters, steps like NAT, default
routes and DNS are not included. So, when you reference to user scenarios in chapters other than Getting Started, you should ensure
that your protected network has already been basically established.
This book explains function configuration by writing scenarios (also called "cases" or "recipes"). Interface addresses, object names, and
topologies are the real laboratory settings. When you configure your own network, substitute the names and addresses with your real
names and addresses.
Clicking OK or Apply
Generally, when you finish filling or editing an option, you must click OK, Apply, or Confirm button to make the setting take effect.
This kind of operation is universal. This book will not write specifically about this operation otherwise else is needed.
Getting Started
Getting Started 4
StoneOS Cookbook
As an exit of the company's network, security device provides protections and services. Now, admin need upgrade firmware to optim-
ize system's performance and get new functions.
Preparation
o See the system software version by using WebUI or CLI(show version) to get a suitable upgrading instructions.
o See the release notes of the target version to get a platform upgrading instructions.
o Do not upgrade at peak times, because you need to reboot device to make new version effective.
o Upgrade from CLI if your device's storage is low, and remember to remove the former firmware version before you upgrade.
o Make sure you have backed up the configuration file before upgrading.
Contact us (Service Line:1-800-889-9860) first when you are in the following situations:
o Make sure whether license is out of date. If it expires, you only can upgrade system to the version whose release date is before the
license expired date. If it doesn't expire, upgrading can be continued. Contact us for the release date.
o Do not cross upgrade. For example, to upgrade the versions 4.0 to 5.0, Hillstone recommends you to first upgrade to version 4.5,
and then upgrade to 5.0. Contact us for cross version upgrade.
Step 1: Logging in via WebUI with admin accout and viewing current system information.
Step 3: Uploading upgrade file and rebooting system. Before uploading, make sure your upgrade file is suitable for your plat-
form.
Step 1: Logging in system via Telnet, and viewing the current version.
2. Click Open.
Step 2: Upgrading your device. We upgrade with USB port in this example. Please put your upgrade file in your U-Disk, and
then put it into the USB port of security device.
The topology gives a typical user scenario for HA. In the designed scenario, one (Device A)of the HA devices will be working under
the active mode, while the other (Device B) is under the passive mode. The two devices use heartbeat cables to maintain communication
between devices. Device A and Device B need to be upgraded from StoneOS 5.5R8 to StoneOS 5.5R9.
Preparation
3. Obtained the current configurations of the two devices by WebUI or CLI(show configuration) , and back up the cur-
rent configurations.
4. Disable the preempt mode if it is enabled. You can enable the preempt mode when the upgrading is completed. If track objects
are bound to the HA group, removing the binding. You can resume the binding when the upgrading is completed.
Note: To switch over traffic, you are recommended to upgrade the devices in HA mode through the CLI.
Upgrade Steps
1. Take the device B offline by removing the service cable from device B first and then removing the HA heartbeat cable from
device B.
Device B
save
The detailed steps for device upgrade, see "Upgrading Firmware to Higher Version" on Page 5.
4. After device B reboots successfully, check whether the version of device B and its HA configuration are correct and whether
the configuration is lost.
Device B
show configuration
5. View the priority values of Device A and Device B. Make sure the priority value of device A is less than that of device B. That
is to say, device A has a higher priority than device B.
Device A
Device B
Notes: If the priority value of device A is larger than that of device B, modify the latter to make sure device A has a higher priority.
Reconnect the HA heartbeat cable on device B. Wait for device B to complete HA negotiation with device A. In this case, device A
is the master device. Then, reconnect the service cable on device B.
Device A
2. Check whether the ARP table, session information, etc. are synchronized.
Device A
show arp
Notes: After executing the show logging alarm command on master device A. When the prompt "Admin batch syn-
chronization of HA group 0 has completed." appears, it suggests that configuration synchronization is completed
3. Switch the master and backup devices by manual. In this case, device B is switched to the master device.
Take the device A offline by removing the service cable from device B first and then removing the HA heartbeat cable from device
A.
Device A
save
The detailed steps for device upgrade, see "Upgrading Firmware to Higher Version" on Page 5.
4. After device A reboots successfully, check whether the version of device A and its HA configuration are correct and whether
the configuration is lost.
Device A
show configuration
5. View the priority values of Device A and Device B. Make sure the priority value of device A is larger than that of device B.
That is to say, device A has a lower priority than device B.
Device A
Device B
Reconnect the HA heartbeat cable on device A. Wait for device A to complete HA negotiation with device B. In this case, device B
is the master device. Then, reconnect the service cable on device A
Step 4: HA Synchronization
Device B
2. Check whether the ARP table, session information, etc. are synchronized.
Device B
show arp
Notes: After executing the show logging alarm command on master device A. When the prompt "Admin batch syn-
chronization of HA group 0 has completed." appears, it suggests that configuration synchronization is completed
Device B
The scenario sets up a requirement that the private network users are not allowed to access Internet during work time. As the topology
described, polices and schedules work together to allow internal users to access to server in another zone during work hour (9 a.m. to 17
p.m.). When it's not working time, the server cannot be accessed.
Configuration Steps
o Zone: trust
o Type: Static IP
o IP Address: 192.168.1.1
o Netmask: 255.255.255.0
o Zone: dmz
o Type: Static IP
o IP Address: 10.10.1.1
o Netmask: 255.255.255.0
o Type: Daily
o Name: work
o Source
o Zone: trust
o Address: Any
o Destination
o Zone: dmz
o Address: Any
o Other Information
o Action: Permit
o Name: rest
o Source
o Zone: trust
o Address: Any
o Destination
o Zone: dmz
o Address: Any
o Other Information
o Action: Deny
o Destination: 0.0.0.0
o Subnet Mask: 0
o Gateway: 10.10.1.1
Step 5: Results
As shown in the topology, via SNAT, internal PCs use the eth0/3 (221.224.30.130/20) to visit Internet.
Configuration Steps
o Zone: trust
o Type: Static IP
o IP Address: 192.168.1.1
o Netmask: 24
o Zone: untrust
o Type: Static IP
o IP Address: 221.224.30.130
o Netmask: 20
o Name: trust_untrust
o Source Information
o Zone: trust
o Address: Any
o Destination
o Zone: untrust
o Address: Any
o Other Information
o Action: Permit
o Name: snat_IP
o Requirement:
o Translated to:
o Destination: 0.0.0.0
o Subnet Mask: 0
o Gateway: 221.224.30.1
Step 6: Results
As shown in the topology, the FTP server hides its internal IP address using DNAT rule. DNAT rule will give the server an Internet IP
address for FTP users to access. In this way, the server can be accessed from Internet.
Configuration Steps
o Zone: dmz
o Type: Static IP
o IP Address: 10.10.1.1
o Netmask: 24
o Zone: untrust
o Type: Static IP
o IP Address: 221.224.30.130
o Netmask: 20
o Name: untrust_dmz
o Source Information
o Zone: untrust
o Address: Any
o Destination
o Zone: dmz
o Address: Any
o Other Information
o Action: Permit
Select Policy > NAT > DNAT, and click New >
Advanced Configuration.
o Requirement:
o Translated to:
o Destination: 0.0.0.0
o Subnet Mask: 0
o Gateway: 221.224.30.1
Step 5: Results
In this example, a Hillstone device (T-Series Intelligent Next Generation Firewall recommended) is a network tap. Its tap interface
eth0/1 directly connects to mirror interface of inline network gateway. Hillstone T-Series threat detection features to analyze mirrored
data packets in search for network threats.
We present 4 threat detecting functions in this example. All the functions require respective licenses installed before they take effect.
o Intrusion Prevention System (IPS): Requires Threat Prevention (TP) or IPS license installed.
o Application Identification: Requires APP DB license installed. This license is issued with platform license for free. No need to pur-
chase APP DB license individually.
Preparation
As shown in the topology above, you need use a RJ-45 cable to connect the mirror port eth0/4 and the tap interface eth0/1.
Configure port mirroring on gateway of core network. We take Hillstone gateway as example.
Enabling IPS:
Step 5: Enabling Advanced Threat Detection (ATD) and viewing ATD attacks
Enabling ATD:
Step 5: Enabling Advanced Threat Detection (ATD) and viewing ATD attacks
To know more about ATD, you may refer to another case in this cookbook Finding Malware Attacks via Advanced Threat Detec-
tion.
Enabling ABD:
To know more about ABD, you may refer to another case in cookbook "Protecting Internal Servers and Host to Defend Attack
via Abnormal Behavior Detection" on Page 352.
The following shows a network environment. The device connects to Zabbix using SNMPv2 to manage the device.
StoneOS
o Type: IP Address
o Hostname: 10.1.1.1
o Community: hillstone
o Permission: RO
o Host: 10.1.1.1
o Community: hillstone
o Zone: trust
Zabbix:
groups list.
o Name: Hillstone_Interface
o SNMP OID:
.1.3.6.1.4.1.28557.2.6.1.3.1.20.36
o Host name:E1100
groups list.
Step7: Results
Scenario
As shown in the topology, one enterprise can configure Radius server authentication and enable authorization policy to dynamically man-
age the access authority of visitors. When the visitor logins the SSLVPN, the radius server issues authorization policy to the firewall
allowing the visitor to visit the network segment 10.160.64.0/21. When the visitor successfully logins, the administrator can use CoA
messages to modify the issued authorization policy, adding new network segment 10.160.32.0/21 that the visitor is allowed to visit.
When the visitor logs out, the firewall will automatically delete the responding authorization policy.
Configuration Steps
o Zone: trust
o Type: Static IP
o IP Address: 10.87.1.8
o Netmask: 255.255.255.0
o Name: Visitor
Step 3: Configure Radius Server, and Enable Authorization Policy and Accounting.
o Name: Visitor
o Port: 1812
o Secret: 12345678
o Port: 1813
o Password: 12345678
Step 3: Configure Radius Server, and Enable Authorization Policy and Accounting.
o Username: user1
o Password: 123456
o Port: 3799
o Netmast: 255.255.255.0
o DNS1: 10.160.64.60
o WINS1: 10.160.64.61
o Zone: VPN
o Zone: VPN
o Type: Static IP
o IP Address: 20.1.1.1
o Netmask: 24
4. Configure SSLVPN.
o Service Port:443
o Tunnel Interface:tunnel1
o Address Pool:pool1
o IP:10.160.64.0
o Netmask:255.255.248.0
Step 6: Results.
o Server: 10.160.64.51
o Port: 4433
o Username: user1
o Password: 123456
Step 7: Use CoA message to modify the access authority of the authorized user.
DNS Proxy
This example shows how to configure the DNS proxy function. By configuring flexible DNS proxy rules, users from different seg-
ments are assigned to different DNS servers for domain name resolution.
Scenario
A secondary ISP rents the bandwidth of telecom, netcom and other ISP to different users for Internet access. The telecom and netcom
ISP have their own DNS servers. So the secondary ISP want to assign users of different network segments to the DNS servers of cor-
responding ISP for domain name resolution through DNS proxy devices.
This example simulates the export scenario of the above secondary ISP through the following configuration. Use eth0/1 (IP:101.0.0.1)
of the device to connect to the telecom special line to access the Internet, and use eth0/2 (IP: 201.1.1.1) to connect to the netcom special
line to access the Internet. In the public network, the DNS server of telecom is DNS1:102.1.1.1, and that of netcom is DNS2:202.1.1.1.
Also, eth0/3, eth0/4 connect to the Intranet user groups. The administrator now has the following requirements:
1. The DNS request of user group 1 (network segment: 192.168.10.1 / 28) is uniformly proxy to dns1 for domain name resolution;
2. The DNS request of user group 2 (network segment: 172.168.10.1 / 24) is uniformly proxy to dns2 for domain name resolution;
3. The DNS request of intranet server (172.168.10.88) is not restricted and bypassed directly.
DNS Proxy 57
StoneOS Cookbook
Preparation
The basic interface and route configuration have been completed, and users can access the Internet normally.
Configuration Steps
Step 1:Configure a DNS proxy rules to proxy DNS requests of user group 1 to DNS1 for domain name resolution;
o Domain: any
o Action: Proxy
o DNS Server:
o IP Address: 102.1.1.1
o Egress Interface:etherent0/1
58 DNS Proxy
StoneOS Cookbook
Step 2: Configure another DNS proxy rule to uniformly proxy DNS requests of user group 2 to DNS2 for domain name res-
olution.
o Domain: any
o Action: Proxy
o DNS Server:
o IP Address: 202.1.1.1
o Egress Interface:etherent0/2
DNS Proxy 59
StoneOS Cookbook
Step 3: Configure one more DNS proxy rule to release DNS requests from the Intranet server (172.168.10.88) directly.
o Domain: any
o Action: Bypass
60 DNS Proxy
StoneOS Cookbook
Step 5:Results
After configuration, capture packets on eth0 / 1 and eth0 / 2 interfaces. The results are as follows:
o The users of 192.168.10.1/28 network segment in user group 1 can still access the Internet normally, and their DNS requests
will be sent to the DNS1 server of Telecom for domain name resolution through the device.
o The uesrs of 172.168.10.1/24 network segment in user group 2 can still access the Internet normally, and DNS requests will be
sent to the DNS2 server of Netcom for domain name resolution.
o The DNS request of the internal server 172.168.10.88 will not be proxy through the device, but will be resolved according to
the DNS server set by itself.
Q&A
o Q:What is the order and manner of matching multiple DNS proxy rules?
A:The device will query for DNS proxy rules by turns from up to down. In each rule, only if all matching conditions are met can
the matching be successful.
o Q:When multiple DNS servers are configured in a DNS proxy rule, what is the priority of preferred and bound out interface
properties?
A:When you configure multiple DNS servers, the DNS server with preferred property will be selected for domain name res-
olution. If no preferred server is specified, the system will query whether there are DNS servers that have specified the egress inter-
face.
DNS Proxy 61
StoneOS Cookbook
The topology is shown as below. Device A connects to the NETCONF client. It is required to add an SNAT rule to device A using
NETCONF.
Preparation
1. The NETCONF client software has been correctly installed on the client PC, and the client environment has been configured.
This case takes the client software netopeer2-cli as an example.
2. Device A is connected to the NETCONF client, and messages can be sent between them.
Configuration Steps
Device A
hostname(config-if-eth0/0)# exit
hostname(config)#
Step 2: Configuring the access of the administrator as NETCONF (Take the administrator hillstone as an example).
hostname(config-admin)# exit
hostname(config)#
hostname(config)#
Step 4: Enabling the NETCONF agent and the NETCONF candidate functions.
hostname(config)#
NETCONF Client
Running the client software netopeer2-cli in Linux and connecting to the device:
[root@linux1~]# netopeer2-cli
[email protected] password:
o --login: specifies the login user name which must be the same as the device administrator name.
After the above command is executed, a prompt for password will appear. Enter the password of the
administrator hillstone and press Enter.
Executing the above command to get the Yang model of the device.
Step 3: Editing the XML file which will be used to add an SNAT rule to the device.
Editing the XML file according to the Yang model obtained in step 2 and saving it as snat.xml. The con-
tents of the XML file are as follows:
-<vrouter>
<vr_name>trust-vr</vr_name>
-<snat_rule>
<rule_id>1</rule_id>
<group_id>0</group_id>
<from>192.168.2.2</from>
<from_is_ip>1</from_is_ip>
<to>Any</to>
<to_is_ip>0</to_is_ip>
<service>Any</service>
<trans_to>192.168.1.10</trans_to>
<trans_to_is_ip>1</trans_to_is_ip>
<flag>1</flag>
<log>0</log>
<enable>0</enable>
<trans_type>1</trans_type>
</snat_rule>
</vrouter>
</vr>
o --target: "running" means that the distributed configuration will immediately change the running con-
figuration of the device, which will have an impact on the current business. If you select the parameter
"candidate", the distributed configuration will remain in the configuration repository and will not have
any impact on the current business. If you want to use the candidate configuration to replace the run-
ning configuration of the device, you can first execute the "validate-- source candidate" command to
check whether the candidate configuration is valid, and then execute the "commit" command.
o --config: specifies the path and file name of the xml file. If you do not specify this parameter, the sys-
tem automatically opens an empty XML file after the command is executed, and you can edit the con-
tent in this empty document.
After configuring the above steps, you can see that the SNAT rule has been added to the device using the Show command.
ip vrouter "trust-vr"
snatrule id 1 from ip 192.168.2.2 to address-book "Any" service "Any" trans-to ip 192.168.1.10 mode
static disable
exit
hostname(config)#
Binding the Log Processing Process and Database Storage Process to Core
MAX
This example introduces how to bind the log processing process and database storage process to Core MAX. Core MAX is the CPU
core with the largest number. For example, if the system has 12 CPU cores in total, which are numbered as Core0 to Core11, Core11 is
the Core MAX. The example including the following two scenarios:
o Scenario 1: A Hillstone security device is deployed on an enterprise network. Operation and maintenance personnel periodically
check the session logs and NAT logs stored in the database. The system's log processing process (LOGD) and database storage pro-
cess (MYSQLD) work on Core0 of the CPU. When session logs and NAT logs are exported to the local disk, Core0 can be over-
loaded with a large amount of high speed log data storage operations, potentially affecting the normal operation of other functional
modules.
o Scenario 2: A Hillstone security device is deployed on an enterprise network. Operation and maintenance personnel need to peri-
odically check traffic and session monitoring statistics. The device supports the storage of statistics on device traffic and sessions
over the last 180 days to the device disk. The system's database storage process (MYSQLD) work on Core0 of the CPU. Core0 can
be overloaded with a large amount of high speed traffic and session data storage operations, potentially affecting the normal oper-
ation of other functional modules.
Based on the above scenarios, if the performance consumption of Core0 is too high or you need to increase the speed at which logs are
sent to the log processing process, you can move log processing process and database storage process from Core0 to Core MAX, and
then configure the speed at which logs are sent to the log processing process.
Configuration Roadmap
1. Use the command flow-core-num number to specify the number of CPU cores occupied by the system data. number is
recommended to be max_core_number-1. max_core_number is the number of total CPU cores of the system.
2. Bind the log processing process and database storage process to Core MAX.
3. Restart the device to make the configurations in Step 1 and Step 2 take effect.
4. For scenario 1, you can increase the the speed at which logs are sent to the log processing process.
Before binding the log processing process and database storage process to Core MAX, prepare the following first:
1. The NETCONF client software has been correctly installed on the client PC, and the client environment has been configured.
This case takes the client software netopeer2-cli as an example.
2. Device A is connected to the NETCONF client, and messages can be sent between them.
o Scenario 1: The session logs and NAT logs have been stored in the device disk with the command.
o Scenario 2: The device has enabled the Long-term Monitor function for traffic and sessions.
o The function of binding the log processing process and database storage process to Core MAX is only supported by SG-6000-
A2700 and later models. SG-6000-A3000 with a hard disk is used as an example to describe the configuration.
Configuration Steps
Step 1: Specifying the number of CPU cores occupied by the system data.
hostname(config)# flow-core-num 3
hostname(config)# exit
Step 2: Binding the log processing process and database storage process to Core MAX, and restarting the for the above con-
figuration to take effect.
hostname(config)# exit
hostname# reboot
Step 3: For scenario 1, adjusting the speed at which logs are sent to log processing process. The default sending speed of SG-6000-
A3000 is 2000 logs per second.
After configuring the above steps, you can see that the CPU utilization of Core 0 is decreasing and that of Core MAX is increasing by
using the command show cpu detail.
Routing
Routing 70
StoneOS Cookbook
In the topology below, the multicast source sends data to the multicast group, and the multicast address is 225.0.0.1. The receivers PC1
and PC2 send IGMPv2 Report to join the multicast group, and the PIM domain adopts the PIM-SM mode. Assume that Device A is
the candidate RP and candidate BSR, the interface loopback1 is the interface for electing the RP, and the interface eth0/1 is the mul-
ticast data inbound interface. By configuring the PIM-SM function on each device in the PIM domain, multicast data can be forwarded
to the recipient PC in a normal multicast manner.
Configuration Steps
Step 1: Configure the IP address and unicast routing protocol of each device interface (OSPF is used in this example).
Device A:
hostname(config-if-eth0/1)# exit
hostname(config-if-eth0/1)# exit
Device B:
hostname(config-if-eth0/1)# exit
hostname(config-if-eth0/1)# exit
Device C:
hostname(config-if-eth0/1)# exit
hostname(config-if-eth0/1)# exit
Device A:
hostname(config-vrouter)# ip multicast-routing
hostname(config-vrouter)# exit
hostname(config)#
Device B:
hostname(config-vrouter)# ip multicast-routing
hostname(config-vrouter)# exit
hostname(config)#
Device C:
hostname(config-vrouter)# ip multicast-routing
hostname(config-vrouter)# exit
hostname(config)#
Device A:
hostname(config-vrouter))# exit
hostname(config)#interface ethernet0/1
hostname(config-if-eth0/1)# exit
hostname(config)#interface ethernet0/2
Device B:
hostname(config-vrouter))# exit
hostname(config)#interface ethernet0/1
hostname(config-if-eth0/1)# exit
hostname(config)#interface ethernet0/2
Device C:
hostname(config-vrouter))# exit
hostname(config)#interface ethernet0/1
hostname(config-if-eth0/1)# exit
hostname(config)#interface ethernet0/2
Device A:
hostname(config-if-loo1))# exit
hostname(config-vrouter))# exit
hostname(config)#
Device A:
=========================================================-
=====================
=========================================================-
=====================
=========================================================-
=====================
=========================================================-
=====================
=========================================================-
=====================
BSR Priority: 0
=========================================================-
=====================
In the topology below, the multicast source sends data to the multicast group, and the multicast address is 232.0.0.1. Receivers PC1 and
PC2 send IGMPv3 Report to join the multicast group. The PIM domain adopts the PIM-SSM mode. The relationship between the host
and the devices in the PIM domain is maintained through IGMPv3, so that the members of the multicast group can quickly join, directly
at the multicast source SPT (Shortest Path Tree) is established with the recipient PC. Assume that the interface eth0/1 of Device A is
used as the inbound interface for multicast data. By configuring the PIM-SSM function on each device in the PIM domain, multicast
data can be multicast forwarded to the recipient PC normally.
Configuration Steps
Step 1: Configure the IP address and unicast routing protocol of each device interface (OSPF is used in this example).
Device A:
hostname(config-if-eth0/1)# exit
hostname(config-if-eth0/1)# exit
Device B:
hostname(config-if-eth0/1)# exit
hostname(config-if-eth0/1)# exit
Device C:
hostname(config-if-eth0/1)# exit
hostname(config-if-eth0/1)# exit
Device A:
hostname(config-vrouter)# ip multicast-routing
hostname(config-vrouter)# exit
hostname(config)#
Device B:
hostname(config-vrouter)# ip multicast-routing
hostname(config-vrouter)# exit
hostname(config)#
Device C:
hostname(config-vrouter)# ip multicast-routing
hostname(config-vrouter)# exit
hostname(config)#
Device A:
hostname(config-vrouter))# exit
hostname(config)#interface ethernet0/1
hostname(config-if-eth0/1)# exit
hostname(config)#interface ethernet0/2
Device B:
hostname(config-vrouter))# exit
hostname(config)#interface ethernet0/1
hostname(config-if-eth0/1)# exit
hostname(config)#interface ethernet0/2
Device C:
hostname(config-vrouter))# exit
hostname(config)#interface ethernet0/1
hostname(config-if-eth0/1)# exit
hostname(config)#interface ethernet0/2
Device A:
=========================================================-
=====================
=========================================================-
=====================
In the initial network as topology below, the multicast source sends data to the multicast group, and the multicast address is 232.0.0.1.
Receivers PC1 and PC2 send IGMPv3 Report to join the multicast group. The PIM domain adopts the PIM-SSM mode. The rela-
tionship between the host and the devices in the PIM domain is maintained through IGMPv3, so that the members of the multicast
group can quickly join, directly at the multicast source SPT (Shortest Path Tree) is established with the recipient PC. Assume that the
interface eth0/1 of Device A is used as the inbound interface for multicast data. By configuring the PIM-SSM function on each device
in the PIM domain, multicast data can be multicast forwarded to the recipient PC normally. For details, see Realizing Multicast For-
warding Through PIM-SSM Multicast Protocol .
In this example, Device A , Device B and Device C in the PIM domain are deployed in HA AP mode. After deployment, Device A ,
Device B and Device C are elected as as the master devices, and Device Aa , Device Bb and Device Cc are elected as backup devices.
Meanwhile, the multicast route generated in the master device Device A(Device B or Device C) will be quickly synchronized to the
backup device with a temporary status of Y; When the master device Device A (Device B or Device C) fails or cannot forward traffic
normally, the backup device Device Aa (Device Bb or Device Cc) will switch as the master device. At this time, the multicast route in Y
state will be based on to forward multicast traffic without affecting the original normal communication. AfterDevice Aa receives the
IGMPv3 report messages, The status in the multicast routing table will be updated to the normal status V.
Configuration Steps
Step 1: Configure the PIM-SSM multicast protocol according to the example Realizing Multicast Forwarding Through PIM-SSM
Multicast Protocol .
Step 2: Configure the Device A and Device Aa as HA AP mode and HA negotiate successfully.
Device A
hostname(config-trackip)# exit
hostname(config)# ha group 0
hostname(config-ha-group)# priority 50
hostname(config-ha-group)# exit
hostname(config)# ha cluster 1
Device Aa
hostname(config)# ha group 0
hostname(config-ha-group)# exit
hostname(config)#
hostname(config)# ha cluster 1
Step 3: Configure management IP addresses for the two devices and monitor objects on the standby Device after HA negotiation
between Device A and Device Aa is successful .
Device A:
Device Aa:
hostname(config-if-eth0/1)# exit
hostname(config)# ha group 0
hostname(config-ha-group)# exit
hostname(config)#
Step 4:Results
Device Aa
ip vrouter "mgt-vr"
exit
ip vrouter "trust-vr"
ip multicast-routing
router-id 1.1.1.1
exit
router pim
pim-sm enable
pim-ssm default
exit
exit
2. The stutas of multicast routing table is V. On the back device, the multicast routing table is synchronized and its status is Y.
Device A:
================================================================-
==============
================================================================-
==============
Device Aa:
================================================================-
==============
================================================================-
==============
3.Restart Device A (or change eth0 / 1 and eth0 / 2 of Device A to shutdown). At this time, the backup device Device Aa will quickly
switch to the master device, and the multicast route in Y state can forward multicast traffic without affecting the original com-
munication; After Device Aa receives the IGMPv3 report message, the status in the multicast routing table will be updated to V, and
the multicast traffic will continue to be forwarded later. The status is shown as follows:
Device Aa:
================================================================-
==============
================================================================-
==============
Step 5: You can deploy device B and device C to the HA AP mode as required according to the above steps.
Authentication
Authentication is a method of verifying visitor's identity. When a visitor is confirmed as a valid user, he is allowed to use a certain net-
work. The visitor can be a PC, a mobile phone or a tablet.
Authentication 94
StoneOS Cookbook
The topology describes the scenarios of the case. In this scenario, only user 1 passes the authentication, and then accesses the Internet;
while other users fail to pass the authentication, and they are not allowed to access the Internet.
Configuration Steps
o Name: user1
o Password: 123456
o Name: addr
o Type: IPv4
o Zone: trust
o IP Configuration
o Type: Static IP
o IP Address: 192.168.1.1
o Netmask: 255.255.255.0
o WebAuth
o Zone: untrust
o IP Configuration
o Type: Static IP
o IP Address: 221.224.30.130
o Netmask: 20
o Protocol: HTTP
o Port: 8181
o Authentication Mode:
o Type: Password
o Name: DNS
o Service: DNS
o Action: Permit
o Name: Web-auth
o WebAuth: local
o Name: user
o Action: Permit
o Content: CA Certificate
o Action: Export
The following shows a network environment. An enterprise sets up a Hillstone security device as the export gateway to connect internal
network with the Internet. Only the staffs in R&D department join in the AD domain (scep.pki.com), while the staffs in marketing
department are excluded. The security device enables Web authentication. All the staffs of the enterprise are allowed to access the Inter-
net only after they pass the authentication. After the AD Polling being configured, there will be login logs when staff in R&D depart-
ment login though the AD server (Log in the PC which is added into the AD domain through domain user name and password). The
device can check the logs through AD Polling, as well as obtain authentication users information on the AD server. With this inform-
ation, staff of R&D department can access the Internet directly without Web authentication.
Preparation
o The AD server has been set up according to the user network environment.
o To enable WMI to probe the PC where the AD server is located and the terminal PCs, the PC should open the RPC service and
remote management. To enable the RPC service, you need to enter the Control Panel > Administrative Tools > Services and open
the Remote Procedure Call and Remote Procedure Call Locator; to enable the remote management, you need to run the command
prompt window (cmd) as administrator and enter the command netsh firewall set service RemoteAdmin
o To enable WMI to probe the PC where the AD server is located and the terminal PCs, the PC should permit WMI function to pass
through Windows firewall. Select Control Panel >System and Security> Windows Firewall >Allow an APP through Windows
Firewall, in the Allowed apps and features list, click the corresponding check box of Domain for Windows Management Instru-
mentation (WMI) function.
o The security device should be configured with related policy to protect the AD server, which may result in the port used by WMI
service (port 135 and random port) being restricted by policy. Therefore, it’s necessary to configure another policy ( the source IP
is the IP address of ethernet0/3) allows all interface traffic to pass through.
o The rule has been configured on the security device that all the staff of the enterprise should pass the Web authentication before
they access the Internet. For the detailed configuration method, please see "Allowing the Internet Access via User Authentication"
on Page 95.
Configuration Steps
o Password: Hillstone123456
o Domain: scep.pki.com
o Password: Hillstone123456
o Base-dn: dc=scep,dc=pki,dc=com
o Login-dn: cn=test,cn=users,dc=scep,dc=pki,dc=com
o sAMAccountName: test
o Password: Hillstone123456
o Name: ad-polling
o Host: 10.180.201.8
o Account: scep\test
o Password: Hillstone123456
The following shows a network environment. An enterprise sets up a Hillstone security device as the export gateway to connect internal
network with the Internet. All the staff in R&D department and marketing department join in the AD domain (scep.pki.com). After the
AD Polling being configured, there will be login logs when staffs login though the AD server (Log in the PC which is added into the
AD domain through domain user name and password). System can check the logs through AD Polling, as well as obtain authentication
users information (user name and IP) on the AD server. With the user-based security policy, only the R&D manager can access the
Internet, while other staffs of the R&D department cannot access the Internet, and the staff of the marketing department can access
the Web service based on HTTP or HTTPS.
Preparation
o The AD server has been set up according to the user network environment.
o To enable WMI to probe the PC where the AD server is located and the terminal PCs, the PC should open the RPC service and
remote management. To enable the RPC service, you need to enter the Control Panel > Administrative Tools > Services and open
the Remote Procedure Call and Remote Procedure Call Locator; to enable the remote management, you need to run the command
prompt window (cmd) as administrator and enter the command netsh firewall set service RemoteAdmin
o To enable WMI to probe the PC where the AD server is located and the terminal PCs, the PC should permit WMI function to pass
through Windows firewall. Select Control Panel >System and Security > Windows Firewall >Allow an APP through Windows
Firewall, in the Allowed apps and features list, click the corresponding check box of Domain for Windows Management Instru-
mentation (WMI) function.
o The security device should be configured with related policy to protect the AD server, which may result in the port used by WMI
service (port 135 and random port) being restricted by policy. Therefore, it’s necessary to configure another policy ( the source IP
is the IP address of ethernet0/3) allows all interface traffic to pass through.
o The rule has been configured on the security device that all the staff of the enterprise should pass the Web authentication before
they access the Internet. For the detailed configuration method, please see "Allowing the Internet Access via User Authentication"
on Page 95.
Configuration Steps
o Password: Hillstone123456
o Domain: scep.pki.com
o Password: Hillstone123456
o Base-dn: dc=scep,dc=pki,dc=com
o Login-dn: cn=test,c-
cn=users,dc=scep,dc=pki,dc=com
o sAMAccountName: test
o Password: Hillstone123456
o Name: ad-polling
o Host: 10.180.201.8
o Account: scep\test
o Password: Hillstone123456
o Name: manager
o Source
o Zone: trust
o Address: any
o Destination
o Zone: untrust
o Address: any
o Other Information
o Action: Permit
o Name: market
o Source
o Zone: trust
o Address: any
o Destination
o Zone: untrust
o Address: any
o Other Information
o Action: Permit
The following shows a network environment. An enterprise sets up a Hillstone security device as the export gateway to connect internal
network with the Internet. All the staff in the R&D department and marketing department join in the AD domain (scep.pki.com). After
the AD Agent being configured, there will be login information when staffs login though the AD server (Log in the PC which is added
into the AD domain through domain user name and password). The AD Security Agent will send the authentication users information (
user name and IP) to system. With the user-based security policy, only the R&D manager can access the Internet, while other staffs of
the R&D department cannot access the Internet, and the staff of the marketing department can access the Web service based on HTTP
or HTTPS.
Preparation
o The AD server has been set up according to the user network environment.
o To enable WMI to probe the PC where the AD server is located and the terminal PCs, the PC should open the RPC service and
remote management. To enable the RPC service, you need to enter the Control Panel > Administrative Tools > Services and open
the Remote Procedure Call and Remote Procedure Call Locator; to enable the remote management, you need to run the command
prompt window (cmd) as administrator and enter the command netsh firewall set service RemoteAdmin
o To enable WMI to probe the PC where the AD server is located and the terminal PCs, the PC should permit WMI function to pass
through Windows firewall. Select Control Panel >System and Security > Windows Firewall >Allow an APP through Windows
Firewall, in the Allowed apps and features list, click the corresponding check box of Domain for Windows Management Instru-
mentation (WMI) function.
o The security device should be configured with related policy to protect the AD server, which may result in the port used by WMI
service (port 135 and random port) being restricted by policy. Therefore, it’s necessary to configure another policy ( the source IP
is the IP address of ethernet0/3) allows all interface traffic to pass through.
o The rule has been configured on the security device that all the staff of the enterprise should pass the Web authentication before
they access the Internet. For the detailed configuration method, please see "Allowing the Internet Access via User Authentication"
on Page 95.
Configuration Steps
o Password: Hillstone123456
o Domain: scep.pki.com
o Password: Hillstone123456
1. Click http://swup-
date.hillstonenet.com:1337/sslvpn/download?os=windows-
adagent to download an AD Security Agent installation program,
and copy it to the AD server.
o Password: Hillstone123456
o Base-dn: dc=scep,dc=pki,dc=com
o Login-dn: cn=test,c-
cn=users,dc=scep,dc=pki,dc=com
o sAMAccountName: test
o Password: Hillstone123456
o Name: manager
o Source
o Zone: trust
o Address: any
o Destination
o Zone: untrust
o Address: any
o Other Information
o Action: Permit
o Name: market
o Source
o Zone: trust
o Address: any
o Destination
o Zone: untrust
o Address: any
o Other Information
o Action: Permit
The following shows a network environment. An enterprise sets up a Hillstone security device as the export gateway to connect internal
network with the Internet. Internal users connect to a Windows server through thin clients. After the TS Agent is configured, when
users log in the Windows server using remote desktop services, the Hillstone Terminal Service Agent will allocate port ranges to users
and send the port ranges and users information to the system. At the same time, the system will create the mappings of traffic IPs, port
ranges and users. With the user-based security policy, only user 1 can access the Internet, while user 2 cannot access the Internet, and
user 3 can access the Web service based on HTTP or HTTPS.
Preparation
o The Windows server has been set up according to the user network environment. Windows Server 2008 R2, Windows Server
2016, and Windows Server 2019 are currently supported. Windows Server 2008 R2 Service Pack 1 and KB3033929 must be
installed if Windows Server 2008 R2 is used.
o The SNAT rule has been configured on the security device, and all the internal users can access the Internet. For the detailed con-
figuration method, please see "Allowing Private Network to Access Internet Using SNAT" on Page 21.
Configuration Steps
Step 1: Installing and configuring Hillstone Terminal Service Agent in Windows server.
2. Double-click HSTSAgent.exe to open it and follow the installation wizard to install it.
3. Double-click the Hillstone Terminal Service Agent shortcut, and the Hillstone Terminal Service Agent dia-
log pops up.
Step 1: Installing and configuring Hillstone Terminal Service Agent in Windows server.
WebUI
o Name: tsagent1
o HOST: 10.1.1.1
o Port: 5019
CLI
host-name(config-ts-agent)# enable
host-name(config-ts-agent)# exit
WebUI
o Name: DNS
o Source
o Zone: any
o Address: any
o Destination
o Zone: any
o Address: any
o Service: DNS
o Action: Permit
o Name: User1
o Source
o Zone: trust
o Address: any
o User: user1
o Destination
o Zone: untrust
o Address: any
o Action: Permit
o Name: User3
o Source
o Zone: trust
o Address: any
o User: user3
o Destination
o Zone: untrust
o Address: any
o Action: Permit
CLI
host-name(config)# rule name DNS from any to any service DNS permit
Rule id 2 is created.
host-name(config)# rule name User1 user local user1 from any to any from-
zone trust to-zone untrust permit
Rule id 3 is created.
host-name(config)# rule name User3 user local user3 from any to any from-
zone trust to-zone untrust service HTTP permit
Rule id 4 is created.
host-name(config)# rule id 4
host-name(config-policy-rule)# exit
After all the above configurations are finished, only user 1 can access the Internet, while user 2 cannot access the Internet, and user
3 can access the Web service based on HTTP or HTTPS.
VPN
o IPSec VPN
o "Connection between Two Private Networks Using IPSec VPN (IKEv1)" on Page 145
o "Connection between Two Private Networks Using IPSec VPN (IKEv2)" on Page 158
o "Realizing Dynamic Switch between IPSec Links Using IPSec VPN Smart Link" on Page 181
o SSL VPN
o "Allowing Remote Users to Access a Private Network Using SSL VPN" on Page 194
o "Allowing Remote Users ( PC ) to Access a Private Network Using L2TP over IPSec VPN" on Page 222
o "Allowing Remote Users (iOS/Android) to Access a Private Network Using L2TP over IPSec VPN" on Page 241
o "Connection between Two Private Networks Using GRE over IPSec VPN" on Page 256
o VXLAN
VPN 144
StoneOS Cookbook
* Note: This topology uses laboratory environment. In this recipe, 10.10.1.0/24 represents public network.
Configuration Steps
Device A
o Zone: trust
o Type: Static IP
o IP Address: 192.168.1.1
o Netmask: 255.255.255.0
Connection between Two Private Networks Using IPSec VPN (IKEv1) 145
StoneOS Cookbook
o Zone: untrust
o Type: Static IP
o IP Address: 10.10.1.1
o Netmask: 255.255.255.0
146 Connection between Two Private Networks Using IPSec VPN (IKEv1)
StoneOS Cookbook
o Name: trust_untrust
o Source Information
o Zone: trust
o Address: Any
o Destination
o Zone: untrust
o Address: Any
o Other Information
o Action: Permit
Connection between Two Private Networks Using IPSec VPN (IKEv1) 147
StoneOS Cookbook
o Name: untrust_trust
o Source Information
o Zone: untrust
o Address: Any
o Destination
o Zone: trust
o Address: Any
o Other Information
o Action: Permit
o Authentication: Pre-share
o Hash: SHA
o Encryption: 3DES
148 Connection between Two Private Networks Using IPSec VPN (IKEv1)
StoneOS Cookbook
o Authentication: ESP
o Hash: SHA
o Encryption: 3DES
o Name: Headquarter_to_Branch
o Interface: ethernet0/2
o Mode: Main
o Type: Static IP
o Proposal 1: Headquarter_to_Branch_P1
Connection between Two Private Networks Using IPSec VPN (IKEv1) 149
StoneOS Cookbook
o Mode: tunnel
o P2 Proposal: Headquarter_to_Branch_P2
o Basic
o Name: 1
o Zone: untrust
o Tunnel Binding
150 Connection between Two Private Networks Using IPSec VPN (IKEv1)
StoneOS Cookbook
o Destination: 192.168.2.0
o Subnet Mask: 24
o Interface: tunnel1
Device B
o Zone: trust
o Type: Static IP
o IP Address: 192.168.2.1
o Netmask: 255.255.255.0
Connection between Two Private Networks Using IPSec VPN (IKEv1) 151
StoneOS Cookbook
o Zone: untrust
o Type: Static IP
o IP Address: 10.10.1.2
o Netmask: 255.255.255.0
152 Connection between Two Private Networks Using IPSec VPN (IKEv1)
StoneOS Cookbook
o Name: trust_untrust
o Source Information
o Zone: trust
o Address: Any
o Destination
o Zone: untrust
o Address: Any
o Other Information
o Action: Permit
Connection between Two Private Networks Using IPSec VPN (IKEv1) 153
StoneOS Cookbook
o Name: untrust_trust
o Source Information
o Zone: untrust
o Address: Any
o Destination
o Zone: trust
o Address: Any
o Other Information
o Action: Permit
o Authentication: Pre-share
o Hash: SHA
o Encryption: 3DES
154 Connection between Two Private Networks Using IPSec VPN (IKEv1)
StoneOS Cookbook
o Authentication: ESP
o Hash: SHA
o Encryption: 3DES
o Name: Branch_to_Headquarter
o Interface: ethernet0/2
o Mode: Main
o Type: Static IP
o Proposal 1:Branch_to_Headquarter_P1
Connection between Two Private Networks Using IPSec VPN (IKEv1) 155
StoneOS Cookbook
o Mode: tunnel
o P2 Proposal: Branch_to_Headquarter_P2
o Basic
o Name: 1
o Zone: untrust
o Tunnel Binding
156 Connection between Two Private Networks Using IPSec VPN (IKEv1)
StoneOS Cookbook
o Destination: 192.168.1.0
o Subnet Mask: 24
o Interface: tunnel1
Step 6: Results
Connection between Two Private Networks Using IPSec VPN (IKEv1) 157
StoneOS Cookbook
* Note: This topology uses laboratory environment. In this recipe, 10.10.1.0/24 represents public network.
Configuration Steps
Device A
hostname(config-if-eth0/1)# exit
hostname(config-if-eth0/2)# exit
Connection between Two Private Networks Using IPSec VPN (IKEv2) 158
StoneOS Cookbook
159 Connection between Two Private Networks Using IPSec VPN (IKEv2)
StoneOS Cookbook
hostname(config-ikev2-proposal)# group 2
hostname(config-ikev2-proposal)# exit
hostname(config-ikev2-ipsec-proposal)#protocol esp
hostname(config-ikev2-ipsec-proposal)#hash sha
hostname(config-ikev2-ipsec-proposal)#encryption 3des
hostname(config-ikev2-ipsec-proposal)#exit
hostname(config-ikev2-peer)# ikev2-profile 1
Connection between Two Private Networks Using IPSec VPN (IKEv2) 160
StoneOS Cookbook
hostname(config-ikev2-profile)# exit
hostname(config-ikev2-peer)# exit
hostname(config)#
Name: Headquarters_to_Branch_P1
Encryption: 3des
PRF: sha
Hash: sha
Group: 2
Lifetime: 86400
Name: Headquarters_to_Branch_P2
Protocol: esp
Encryption: 3des
Hash: sha
Group: 0
Lifetime: 28800
Lifesize: 0
161 Connection between Two Private Networks Using IPSec VPN (IKEv2)
StoneOS Cookbook
hostname(config-ikev2-tunnel)# exit
hostname(config)#
Step 5 : Binding the tunnel interface to the IPsec VPN IKEv2 tunnel
hostname(config-if-tun1)# exit
hostname(config)#
hostname(config-vrouter)# exit
Device B
Connection between Two Private Networks Using IPSec VPN (IKEv2) 162
StoneOS Cookbook
hostname(config-if-eth0/1)# exit
hostname(config-if-eth0/2)# exit
163 Connection between Two Private Networks Using IPSec VPN (IKEv2)
StoneOS Cookbook
hostname(config-ikev2-proposal)# group 2
hostname(config-ikev2-proposal)# exit
hostname(config-ikev2-ipsec-proposal)#protocol esp
hostname(config-ikev2-ipsec-proposal)#hash sha
hostname(config-ikev2-ipsec-proposal)#encryption 3des
hostname(config-ikev2-ipsec-proposal)#exit
hostname(config-ikev2-peer)# ikev2-profile 1
Connection between Two Private Networks Using IPSec VPN (IKEv2) 164
StoneOS Cookbook
hostname(config-ikev2-profile)# exit
hostname(config-ikev2-peer)# exit
hostname(config)#
Name: Branch_to_Headquarters_P1
Encryption: 3des
PRF: sha
Hash: sha
Group: 2
Lifetime: 86400
Name: Branch_to_Headquarters_P2
Protocol: esp
Encryption: 3des
Hash: sha
Group: 0
Lifetime: 28800
Lifesize: 0
165 Connection between Two Private Networks Using IPSec VPN (IKEv2)
StoneOS Cookbook
hostname(config-ikev2-tunnel)# auto-connect
hostname(config-ikev2-tunnel)# exit
Step 5 : Binding the tunnel interface to the IPsec VPN IKEv2 tunnel.
hostname(config-if-tun1)# exit
hostname(config-vrouter)# exit
hostname(config)#
Step 7: Results
1.With the command show ikev2 ike-sa, you can see that the first phase of IPsec VPN has been successfully established.
Connection between Two Private Networks Using IPSec VPN (IKEv2) 166
StoneOS Cookbook
Total: 1
L-time - Lifetime
============================================================================-
====
----------------------------------------------------------------------------
----
============================================================================-
====
2.With the command show ikev2 ipsec-sa, you can see that the second phase of IPsec VPN has been successfully estab-
lished.
Total: 1
============================================================================-
====
----------------------------------------------------------------------------
----
============================================================================-
====
167 Connection between Two Private Networks Using IPSec VPN (IKEv2)
StoneOS Cookbook
As shown in the figure below, an IPsec VPN security tunnel based on certificate authentication is established between Device A and
Device B. PC1 is the host of Device A, and PC2 is the host of Device B. It is required to protect the data flow between the subnet
(192.168.1.0/24) represented by PC1 and the subnet (10.1.1.0/24) represented by PC2. RSA Signature is used for authentication, ESP
protocol is used for security protocol, SHA is adopted for Hash algorithm, 3DES is adopted for encryption algorithm, so as to ensure
the integrity and security of communication data.
Configuration Steps
Device A
o Zone: trust
o Type: Static IP
o IP Address: 192.168.1.1
o Netmask: 255.255.255.0
o Zone: trust
o Type: Static IP
o IP Address:1.1.1.1
o Netmask: 255.255.255.0
Step 2: Configuring the trust domain and importing the authentication certificate
Select System > PKI > Trust Domain, and click New.
DER".
Select Network > VPN > IPSec VPN, and click New. On the IPSec VPN
Configuration page, click the button in the Peer Name drop-down list, then
on the VPN Peer Configuration page, and click the button in the
o Proposal Name: P1
o Authentication: RSA-Signature
o Hash: SHA
o Encryption: 3DES
o DH group: Group2
Select Network > VPN > IPSec VPN, and click New. On the IPSec VPN
o Proposal Name: P2
o Protocol: ESP
o Hash: SHA
o Encryption: 3DES
3.Configuring peer
Select Network > VPN > IPSec VPN, and click New. On the IPSec VPN
Configuration page, click the button in the Peer Name drop-down list.
o Name: peer1
o Interface: ethernet0/4
o Mode: Main
o Type: Static IP
o Proposal1: P1
Select Network > VPN > IPSec VPN, and click New.
o Peer Name
o Tunnel
o Name: tunnel
o Mode: Tunnel
o P2 Proposal: P2
o Basic
o Interface Name: 1
o Zone: trust
o Tunnel Binding
o Destination: 10.1.1.0
o Netmask: 24
o Next-hop: Interface
o Interface: tunnel1
Select Policy > Security Policy > Policy, and click New.
o Name: policy
o Service: Any
o Action: Permit
Device B
o Zone: trust
o Type: Static IP
o IP Address: 10.1.1.100
o Netmask: 255.255.255.0
o Zone: trust
o Type: Static IP
o IP Address:1.1.1.2
o Netmask: 255.255.255.0
Step 2: Configuring the trust domain and importing the authentication certificate
Select System > PKI > Trust Domain, and click New.
DER".
Select Network > VPN > IPSec VPN, and click New. On the IPSec VPN
Configuration page, click the button in the Peer Name drop-down list, then
on the VPN Peer Configuration page, and click the button in the
o Proposal Name: P1
o Authentication: RSA-Signature
o Hash: SHA
o Encryption: 3DES
o DH group: Group2
Select Network > VPN > IPSec VPN, and click New. On the IPSec VPN
o Proposal Name: P2
o Protocol: ESP
o Hash: SHA
o Encryption: 3DES
3.Configuring Peer
Select Network > VPN > IPSec VPN, and click New. On the IPSec VPN
Configuration page, click the button in the Peer Name drop-down list.
o Name: peer1
o Interface: ethernet0/4
o Mode: Main
o Type: Static IP
o Proposal1: P1
Select Network > VPN > IPSec VPN, and click New.
o Peer Name
o Tunnel
o Name: tunnel
o Mode: Tunnel
o P2 Proposal: P2
o Basic
o Interface Name: 1
o Zone: trust
o Tunnel Binding
o Destination: 192.168.1.0
o Netmask: 24
o Next-hop: Interface
o Interface: tunnel1
Select Policy > Security Policy > Policy, and click New.
o Name: policy
o Service: Any
o Action: Permit
Go to Network > VPN > IPSec VPN, and click IPSec VPN
Monitor on the top right corner, under the <ISAKMP SA>
tab, it can be seen that the phase 1 of IPSec VPN has been
successfully established.
Go to Network > VPN > IPSec VPN, and click IPSec VPN
Monitor on the top right corner, under the <IPSec SA> tab,
it can be seen that the phase 2 of IPSec VPN has been
successfully established.
Realizing Dynamic Switch between IPSec Links Using IPSec VPN Smart Link
This example tells how to configure IPSec VPN smart link to realize dynamic switch between IPSec links.
As shown in the figure below, IPSec VPN tunnel is to connect the Device A in a branch office and the Device B in the headquarters. If
the packet loss rate or latency of the tunnel that is established based on Link1 exceeds the specified threshold, the system would switch
to Link2 to establish a new IPSec VPN tunnel. ESP protocol is used for security protocol, SHA-256 is adopted for Hash algorithm,
AES-256 is adopted for encryption algorithm, so as to ensure the integrity and security of communication data.
Configuration Steps
Device A
hostname(config-if-eth0/1)# exit
hostname(config-if-xe3/0)# exit
Realizing Dynamic Switch between IPSec Links Using IPSec VPN Smart Link 181
StoneOS Cookbook
hostname(config-user)# exit
hostname(config-aaa-server)# exit
hostname(config)# exit
userkey: OG64Mk1CPfRLKou3yCwOehMLfQw=
182 Realizing Dynamic Switch between IPSec Links Using IPSec VPN Smart Link
StoneOS Cookbook
1.Configuring P1 proposal.
hostname(config-isakmp-proposal)# group 2
hostname(config-isakmp-proposal)# exit
2.Configuring P2 proposal.
hostname(config-ipsec-proposal)# exit
hostname(config-isakmp-peer)# isakmp-proposal p1
hostname(config-isakmp-peer)# nat-traversal
hostname(config-isakmp-peer)# generate-route
hostname(config-isakmp-peer)# exit
Realizing Dynamic Switch between IPSec Links Using IPSec VPN Smart Link 183
StoneOS Cookbook
hostname(config-tunnel-ipsec-auto)# ipsec-proposal p2
hostname(config-tunnel-ipsec-auto)# exit
hostname(config-if-tun1)# exit
Device B
184 Realizing Dynamic Switch between IPSec Links Using IPSec VPN Smart Link
StoneOS Cookbook
hostname(config-if-eth0/1)# exit
hostname(config-if-xe0/2.1)# exit
hostname(config-if-xe0/2.2)# exit
hostname(config-ipsec-smart-link-profile)# exit
Realizing Dynamic Switch between IPSec Links Using IPSec VPN Smart Link 185
StoneOS Cookbook
1.Configuring P1 proposal.
hostname(config-isakmp-proposal)# group 2
hostname(config-isakmp-proposal)# exit
2.Configuring P2 proposal.
hostname(config-ipsec-proposal)# exit
hostname(config-isakmp-peer)# isakmp-proposal p1
hostname(config-isakmp-peer)# nat-traversal
hostname(config-isakmp-peer)# generate-route
hostname(config-isakmp-peer)# exit
186 Realizing Dynamic Switch between IPSec Links Using IPSec VPN Smart Link
StoneOS Cookbook
hostname(config-tunnel-ipsec-auto)# ipsec-proposal p2
hostname(config-tunnel-ipsec-auto)# auto-connect
hostname(config-tunnel-ipsec-auto)# exit
hostname(config-if-tun1)# exit
hostname(config-vrouter)# exit
1.With the command show isakmp sa, you can see that the first phase of IPsec VPN has been successfully established.
Realizing Dynamic Switch between IPSec Links Using IPSec VPN Smart Link 187
StoneOS Cookbook
Total: 1
L-time - Lifetime
============================================================================-
====
----------------------------------------------------------------------------
----
============================================================================-
====
2.With the command show ipsec sa, you can see that the second phase of IPsec VPN has been successfully established.
Total: 1
============================================================================-
====
----------------------------------------------------------------------------
----
============================================================================-
====
188 Realizing Dynamic Switch between IPSec Links Using IPSec VPN Smart Link
StoneOS Cookbook
Step 9: When the packet loss rate or latency of the tunnel that is established based on Link1(191.1.101.1->1.1.1.1) exceeds the specified
threshold, verify that the system can successfully switch to Link2(191.1.102.1->1.1.1.1) to establish a new IPSec VPN tunnel.
1.With the command show ipsec smart-link-profile smart_profile1, you can see that the Link1 is currently
used to establish IPSec tunnel.
Realizing Dynamic Switch between IPSec Links Using IPSec VPN Smart Link 189
StoneOS Cookbook
Total: 1
============================================================================-
====
Name: smart_profile1
Status: enable
Loss-rate(%): 30
Delay(ms): 500
Track-source: 191.1.101.1
Track-destination: 1.1.1.1
Track-interval(s): 3
Track-count: 10
Switch-cycles: 5
Switch-back-time(s): 600
Switched-count: 0
Switched-cycles: 0
Link-list:
============================================================================-
====
190 Realizing Dynamic Switch between IPSec Links Using IPSec VPN Smart Link
StoneOS Cookbook
2.When the packet loss rate or latency of the tunnel that is established based on Link1 exceeds the specified threshold, verify that the sys-
tem can successfully switch to Link2 to establish a new IPSec VPN tunnel. With the command show ipsec smart-link-
profile smart_profile1,you can see that the Link2 has been automatically switched to establish an IPSec tunnel.
Realizing Dynamic Switch between IPSec Links Using IPSec VPN Smart Link 191
StoneOS Cookbook
Total: 1
============================================================================-
====
Name: smart_profile1
Status: enable
Loss-rate(%): 30
Delay(ms): 500
Track-source: 191.1.102.1
Track-destination: 1.1.1.1
Track-interval(s): 3
Track-count: 10
Switch-cycles: 5
Switch-back-time(s): 600
Switched-count: 1
Switched-cycles: 0
Link-list:
192 Realizing Dynamic Switch between IPSec Links Using IPSec VPN Smart Link
StoneOS Cookbook
============================================================================-
===
Realizing Dynamic Switch between IPSec Links Using IPSec VPN Smart Link 193
StoneOS Cookbook
The topology describes a remote user trying to visit the internal server within a corporate. Using SSL VPN tunnel, the connection
between remote users and private server is encrypted and safe. Besides, enabling the Two-Step Verification function based on the SMS
Modem method to enhance the security of user's login; transmitting data over TCP protocol to strengthen communication stability.
Allowing Remote Users to Access a Private Network Using SSL VPN 194
StoneOS Cookbook
Configuration Steps
o Name: test1
o Password: 123456
195 Allowing Remote Users to Access a Private Network Using SSL VPN
StoneOS Cookbook
o Protocol Type:UMS
o Service Provider:hillstone
o UMS Protocol:HTTP
o Virtual Router:trust-vr
o Host:Name;sms.api.ums86.com
o Port:8899
o Company Code:245588
Allowing Remote Users to Access a Private Network Using SSL VPN 196
StoneOS Cookbook
o Mask: 255.255.255.0
o DNS1: 10.160.65.60
o WINS1: 10.160.65.61
o Zone: VPN
o Virtual Router:trust-vr
197 Allowing Remote Users to Access a Private Network Using SSL VPN
StoneOS Cookbook
o Zone: VPN
o Type: Static IP
o IP Address: 20.1.1.1
o Netmask: 255.255.255.0
Allowing Remote Users to Access a Private Network Using SSL VPN 198
StoneOS Cookbook
o IP: 10.160.65.0
o Netmask: 255.255.255.0
o Advanced Parameters
o Port(TCP):10000
199 Allowing Remote Users to Access a Private Network Using SSL VPN
StoneOS Cookbook
o Type:SMS Authentication
o Sender Name:FWvisitAPP
o Name: policy
o Service: Any
o Action: Permit
Allowing Remote Users to Access a Private Network Using SSL VPN 200
StoneOS Cookbook
Step 7: Results
201 Allowing Remote Users to Access a Private Network Using SSL VPN
StoneOS Cookbook
Step 7: Results
o Server:10.182.159.103
o Port:4433
o Username:test1
o Password:123456
Allowing Remote Users to Access a Private Network Using SSL VPN 202
StoneOS Cookbook
This example shows how to configure site-to-site VPN to establish a VPN tunnel (IPSec VPN tunnel) between Microsoft Azure and
Hillstone device.
The topology is shown as below, the Hillstone device is the gateway for the enterprise. It requires an IPsec VPN tunnel between the
company and Microsoft Azure through the Hillstone device. The authentication algorithm uses SHA and the encryption algorithm uses
3DES, thus the local service can be connected with hosted cloud services.
* Note: This topology uses laboratory environment. In this recipe, 124.193.87.66 represents Hillstone device public IP, 192.168.0.0/16 represents the internal subnet of enterprise,
13.94.46.90 represents public IP of Microsoft Azure, 10.11.0.0/16 the internal subnet of Microsoft Azure.
4. Configuring route
3. Click +Add.
o Name: VNet
o Location: East US
3. Click Create.
o Name: VNetGateway
3. Click Create.
o Name: Hillstone
o IP address: 124.193.87.66
o Location: East US
Step 5: Create the VPN connection (This step is performed after completing the "Configure Hillstone Device")
3. Click Add.
o Name: VNet1toSite2
Note:
o About VPN devices and IPsec/IKE parameters for Site-to-Site VPN Gateway connections, refer to the Microsoft Azure doc-
umentation:
https://docs.microsoft.com/en-gb/azure/vpn-gateway/vpn-gateway-about-vpn-devices.
o About "Create a Site-to-Site connection in the Azure portal", refer to the Microsoft Azure documentation:
https://docs.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-howto-site-to-site-resource-manager-portal.
hostname(config-ikev2-proposal)# group 2
hostname(config-ikev2-proposal)# exit
hostname(config-ikev2-ipsec-proposal)#hash sha
hostname(config-ikev2-ipsec-proposal)#encryption aes
hostname(config-ikev2-ipsec-proposal)#lifetime 3600
hostname(config-ikev2-ipsec-proposal)#exit
hostname(config-ikev2-profile)# exit
hostname(config-ikev2-peer)# exit
hostname(config)#
hostname(config-ikev2-tunnel)# auto-connect
hostname(config-ikev2-tunnel)# exit
hostname(config)#
Step 3 : Binding the tunnel interface to the IPsec VPN IKEv2 tunnel
hostname(config-if-tun1)# exit
hostname(config)#
hostname(config-vrouter)# exit
In the topology below, a remote user located in the Internet uses an iOS/Android device to access the intranet server Server1. The
authentication method requires username and password, and the connection is based on SSL VPN. Please first see step 1 to 5 in "Allow-
ing Remote Users to Access a Private Network Using SSL VPN" on Page 194 to create a SSL VPN instance.
o Connection: connection1
o Server: 153.34.29.1
o Port: 4433
o Account: user1
o Password: 123456
https://play.google.com/store/apps/details?id=com.hillstone.vpn
Visit Google Play to download and install Hill-
stone Secure Connect VPN.
o Server: 153.34.29.1
o Port: 4433
o Account: user1
o Password: 123456
Click Login.
The topology is shown as below. A remote user, located at home or a hotel, accesses the Internet through a router with NAT enabled.
This remote user uses L2TP over IPSec VPN to visit the server (PC1) in the corporate internal network. And this server is protected by
the device A.
*Due to lab environment, use 10.10.1.0./24 to represent the public network segment.
Allowing Remote Users ( PC ) to Access a Private Network Using L2TP over IPSec VPN 222
StoneOS Cookbook
o Zone: dmz
o Type: Static IP
o IP Address: 192.168.1.1
o Netmask: 255.255.255.0
o Zone: untrust
o Type: Static IP
o IP Address: 10.10.1.1
o Netmask: 255.255.255.0
223 Allowing Remote Users ( PC ) to Access a Private Network Using L2TP over IPSec VPN
StoneOS Cookbook
o Zone: trust
o IP Address: 192.168.3.1
o Netmask: 255.255.255.0
Allowing Remote Users ( PC ) to Access a Private Network Using L2TP over IPSec VPN 224
StoneOS Cookbook
o Name: trust_to_dmz
o Source
o Zone: trust
o Address: Any
o Destination
o Zone: dmz
o Address: Any
o Other
o Action: Permit
225 Allowing Remote Users ( PC ) to Access a Private Network Using L2TP over IPSec VPN
StoneOS Cookbook
o Authentication: Pre-share
o Hash: SHA
o Encryption: 3DES
o DH Group: Group2
o Lifetime: 86400
o Protocol: ESP
o HASH: SHA
o Encryption: 3DES
o Compression: None
o Lifetime: 28800
o Lifesize: Enable
o Lifesize: 250000
Allowing Remote Users ( PC ) to Access a Private Network Using L2TP over IPSec VPN 226
StoneOS Cookbook
o Name: toclient
o Interface: ethernet0/2
o Mode: Main
o Proposal1: p1forl2tp
227 Allowing Remote Users ( PC ) to Access a Private Network Using L2TP over IPSec VPN
StoneOS Cookbook
o Peer
o Tunnel
o Name: toclienttunnel
o Mode: transport
o P2 proposal: p2forl2tp
o Accept-all-proxy-ID: Enable
Allowing Remote Users ( PC ) to Access a Private Network Using L2TP over IPSec VPN 228
StoneOS Cookbook
Select Object > User > Local User > New >
User.
o Name: user1
o Password: hillstone
229 Allowing Remote Users ( PC ) to Access a Private Network Using L2TP over IPSec VPN
StoneOS Cookbook
o Click Add
The steps of setting up a VPN connection differ in different PC operating systems. Take Windows 7, Windows XP/2003 and Mac OS
for example.
Allowing Remote Users ( PC ) to Access a Private Network Using L2TP over IPSec VPN 230
StoneOS Cookbook
Set up a connection:
8. Click Finish.
231 Allowing Remote Users ( PC ) to Access a Private Network Using L2TP over IPSec VPN
StoneOS Cookbook
Allowing Remote Users ( PC ) to Access a Private Network Using L2TP over IPSec VPN 232
StoneOS Cookbook
4. Click Connect.
233 Allowing Remote Users ( PC ) to Access a Private Network Using L2TP over IPSec VPN
StoneOS Cookbook
Set up a connection:
Allowing Remote Users ( PC ) to Access a Private Network Using L2TP over IPSec VPN 234
StoneOS Cookbook
235 Allowing Remote Users ( PC ) to Access a Private Network Using L2TP over IPSec VPN
StoneOS Cookbook
3. Click Connect.
Allowing Remote Users ( PC ) to Access a Private Network Using L2TP over IPSec VPN 236
StoneOS Cookbook
Set up a connection:
7. Click Create.
237 Allowing Remote Users ( PC ) to Access a Private Network Using L2TP over IPSec VPN
StoneOS Cookbook
Allowing Remote Users ( PC ) to Access a Private Network Using L2TP over IPSec VPN 238
StoneOS Cookbook
239 Allowing Remote Users ( PC ) to Access a Private Network Using L2TP over IPSec VPN
StoneOS Cookbook
By default, the L2TP VPN is required by Windows to use IPSec. For the above L2TP over IPSec VPN, you do not need to modify the
system's registry.
If the system has disabled IPSec, take the following steps to make the system use L2TP over IPSec:
Enable IPSec
3. Click OK
4. Navigate to HKEY_Local_Machine\Sys-
tem\CurentControl Set\Ser-
vices\RasMan\Parameters.
Allowing Remote Users ( PC ) to Access a Private Network Using L2TP over IPSec VPN 240
StoneOS Cookbook
The topology is shown as below. A remote user, located at home or a hotel, accesses the Internet via mobile 3G/4G or Wi-Fi. This
remote user (iOS/Android) uses L2TP over IPSec VPN to visit the server (PC1) in the corporate internal network. And this server is
protected by the device A.
*Due to lab environment, use 10.10.1.0./24 to represent the public network segment.
Allowing Remote Users (iOS/Android) to Access a Private Network Using L2TP over IPSec VPN 241
StoneOS Cookbook
o Zone: dmz
o Type: Static IP
o IP Address: 192.168.1.1
o Netmask: 255.255.255.0
o Zone: untrust
o Type: Static IP
o IP Address: 10.10.1.1
o Netmask: 255.255.255.0
242 Allowing Remote Users (iOS/Android) to Access a Private Network Using L2TP over IPSec VPN
StoneOS Cookbook
o Zone: trust
o IP Address: 192.168.3.1
o Netmask: 255.255.255.0
Allowing Remote Users (iOS/Android) to Access a Private Network Using L2TP over IPSec VPN 243
StoneOS Cookbook
o Name: trust_to_dmz
o Source
o Zone: trust
o Address: Any
o Destination
o Zone: dmz
o Address: Any
o Other
o Action: Permit
244 Allowing Remote Users (iOS/Android) to Access a Private Network Using L2TP over IPSec VPN
StoneOS Cookbook
o Authentication: Pre-share
o Hash: SHA
o Encryption: 3DES
o DH Group: Group2
o Lifetime: 86400
o Protocol: ESP
o HASH: SHA
o Compression: None
o Lifetime: 28800
o Lifesize: Enable
o Lifesize: 250000
Allowing Remote Users (iOS/Android) to Access a Private Network Using L2TP over IPSec VPN 245
StoneOS Cookbook
o Name: toclient
o Interface: ethernet0/2
o Mode: Main
o Proposal1: p1forl2tp
246 Allowing Remote Users (iOS/Android) to Access a Private Network Using L2TP over IPSec VPN
StoneOS Cookbook
o Peer
o Tunnel
o Name: toclienttunnel
o Mode: transport
o P2 proposal: p2forl2tp
o Accept-all-proxy-ID: Enable
Allowing Remote Users (iOS/Android) to Access a Private Network Using L2TP over IPSec VPN 247
StoneOS Cookbook
Select Object > User > Local User > New >
User.
o Name: user1
o Password: hillstone
248 Allowing Remote Users (iOS/Android) to Access a Private Network Using L2TP over IPSec VPN
StoneOS Cookbook
o Click Add
Allowing Remote Users (iOS/Android) to Access a Private Network Using L2TP over IPSec VPN 249
StoneOS Cookbook
Steps of setting up a VPN connection in iOS 10. (Before configuring your iPhone, make sure that it can access the Internet nor-
mally.)
250 Allowing Remote Users (iOS/Android) to Access a Private Network Using L2TP over IPSec VPN
StoneOS Cookbook
Steps of setting up a VPN connection in iOS 10. (Before configuring your iPhone, make sure that it can access the Internet nor-
mally.)
o Server: 10.10.1.1
Allowing Remote Users (iOS/Android) to Access a Private Network Using L2TP over IPSec VPN 251
StoneOS Cookbook
Steps of setting up a VPN connection in iOS 10. (Before configuring your iPhone, make sure that it can access the Internet nor-
mally.)
252 Allowing Remote Users (iOS/Android) to Access a Private Network Using L2TP over IPSec VPN
StoneOS Cookbook
Steps of setting up a VPN connection in Android. (Before configuring your iPhone, make sure that it can access the Internet
normally.)
Allowing Remote Users (iOS/Android) to Access a Private Network Using L2TP over IPSec VPN 253
StoneOS Cookbook
Steps of setting up a VPN connection in Android. (Before configuring your iPhone, make sure that it can access the Internet
normally.)
254 Allowing Remote Users (iOS/Android) to Access a Private Network Using L2TP over IPSec VPN
StoneOS Cookbook
Steps of setting up a VPN connection in Android. (Before configuring your iPhone, make sure that it can access the Internet
normally.)
Allowing Remote Users (iOS/Android) to Access a Private Network Using L2TP over IPSec VPN 255
StoneOS Cookbook
Connection between Two Private Networks Using GRE over IPSec VPN
This example introduces how to create GRE over IPSec VPN to protect the communication between the private network of the
headquarters and the private network of the branch.
The topology is shown as below. Device A acts as the gateway of the headquarters and device B acts as the gateway of the branch. To
protect the communication between two private networks, use GRE over IPSec VPN.
*Due to lab environment, use 10.89.16.0/22 to represent the public network segment.
Connection between Two Private Networks Using GRE over IPSec VPN 256
StoneOS Cookbook
o Zone: trust
o Type: Static IP
o IP Address: 192.168.1.1
o Netmask: 255.255.255.0
o Zone: untrust
o Type: Static IP
o IP Address: 10.89.17.226
o Netmask: 255.255.252.0
257 Connection between Two Private Networks Using GRE over IPSec VPN
StoneOS Cookbook
o Zone: trust
o IP Address: 172.2.2.1
o Netmask: 255.255.255.0
o Zone: trust
o Type: Static IP
o IP Address: 192.168.2.1
o Netmask: 255.255.255.0
Connection between Two Private Networks Using GRE over IPSec VPN 258
StoneOS Cookbook
o Zone: untrust
o Type: Static IP
o IP Address: 10.89.18.131
o Netmask: 255.255.252.0
o Zone: trust
o IP Address: 172.2.2.2
o Netmask: 255.255.255.0
259 Connection between Two Private Networks Using GRE over IPSec VPN
StoneOS Cookbook
o Authentication: Pre-share
o Hash: SHA
o Encryption: 3DES
o DH Group: Group2
o Lifetime: 86400
o Protocol: ESP
o HASH: SHA
o Encryption: 3DES
o Compression: None
o Lifetime: 28800
Connection between Two Private Networks Using GRE over IPSec VPN 260
StoneOS Cookbook
o Name: center2branch1_ipsec
o Interface: ethernet0/1
o Mode: Main
o Type: Static IP
o Proposal1: p1forgre
261 Connection between Two Private Networks Using GRE over IPSec VPN
StoneOS Cookbook
o Peer
o Tunnel
o Name: center2branch1_ipsec_tunnel
o Mode: tunnel
o P2 proposal: p2forgre
Connection between Two Private Networks Using GRE over IPSec VPN 262
StoneOS Cookbook
o Authentication: Pre-share
o Hash: SHA
o Encryption: 3DES
o DH Group: Group2
o Lifetime: 86400
o Protocol: ESP
o HASH: SHA
o Encryption: 3DES
o Compression: None
o Lifetime: 28800
263 Connection between Two Private Networks Using GRE over IPSec VPN
StoneOS Cookbook
o Name: tocenter_ipsec
o Interface: ethernet0/1
o Mode: Main
o Type: Static IP
o Proposal1: p1forgre
Connection between Two Private Networks Using GRE over IPSec VPN 264
StoneOS Cookbook
o Peer
o Tunnel
o Name: tocenter_ipsec_tunnel
o Mode: tunnel
o P2 proposal: p2forgre
GRE VPN configurations are not supported by WebUI. You need to use CLI to complete the following GRE VPN configurations.
265 Connection between Two Private Networks Using GRE over IPSec VPN
StoneOS Cookbook
Connection between Two Private Networks Using GRE over IPSec VPN 266
StoneOS Cookbook
267 Connection between Two Private Networks Using GRE over IPSec VPN
StoneOS Cookbook
Configure routes.
o Destination: 192.168.2.0
o Interface: tunnel1
Connection between Two Private Networks Using GRE over IPSec VPN 268
StoneOS Cookbook
o Name: trust_to_trust
o Source
o Zone: trust
o Address: Any
o Destination
o Zone: trust
o Address: Any
o Other
o Action: Permit
269 Connection between Two Private Networks Using GRE over IPSec VPN
StoneOS Cookbook
Configure routes.
o Destination: 192.168.1.0
o Interface: tunnel1
Connection between Two Private Networks Using GRE over IPSec VPN 270
StoneOS Cookbook
o Name: trust_to_trust
o Source
o Zone: trust
o Address: Any
o Destination
o Zone: trust
o Address: Any
o Other
o Action: Permit
271 Connection between Two Private Networks Using GRE over IPSec VPN
StoneOS Cookbook
In the topology below, PC1 and PC2 communicate through the VXLAN tunnel (VNI100).
Note: In the same tunnel, different VNIs cannot communicate with each other.
Configuration Steps
VTEP1 Configuratio
hostname(config-if-eth0/1)# exit
hostname(config-tunnel-vxlan)# exit
hostname(config)#
Step 3: Configure the tunnel interface and bind the Layer 2 security zone.
Connection between Two Private Networks Using GRE over IPSec VPN 272
StoneOS Cookbook
hostname(config-if-tun1)# exit
hostname(config)#
hostname(config)# policy-global
hostname(config-policy)# rule id 1
Rule id 1 is created
hostname(config-policy-rule)# exit
hostname(config)#
VTEP2 Configuration
hostname(config-if-eth0/1)# exit
273 Connection between Two Private Networks Using GRE over IPSec VPN
StoneOS Cookbook
hostname(config-tunnel-vxlan)# exit
hostname(config)#
Step 3: Configure the tunnel interface and bind the Layer 2 security zone.
hostname(config-if-tun1)# exit
hostname(config)#
hostname(config)# policy-global
hostname(config-policy)# rule id 1
Rule id 1 is created
hostname(config-policy-rule)# exit
hostname(config)#
Connection between Two Private Networks Using GRE over IPSec VPN 274
StoneOS Cookbook
PC1 and PC2 can communicate with each other through the VXLAN tunnel successfully.
The topology is shown below. A remote user (PC) , located at a branch office of the corporate , uses SSL VPN to visit the branch fire-
wall . The branch firewall functions as an L2TP client to establish a tunnel connection with the headquarters firewall. Then, the traffic
from the remote user(PC) is routed to the L2TP tunnel , and the remote user (PC) in the branch office can communicate with the server
in the corporate internal network.
* This example is used in a laboratory environment. Please configure the IP addresses of each interface according to the actual con-
nections.
275 Connection between Two Private Networks Using GRE over IPSec VPN
StoneOS Cookbook
o Zone: trust
o Type: Static IP
o IP Address: 10.182.55.49
o Netmask: 255.255.255.0
o Zone: untrust
o Type: Static IP
o IP Address: 100.1.1.2
o Netmask: 255.255.255.0
Connection between Two Private Networks Using GRE over IPSec VPN 276
StoneOS Cookbook
o Zone: VPNHub
o Zone: VPNHub
o IP Address: 60.1.1.1
o Netmask: 255.255.255.0
277 Connection between Two Private Networks Using GRE over IPSec VPN
StoneOS Cookbook
o Name: Any_to_Any
o Source
o Zone: Any
o Address: Any
o Destination
o Zone: Any
o Address: Any
o Service : Any
o Action: Permit
Connection between Two Private Networks Using GRE over IPSec VPN 278
StoneOS Cookbook
o Source Address
o IP/Netmask:60.1.1.0/24
o Destination Address
o IP Address:172.16.2.2
o Destination:172.16.2.0
o Netmask:255.255.255.0
o Next-hop:Interface
o Interface:tunnel1
279 Connection between Two Private Networks Using GRE over IPSec VPN
StoneOS Cookbook
Select Object > User > Local User > New >
User.
o Name: user1
o Password: hillstone
o Mask: 255.255.255.0
Connection between Two Private Networks Using GRE over IPSec VPN 280
StoneOS Cookbook
o IP: 172.16.2.0
o Netmask: 255.255.255.0
281 Connection between Two Private Networks Using GRE over IPSec VPN
StoneOS Cookbook
o LNS IP:100.1.1.1
o Keepalive:60 seconds
o User Name:l2tp_user1
o Password:hillstone
o PPP Authentication:CHAP
o Auto connect:Enabled
Connection between Two Private Networks Using GRE over IPSec VPN 282
StoneOS Cookbook
o Zone: untrust
o Type: Static IP
o IP Address: 100.1.1.1
o Netmask: 255.255.255.0
o Zone: trust
o Type: Static IP
o IP Address: 172.16.2.1
o Netmask: 255.255.255.0
283 Connection between Two Private Networks Using GRE over IPSec VPN
StoneOS Cookbook
o Zone: VPNHub
o IP Address: 70.1.1.1
o Netmask: 255.255.255.0
Connection between Two Private Networks Using GRE over IPSec VPN 284
StoneOS Cookbook
o Name: Any_to_Any
o Source
o Zone: Any
o Address: Any
o Destination
o Zone: Any
o Address: Any
o Service: Any
o Action: Permit
Select Object > User > Local User > New >
User.
o Name: l2tp_user1
o Password: hillstone
285 Connection between Two Private Networks Using GRE over IPSec VPN
StoneOS Cookbook
After completing the above configuration, users in the branch office can dial-up to connect to the intranet server.
Connection between Two Private Networks Using GRE over IPSec VPN 286
StoneOS Cookbook
Step 2: Log in
o Server: 10.182.55.49
o Port: 4433
o Username: user1
o Password: hillstone
287 Connection between Two Private Networks Using GRE over IPSec VPN
StoneOS Cookbook
Compared with the traditional VPN access mode, which allows an authorized user to access any resources on the internal network,
ZTNA (Zero Trust Network Access) starts with a default deny posture of zero trust on any entities, whether outside or inside the enter-
prise network perimeter. Hillstone ZTNA solutions adopts a dynamic authorization method with user identity being the focus and per-
sistently evaluates the creditability based on user identity and terminal device environment to achieve granular management of user,
terminal device and application and realize precise and secure service access control.
o Creditable identity: Identity evaluation is not restricted to account and password authentication but incorporates more identity
factors to provide enterprises with fine-grained user access control for profound access security.
o Creditable terminal device: Verified terminal state does not mean permanent access authorization. ZTNA persistently evaluates the
terminal environment and dynamically adjust the authorization scope to enure that the connected terminal is always under security
control.
o Creditable access: The old security concept that internal network is secure is broken. Any implicit creditability is eliminated. Access
to resources will be granted only when the user and the access device satisfy specific requirements so as to effectively mitigate
internal network security risks.
o " Windows User Remotely Accessing Internal Server Through ZTNA" on Page 289
o " Android User Remotely Accessing Internal Server Through ZTNA" on Page 306
Networking Scenario
An enterprise has R&D and Finance departments. The R&D department need to access enterprise application resources including the
Bug management system and OA system on the enterprise network. The Finance department needs to access enterprise application
resources including the Finance system and OA system on the enterprise network. Now, the enterprise hopes that employees in these
two departments can access these systems when they are on a business trip. Meantime, the employes are expected to access the system
using terminal devices that meet the enterprise's network security requirements. Therefore, the enterprise deploys ZTNA and for-
mulates the following control policies based on user identity and security requirements on access terminal devices:
o R&D employees are allowed to access the Bug management system and OA system.
o The access device used for remote access must meet these requirements: OS is Windows 10; firewall is enabled; and the anti-spy
and anti-virus software are updated to the latest version.
o For remote access using a device that meet these requirements, the employee is allowed to access the OA system only: OS is Win-
dows 10; firewall is enabled; and the anti-spy and anti-virus software are not updated to the latest version.
o A user that does not meet any one of the previous requirements will be denied from accessing any resources.
Configuration Roadmap
1. Create user group "rd-group" for R&D employees and add R&D employee accounts to it.
2. Create user group "fin-group" for Finance employees and add Finance employee accounts to it
3. Configure ZTNA server parameters for establishing secure connections from the client to the device and to the application
resources:
a. ZTNA server name: name of the ZTNA service that users will access
b. Egress interface and service port: address and port number of the ZTNA service
c. Address pool: used for allocating private addresses to connect the internal network
d. Tunnel interface and tunnel route: used to establish the dedicated tunnel between the user and the application resources
e. Allow download client from browser: allow users to download ZTNA client by accessing the ZTNA service address in the
browser
f. Multiple login: allow the same user account to log in on multiple clients at the same time
g. Two-step verification: configure the user to pass SMS code verification after logging in with user account and password
4. Create application resources "Bug System", "Finance System" and "OA System", which correspond with the Bug management
system, Finance system and OA system respectively, and set their URL addresses. After a user logs in on the client, the user can
view the names and URL addresses of the application resources that are granted and not granted access. In addition, configure
application resource "Inter-DNS" for the DNS server on the enterprise network to provide domain name resolution for user
traffic.
5. Configure endpoint tags. For terminal devices meeting the enterprise network security requirements, configure "tag1" for the
device whose OS is Windows 10, firewall is enabled and anti-spy and anti-virus software are updated to the latest version.
6. Configure and enable ZTNA policies. When a user's group and tag match the ZTNA policy with action Permit, the user is gran-
ted access to specific application resources. In addition, configure a ZTNA policy to allow user traffic flowing to the internal
DNS server "Inter-DNS" for domain name resolution and place the policy at the beginning of all ZTNA policies.
7. Configure the default action as being Deny, so that a user that do not match any ZTNA policy will be denied from accessing any
application resources.
Configuration Steps
o Type: IPv4
o IP: 10.160.65.0
o Netmask: 255.255.255.0
o Address: 10.160.65.1/32
o Protocol: TCP
o Port: 10001
o Address: 10.160.65.2/32
o Protocol: TCP
o Port: 20001
o Address: 10.160.65.3/32
o Protocol: TCP
o Port: 30001
o Name: Inter-DNS
o Hyperlink: empty
o Address: 10.160.65.5/32
o Protocol: UDP
o Port: 12335
o Name: tag1
o Name: z-policy1
o User: rd-group
o Action: Permit
o Name: z-policy2
o User: fin-group
o Action: Permit
o Name: z-policy3
o Action: Permit
o Name: dns-policy
o Action: Permit
Step 8: Results
Verification Method:
Step 8: Results
Verification Steps:
Step 8: Results
o Server: 10.182.159.103
o Port: 8890
o Username: rduser01
Step 8: Results
o Server: 10.182.159.103
o Port: 8890
o Username: finuser01
Networking Scenario
A bank needs the staff to handle services for customers on the go by accessing the bank service system via hand-held terminals. To
ensure access security, the bank wants to deploy ZTNA and requires that the staff use the Android device with customized device
model number designated by the bank, to access ZTNA and the system version of the device be updated to Android 13.
o The bank staff can log in the ZTNA gateway with the specified account and password when using the designated Android device,
and can switch to the bank service system via the ZTNA Portal page after login.
o The bank staff can log in the ZTNA gateway with the specified account and password when using other Android devices or using
the designated device whose system version is not Android 13, but cannot access the bank service system. When clicking the bank
service system displayed on the ZTNA Portal, the staff will see a tip indicating "Please use designated device and update system ver-
sion to Android 13!".
o Except the specified account, other account cannot log in the ZTNA gateway.
In addition, the bank hopes that the ZTNA service port be closed by default so as to make it and the bank service system invisible on the
network and not be scanned. For users needing to access the ZTNA service, the service port will be particularly open to the user only
after the user has passed the verification of the ZTNA service by sending single packet authorization (SPA) packets to knock the
ZTNA service port.
Configuration Roadmap
1. Create a local user "user01" for the bank work to log in the ZTNA gateway.
2. Configure ZTNA server parameters for establishing secure connects from the client to the device and to the application
resources.
a. ZTNA service: name of the ZTNA service that users will access
b. Egress interface and service port: address and port number of the ZTNA service
c. Address pool: used for allocating private addresses to connecting the internal network
d. Tunnel interface and tunnel route: used to establish the dedicated tunnel between the user and the application resources
3. Configure Single Packet Authorization (SPA) to hide the ZTNA service IP and port number. The ZTNA service port will be
open to the user who accesses through the Hillstone Secure Connect client and passes SPA.
4. Configure the bank service system as application resource "Bank System" and specify a hyperlink for it so that the user can switch
to the bank service system via the ZTNA Portal after login.
5. Configure the designated Android device's model number A-bank-2256 as a custom endpoint item "m-device".
6. Create endpoint tag "m-device-tag" for the designated Android device whose device model number is "m-device" and system
version is Android 13 and configure the tip "Please use designated device and update system version to Android 13!", which will
be displayed when the user is not granted access to the bank service system because the endpoint tag is not matched.
7. Configure and enable ZTNA policy "m-policy", allowing the bank staff to access the bank service system via the designated
Android device.
8. Configure the default action as being Deny, so that a user that do not match "m-policy" will be denied from accessing the bank
service system.
Configuration Steps
o Type: IPv4
o IP: 10.182.190.0
o Netmask: 255.255.255.0
o Port: 60001
o IP: 10.8.6.19
o Port: 20081
o Type: Domain
o Domain: bankserv.com
o Protocol: HTTPS
o Alias: m-device
o Name: m-device-tag
o Name: m-policy
o User: user01
o Action: Permit
Locate the QR code for Android client and use the designated
Android device to scan the code.
Download the installation file and install the Hillstone Secure Con-
nect client.
Open the client and click Add Connection on the upper right. In
the displayed dialog box, fill the following information and then
click Add Connection at the lower part:
o Server: 10.8.6.19
o Port: 20081
o User: user01
o SPA: on
o Port: 60001
After login, the ZTNA Portal Page is displayed. Click Bank Sys-
tem, the user is switched to the bank service system.
High Availability
High Availability is a redundancy backup methhod. It uses two identical devices to ensure that when one fails to work, the other will
immediately takes over to provide network consistency.
o "Making Two Firewalls Working in Hot Standby Mode by Deploying them in HA Peer to Ensure the Continuity of Service " on
Page 325
o "Using Two Devices as Gateways to Forward Business Traffic and Back Up Each Other Based on HSVRP, which Rnsures Uniter-
rupted Business Traffic" on Page 330
The topology gives a typical user scenario for HA. In the designed scenario, one (Device A)of the HA devices will be working under
the active mode, while the other (Device B) is under passive mode. The active device will synchronize its data and status to the passive
device. When the active one fails, the passive device will immediately switch to be active, without interrupting the network.
Configuration Steps
Device A
o Name: track1
o Threshold: 255
o HA sync: Disable
Device B
o Name: track1
o Threshold: 255
o HA sync: Disable
o Zone: untrust
o HA sync: Enable
o Type: Static IP
o IP Address: 100.1.1.4
o Netmask: 29
o Zone: trust
o HA sync: Enable
o Type: Static IP
o IP Address: 192.168.1.4
o Netmask: 29
o Name: policy
o Service: Any
o Action: Permit
Device A
o IP Address: 1.1.1.1/24
o HA cluster ID: 1
o Node ID: 0
o HA Group Configuration:
Enter 10 for "Priority" and
select track1 for "Track
Object".
Device B
o IP Address: 1.1.1.2/24
o HA cluster ID: 1
o Node ID: 1
o HA Group Configuration:
Enter 100 for "Priority" and
select track1 for "Track
Object".
Device A
o Management IP
o IP Address: 192.168.1.253
Device B
o Management IP
o IP Address: 192.168.1.254
Step 5: Results
Device A
o HA State: Master
Device B
o HA State: Backup
Device A
Device B
o HA State: Master
As shown in the figure below, without affecting the original network architecture, the two Hillstone firewalls Device A and Device B
are connected transparently to the upstream and downstream devices.
The eth0/3 and eth0/4 interfaces of Device A are used to connected to the upstream and downstream routers. The eth0/3:1 and eth-
0/4:1 interfaces of Device B are used to connected to the upstream and downstream routers. Also, Device A and Device B use the
eth0/1 and eth0/2 interfaces as HA link interfaces.
Normally, both Device A and Device B forward the traffic from PC to the Server. When one of them fails, the other one takes over all
the traffic.
Configuration Steps
Making Two Firewalls Working in Hot Standby Mode by Deploying them in HA Peer to Ensure the 325
Continuity of Service
StoneOS Cookbook
Device A
hostname(config)# ha group 0
hostname(config-ha-group)# exit
hostname(config)# ha group 1
hostname(config-ha-group)# exit
hostname(config)#
Device B
hostname(config)# ha group 0
hostname(config-ha-group)# exit
hostname(config)# ha group 1
hostname(config-ha-group)# exit
hostname(config)#
326 Making Two Firewalls Working in Hot Standby Mode by Deploying them in HA Peer to Ensure the
Continuity of Service
StoneOS Cookbook
Device A
hostname(M0D1)(config-if-eth0/4)# exit
hostname(M0D1)(config-if-eth0/3)# exit
hostname(M0D1)(config-if-eth0/4:1)# exit
hostname(M0D1)(config-if-eth0/3:1)# exit
hostname(M0D1)(config)#
Device A
hostname(M0D1)(config-trackip)# exit
hostname(M0D1)(config)# ha group 0
hostname(M0D1)(config-ha-group)# exit
hostname(M0D1)(config)#
Making Two Firewalls Working in Hot Standby Mode by Deploying them in HA Peer to Ensure the 327
Continuity of Service
StoneOS Cookbook
Device B
hostname(D0M1)(config-trackip)# exit
hostname(D0M1)(config)# ha group 1
hostname(D0M1)(config-ha-group)# exit
hostname(D0M1)(config)#
hostname(M0D1)(config)# policy-global
hostname(M0D1)(config-policy)# rule id 1
Rule id 1 is created
hostname(M0D1)(config-policy-rule)# exit
hostname(M0D1)(config)#
Verification
When Device A and Device B work normally, both of them forward traffic from PC to Server(IP:30.1.2.10/24).
As shown below, you can use trace 30.1.2.10 command to view the path information of the traffic on PC.
328 Making Two Firewalls Working in Hot Standby Mode by Deploying them in HA Peer to Ensure the
Continuity of Service
StoneOS Cookbook
When Device B fails and Device A works normally, Device A takes over all the traffic from PC to server.
In this case, the status of Device A is still . The status of Device B changes from to . You can use ping
Making Two Firewalls Working in Hot Standby Mode by Deploying them in HA Peer to Ensure the 329
Continuity of Service
StoneOS Cookbook
As shown in the figure below, the two Hillstone devices M0D1 and D0M1 are deployed in the Peer A/A mode. The connection of the
interfaces on the two firewalls is as follows:
o M0D1:
o The xethernet1/10 is used as the HA control link interface and xethernet2/10 is used as the HA data link interface.
o The xethernet1/14 is directly connected to the upstream switch and its IP address is 20.1.1.11/24. The xethernet2/15 is dir-
ectly connected to the downstream switch and its IP address is 30.1.1.11/16.
o D0M1:
o The xethernet1/10 is used as the HA control link interface and xethernet2/10 is used as the HA data link interface.
o The xethernet1/14:1 is directly connected to the upstream switch and its IP address is 20.1.1.12/24. The xethernet2/15:1 is dir-
ectly connected to the downstream switch and its IP address is 30.1.1.12/16.
Four HSVRP groups are configured: hsvrp 1, hsvrp 2, hsvrp 3 and hsvrp 4. Their virtual IP address are different from each other.
Take hsvrp 1 and hsvrp 2 as example, the xethernet1/14 interface is used as the primary interface of hsvrp 1 and the xethernet1/14:1
interface is used as the secondary interface of hsvrp 1. The xethernet1/14:1 interface is used as the primary interface of hsvrp 2 and the
xethernet1/14 interface is used as the secondary interface of hsvrp 2.
If D0M1 fails, the virtual IP address of hsvrp 1 will still take effect on the xethernet1/14 interface. And the virtual IP address of hsvrp
2 will take effect on the xethernet1/14 interface too.
The virtual IP address of hsvrp 1 is configured as the gateway of the host PC1. The virtual IP address of hsvrp 2 is configured as the
gateway of the host PC2. The virtual IP address of hsvrp 4 is configured as the gateway of the server.
Using Two Devices as Gateways to Forward Business Traffic and Back Up Each Other Based on 330
HSVRP, which Rnsures Uniterrupted Business Traffic
StoneOS Cookbook
o If M0D1 and D0M1 work normally, M0D1 forwards the traffic from PC1 to Server and D0M1 forwards the traffic from PC2 to
Server.
o If D0M1 fails and the gateways of PC2 and Server are not changed, M0D1 will forward all the traffic from PC1 and PC2. This
ensures that network communication is not interrupted.
Configuration Steps
M0D1 Device
hostname(config)# ha group 0
hostname(config-ha-group)# exit
hostname(config)# ha group 1
hostname(config-ha-group)# exit
hostname(config)# exit
331 Using Two Devices as Gateways to Forward Business Traffic and Back Up Each Other Based on
HSVRP, which Rnsures Uniterrupted Business Traffic
StoneOS Cookbook
D0M1 Device
hostname(config)# ha group 0
hostname(config-ha-group)# exit
hostname(config)# ha group 1
hostname(config-ha-group)# exit
hostname(config)# exit
Using Two Devices as Gateways to Forward Business Traffic and Back Up Each Other Based on 332
HSVRP, which Rnsures Uniterrupted Business Traffic
StoneOS Cookbook
M0D1 Device
hostname(M0D1)(config)# hsvrp id 1
hostname(M0D1)(config-hsvrp)# exit
hostname(M0D1)(config)# hsvrp id 2
hostname(M0D1)(config-hsvrp)# exit
hostname(M0D1)(config)# hsvrp id 3
hostname(M0D1)(config-hsvrp)# exit
hostname(M0D1)(config)# hsvrp id 4
hostname(M0D1)(config-hsvrp)# exit
Step 3: Configuring interfaces and referencing the HSVRP group for the interfaces.
hostname(M0D1)(config-if-xe1/14)# exit
333 Using Two Devices as Gateways to Forward Business Traffic and Back Up Each Other Based on
HSVRP, which Rnsures Uniterrupted Business Traffic
StoneOS Cookbook
hostname(M0D1)(config-if-xe1/14:1)# exit
hostname(M0D1)(config-if-xe2/15)# exit
hostname(M0D1)(config-if-xe2/15:1)# exit
Using Two Devices as Gateways to Forward Business Traffic and Back Up Each Other Based on 334
HSVRP, which Rnsures Uniterrupted Business Traffic
StoneOS Cookbook
M0D1 Device
===================================================
ID: 1
Status: active(xethernet1/14)
===================================================
ID: 2
Status: inactive
===================================================
ID: 3
Status: active(xethernet2/15)
===================================================
335 Using Two Devices as Gateways to Forward Business Traffic and Back Up Each Other Based on
HSVRP, which Rnsures Uniterrupted Business Traffic
StoneOS Cookbook
ID: 4
Status: inactive
===================================================
hostname(M0D1)(config)# policy-global
hostname(M0D1)(config-policy)# rule id 1
Rule id 1 is created
hostname(M0D1)(config-policy-rule)# exit
hostname(M0D1)(config)#
Verification
When M0D1 and D0M1 work normally, M0D1 forwards the traffic from PC1 to Server and D0M1 forwards the traffic from PC2 to
Server.
As shown below, on the M0D1 device, in any configuration mode, you can use show flow0-interface xethernet1/14 command to
view the information of corresponding sessions.
Using Two Devices as Gateways to Forward Business Traffic and Back Up Each Other Based on 336
HSVRP, which Rnsures Uniterrupted Business Traffic
StoneOS Cookbook
o The value "flag 104000" represents that this session is processed by M0D1 so it tests that M0D1 forwards the traffic from PC1 to
Server.
o The value "flag 204000" represents that this session is processed by the peer device D0M1 so it tests that D0M1 forwards the
traffic from PC2 to Server.
When D0M1 fails and the gateways of PC2 and Server are not changed, PC1 and PC2 can still connect to Server successfully. M0D1
forwards all the traffic from PC1 and PC2.
As shown below, on the M0D1 device, in any configuration mode, you can use show flow0-interface xethernet1/14 command to
view the information of corresponding sessions.
o The value "flag 104000" represents that this session is processed by M0D1. That is to say, M0D1 forwards all the traffic from PC1
and PC2.
337 Using Two Devices as Gateways to Forward Business Traffic and Back Up Each Other Based on
HSVRP, which Rnsures Uniterrupted Business Traffic
StoneOS Cookbook
QoS adopts the concept "pipe" to indicate traffic control method. A pipe is a bandwidth limit. The system divides bandwidth by creating
pipe of different sizes.
QoS Control
This examples shows how to control Internet bandwidth allocation to different users and applications. The key feature that applies in
this situation is 2-Stage QoS flow control.
As shown in the topology below, a company of 155 MB Internet bandwidth has a 2-Stage QoS requirement:
o In 1st Stage QoS: Within the 155 Mbps bandwidth, 40 Mbps will be allocated to Department A, 40 Mbps to Department B, and the
remaining 75 Mbps will be shared by all employees.
o In 2nd Stage QoS: The total P2P flow is limited to 10 Mbps, in which downloading is limited to 2 Mbps, streaming video is limited
to 8 Mbps, and within the video bandwidth, Youku streaming is limited to 6 Mbps.
Configuration Steps
o Name: DeptA
o Name: DeptB
o Source Information
o Interface: ethernet0/2
o Forward
o Backward
Step 4: Creating root pipe "p2p" under Level-2 control to limit P2P total to 10 Mbps
Step 4: Creating root pipe "p2p" under Level-2 control to limit P2P total to 10 Mbps
o Source Information
o Interface: ethernet0/2
o Other
o Forward
o Backward:
As shown in the following figure, this lab environment simulates the deployment of equipment at the second-level ISP exit scene.The
second-level ISP rent Tele-com, China Netcom and other operators of the bandwidth to the user to achieve Internet access. The figure
use 101.0.0.1 to connect to the Internet by Tele-com and 201.1.1.1 to connect to Netcom.
Configuration Steps
o Destination:0.0.0.0
o Subnet Mask:0
o Next Hop:interface
o Interface:ethernet0/1
o Gateway:101.1.1.1
o Destination:0.0.0.0
o Subnet Mask:0
o Next Hop:interface
o Interface:ethernet0/2
o Gateway:201.1.1.1
o Bandwidth
o Up Bandwidth:50000000bps
o Down Bandwidth:50000000bps
Follow the same steps to set the bandwidth of the interface eth-
ernet0 / 2 to 50M.
o Profile:HP_LLB
o Rule Name:HP_LLB_rule
o Vitual Router:trust-vr
o Destination Address:0.0.0.0/0
After completing the above steps, use the test tool to construct traffic through ethernet0/1 and ethernet0/2, respectively, and then
observe the traffic on each link.By changing the size of outgoing traffic,you can find that the traffic on two links can be adjusted
equitably. The system routing mechanism is as follows:
o When the bandwidth of each link does not exceed 30M (50M*60%), the system calculates the link overhead based on the link
delay, jitter and packet loss rate. The link with the lower link overhead eventually allocates more traffic, while the other link has
less traffic,but the two links are basically balanced.
o When the link bandwidth exceeds 30M, the system adds the bandwidth utilization factor to the calculation, that is, the system cal-
culates the link overhead based on the delay, jitter, packet loss rate and bandwidth utilization. The link with lower link overhead
eventually allocates more traffic, while the other link has less traffic, but the two links are basically balanced.
Q&A
o Q: What factors in the network affect the link load balancing routing of the system?
A: The delay, jitter, packet loss rate and bandwidth utilization of each link are the impact factors. System can intelligently oute and
dynamically adjust the traffic load of each link by monitoring the delay, jitter, packet loss rate and bandwidth utilization of each link
in real-time.
o High Performance - In this mode, system adjusts link to keep the link balance as fast as possible
o High Compatibility - In this mode, When the link load changes, system does not switch the link frequently, but ensures that the
service is as far as possible on the previous link. This mode is suitable for services that are sensitive to link switching, such as
banking services, only when the previous link is overloaded.
Threat Prevention
Threat prevention, that device can detect and block network threats occur. By configuring the threat protection function, Device can
defense network attacks, and reduce losses caused by internal network.
o "Protecting Internal Servers and Host to Defend Attack via Abnormal Behavior Detection" on Page 352
o "Protecting Intranet to Defend Attacks via Intrusion Prevention System" on Page 359
Protecting Internal Servers and Host to Defend Attack via Abnormal Behavior
Detection
This example introduces how to use Abnormal Behavior Detection to find attacks about servers as early as possible, and integrate with
Mitigation to protect servers better.
As shown in the topology, the device is deployed in the data center exit. After enable and configure the Abnormal Behavior Detection,
when a Web server is infected by SYN flood frequently, a mail server is infected by port scan attacks periodically, Trojan implanted to
the intranet host, Trojan fake domain name by DGA algorithm technology, and connect external network control server, the admin-
istrator can find these attacks and protect the internal hosts and servers.
* To use Abnormal Behavior Detection, apply and install the StoneShield license.
Protecting Internal Servers and Host to Defend Attack via Abnormal Behavior Detection 352
StoneOS Cookbook
Configuration Steps
Step 2: Configuring the critical asset object (Web Server and Mail Server)
353 Protecting Internal Servers and Host to Defend Attack via Abnormal Behavior Detection
StoneOS Cookbook
Step 2: Configuring the critical asset object (Web Server and Mail Server)
o Type: Server
o IP: 172.20.0.10
o Type: Server
o IP: 172.18.1.20
Protecting Internal Servers and Host to Defend Attack via Abnormal Behavior Detection 354
StoneOS Cookbook
355 Protecting Internal Servers and Host to Defend Attack via Abnormal Behavior Detection
StoneOS Cookbook
Protecting Internal Servers and Host to Defend Attack via Abnormal Behavior Detection 356
StoneOS Cookbook
357 Protecting Internal Servers and Host to Defend Attack via Abnormal Behavior Detection
StoneOS Cookbook
Step 4: Integrating with Mitigation, and configuring the mitigation rules for attacks.
o Severity: Low
o Duration: 60
Protecting Internal Servers and Host to Defend Attack via Abnormal Behavior Detection 358
StoneOS Cookbook
Step 4: Integrating with Mitigation, and configuring the mitigation rules for attacks.
o Severity: Low
o Role: Attacker
o Total Number: 20
o Drop Percent: 50
o Duration: 60
359 Protecting Internal Servers and Host to Defend Attack via Abnormal Behavior Detection
StoneOS Cookbook
As shown in the following topology, the device is deployed in the Intranet exit. After enabling and configuring the Intrusion Prevention
System, the device will protect Intranet against internet attacks.
Configuration Steps
Protecting Internal Servers and Host to Defend Attack via Abnormal Behavior Detection 360
StoneOS Cookbook
361 Protecting Internal Servers and Host to Defend Attack via Abnormal Behavior Detection
StoneOS Cookbook
Protecting Internal Servers and Host to Defend Attack via Abnormal Behavior Detection 362
StoneOS Cookbook
Source:
o Zone:untrust
o Address:any
Destination:
o Zone:dmz
o Address:any
Others:
o Service:any
o Action:Permit
363 Protecting Internal Servers and Host to Defend Attack via Abnormal Behavior Detection
StoneOS Cookbook
Source:
o Zone:trust
o Address:any
Destination:
o Zone:dmz
o Address:any
Others:
o Service:any
o Action:Permit
o Profile:predef_default
Protecting Internal Servers and Host to Defend Attack via Abnormal Behavior Detection 364
StoneOS Cookbook
directorylist.jsp?n=X'or%20telephonenumber%20like%20''.
The device will display the attack information and block the
attack.
ditions.
conditions.
365 Protecting Internal Servers and Host to Defend Attack via Abnormal Behavior Detection
StoneOS Cookbook
Protecting Internal Servers and Host to Defend Attack via Abnormal Behavior Detection 366
StoneOS Cookbook
Forensic Analysis
This feature may not be available on all platforms. Please check your system's actual page to see if your device delivers this feature.
This example shows how to in-depth view the threat of the whole network and analyze the threat evidence.
Forensic Analysis provides evidence chain of network threats to collect, multi-perspective analysis and the depth of integration.
o Evidence Collection: Through the configuration of Forensic Analysis function (packet capture), detect the attack generated at the
same time evidence collection.
o Evidence Presentation: Display the threat details, logs, evidence pacp via iCenter, to achieve the threat of visualization.
Configuration Steps
At present, the system only supports the Forensic Analysis function of three threat detection engines (Advanced Threat Detection, Intru-
sion Prevention System, Anti Virus)
Anti Virus
As follows, taking advanced threat detection (ATD) as an example to demonstrate the process of Forensic Analysis
When ATD attacks occurred, the system will generate a relevant threat log and capture evidence, sent to the system database.
According to the source IP, Advanced threat detection engine capture relational pacp at the same time, it is the HTTP traffic data
(including TCP interaction) in 5 minutes or 64K size package, and used to assist in the analysis.
4. Downloading evidence.
o CloudView: CloudView is a SaaS product. It is deployed on the public cloud to provide users with online on-demand services. Hill-
stone devices register with the cloud service platform and upload device information, traffic data, threat events, system logs and so
on to the cloud service platform, and the visual display is provided by CloudView . Users can monitor the device status, gain reports
and threat analysis through the Web or mobile phone APP. For more information about CloudView, refer to the CloudView FAQs.
o Cloud Sandbox: It is a technology adopted by the Sandbox function. After a suspicious file being uploaded to the Hillstone cloud ser-
vice platform, the cloud sandbox will collect behaviors of the file, analyze the collected data, verify the legality of the file, send the
analysis result to system and deal with the malicious file according to the actions set by system.
o CloudVista (Threat Intelligence Center): Threat Intelligence function can upload some elements in the logs generated by each mod-
ule to the cloud service platform, such as IP address, domain, etc. The cloud service platform will check whether the elements have
threat intelligence through the threat center. You can view threat intelligence information related to elements through the threat
intelligence center.
This example shows how to Obtain threat intelligence services through the Hillstone Cloud Service Platform.
The topology is shown as below. Device connects to theHillstone Cloud Service Platform, upload some elements in the logs generated
by each module to the cloud service platform and obtain the threat intelligence .
Preparation
2. Register a Cloud Service account. Enter the address "https://user.hillstonenet.com/login" in the web browser of the PC to
register.
Configuration Steps
o Address: cloud.hillstonenet.com.cn
o User: hillstone
o Password: password@123
Note: When using the default password to connect to the cloud platform, you can also get the corresponding cloud service,
but you cannot view the data uploaded by the device from the cloud platform.
After configuring the above steps, You can view the entries with threat intelligence on the ICenter page. In the threat list, hover your
cursor over a object, and there is a button to its right. The button appears on the right. Click this button and select View threat intel-
ligence.
Data Security
The data security allows you to flexibly configure control rules to comprehensively control and audit (by behavior logs ) on user net-
work behavior.
o "Decrypting HTTPS Traffic and Identifying the Encrypted Application" on Page 378
o "URL Filtering for HTTPS Traffic without the CA Certificate" on Page 382
As shown in the below scenario, an internal user accesses a HTTPS website and the traffic is encrypted by SSL protocol. With the SSL
proxy and application identification functions enabled, the device can decrypt the HTTPS traffic and identify the encrypted application.
Configuration Steps
o Name: profile1
o Warning: Enable
o Content: CA Certificate
o Action: Export
Step 4: Upgrading to the professional application signature database and enabling the application identification function
Step 4: Upgrading to the professional application signature database and enabling the application identification function
As shown in the following topology, Hillstone device works as the gateway of an enterprise. The ethernet0/0 connects the Internet and
belongs to the untrust zone. The ethernet0/1 connects to the Intranet and belongs to the trust zone.
With the configured URL filtering rule, staff of the enterprise (the network segment: 10.100.0.0/16) are prohibited from accessing
shopping websites and the entertainment websites https:// www.bcd.com during working hours (09:00 to 18:00, Monday to Friday).
The access and search attempts will be logged.
Preparation
Before configuring the URL filtering function, prepare the following first:
Configuration Steps
o Name: workday
o Type: Days.
Step 2: Configure the user-defined URL category named bcd that contains https://www.bcd.com
Step 2: Configure the user-defined URL category named bcd that contains https://www.bcd.com
o Category: bcd
Step 3: Configure the URL filtering rule named URLcontrol, and enable the SSL Inspection
o Name: URLcontrol
o Name: policy1
Step 5: Result
IPv6
StoneOS is dual-stack firmware that supports both IPv4 and IPv6. It also supports tunneling technique (the latest version supports
manual IPv6 tunnel) for IPv6 communication.
o "Realizing FTP Service in IPv6-only or IPv4/IPv6 Hybrid Networks Using ALG" on Page 399
o "Realizing SIP Communication in IPv6-only or IPv4/IPv6 Hybrid Networks Using ALG" on Page 408
o "Realizing Dual-stack Host in IPv4 Network Accessing IPv6 Network Via ISATAP Tunnel" on Page 419
o "Allowing Communication Between IPv6 networks by Configuring a 6RD Tunnel" on Page 422
o The IPv6 network of headquarters can connect with the IPv4 Internet and be accessed by the Internet users.
o The networks of headquarters can connect with the IPv6 network of branch A via 6in4 tunnel.
o The networks of headquarters can connect with the IPv4 network of branch B.
The headquarters, branch A and branch B is deployed with a Hillstone device separately and the topology is as follows:
hostname(config-if-eth0/1)# exit
hostname(config-if-eth0/2)# dns-proxy
hostname(config-if-eth0/2)# exit
hostname(config-if-tun1)# exit
Step 2: Configure the route and NAT rules, including headquarters accessing the Internet, headquarters communicating with
branch B, and public IP accessing IPv6 server of headquarters.
hostname(config-vrouter)# snatrule id 1 from 2005::/96 to 2003::/96 service any eif ethernet0/1 trans-
to eif-ip mode dynamicport
hostname(config-vrouter)# snatrule id 2 from 2005::2/96 to 2004::2 service any eif ethernet0/1 trans-
to eif-ip mode dynamicport
hostname(config-vrouter)# snatrule id 3 from any to 200.0.0.2 service any eif ethernet0/2 trans-to
2005::1 mode dynamicport
hostname(config-vrouter)# exit
hostname(config)# policy-global
hostname(config-policy)# rule id 1
Rule id 1 is created
hostname(config-policy-rule)# exit
hostname(config)# policy-global
hostname(config-policy)# rule id 2
Rule id 2 is created
hostname(config-policy-rule)# exit
hostname(config)# policy-global
hostname(config-policy)# rule id 3
Rule id 3 is created
hostname(config-policy-rule)# exit
hostname(config)# policy-global
hostname(config-policy)# rule id 4
Rule id 4 is created
hostname(config-policy-rule)# exit
hostname(config)# policy-global
hostname(config-policy)# rule id 5
Rule id 5 is created
hostname(config-policy-rule)# exit
hostname(config)# policy-global
hostname(config-policy)# rule id 6
Rule id 6 is created
hostname(config-policy-rule)# exit
hostname(config-ip6in4-manual)# exit
Note: The ipv6 dns64-proxy command is not supported for some versions.
hostname(config-if-eth0/1)# exit
hostname(config-if-eth0/2)# exit
hostname(config-if-tun1)# exit
hostname(config-vrouter)# exit
hostname(config)# policy-global
hostname(config-policy)# rule id 31
Rule id 31 is created
hostname(config-policy-rule)# exit
hostname(config)# policy-global
hostname(config-policy)# rule id 32
Rule id 32 is created
hostname(config-policy-rule)# exit
hostname(config)# policy-global
hostname(config-policy)# rule id 33
Rule id 33 is created
hostname(config-policy-rule)# exit
hostname(config)# policy-global
hostname(config-policy)# rule id 34
Rule id 34 is created
hostname(config-policy-rule)# exit
hostname(config-ip6in4-manual)# exit
hostname(config-if-eth0/1)# exit
hostname(config-if-eth0/4)# exit
hostname(config-vrouter)# snatrule id 1 from any to any service any eif ethernet0/4 trans-to eif-ip
mode dynamicport
hostname(config-vrouter)# exit
hostname(config)# policy-global
hostname(config-policy)# rule id 35
Rule id 35 is created
hostname(config-policy-rule)# exit
o Scenario 1: IPv6-only network. In the topology below, an enterprise sets up a Hillstone security device as the export gateway to
connect internal network with the Internet. Both internal and external network IP addresses are deployed with IPv6 addresses.
With the ALG function configured, the internal FTP client can access the FTP server in the extranet.
o Scenario 2: IPv4 network to IPv6 network. In the topology below, an enterprise sets up a Hillstone security device as the export
gateway to connect internal network with the Internet. The internal network is deployed with IPv4 addresses and the external net-
work is deployed with IPv6 addresses. With the ALG function configured, the internal FTP client can access the FTP server in the
extranet.
o Scenario 3: IPv6 network to IPv4 network. In the topology below, an enterprise sets up a Hillstone security device as the export
gateway to connect internal network with the Internet. The internal network is deployed with IPv6 addresses and the external net-
work is deployed with IPv4 addresses. With the ALG function configured, the internal FTP client can access the FTP server in the
extranet.
Realizing FTP Service in IPv6-only or IPv4/IPv6 Hybrid Networks Using ALG 399
StoneOS Cookbook
Before starting the configuration, you need to ensure that the configuration of the FTP server and the FTP client has been completed.
This example only describes the relevant configuration on the device.
hostname(config-if-eth0/1)# exit
hostname(config-if-eth0/2)# exit
Rule id 1 is created
hostname(config-policy)# rule id 1
hostname(config-policy-rule)# exit
400 Realizing FTP Service in IPv6-only or IPv4/IPv6 Hybrid Networks Using ALG
StoneOS Cookbook
session: id 44, proto 6, flag 0, flag1 20000, flag2 0, flag3 0, created 39340, life 1787, policy 1,app 4(FTP)
flag 0x1, auth_user_id 0, reverse_auth_user_id 0
flow0(32(ethernet0/2)/40308b10): [2003::2]:64348->[2001::2]:21
flow1(31(ethernet0/1)/308b10): [2001::2]:21->[2003::2]:64348
session: id 2, proto 6, flag 8000000, flag1 20000, flag2 0, flag3 0, created 39408, life 1800, policy 1,app
70(FTP-DATA) flag 0x0, auth_user_id 0, reverse_auth_user_id 0
flow0(31(ethernet0/1)/208810): [2001::2]:20->[2003::2]:64363
flow1(32(ethernet0/2)/40208810): [2003::2]:64363->[2001::2]:20
session: id 61, proto 6, flag 10000, flag1 20000, flag2 0, flag3 0, created 39683, life 1775, policy 1,app 4
(FTP) flag 0x0, auth_user_id 0, reverse_auth_user_id 0
flow0(32(ethernet0/2)/40308b10): [2003::2]:64362->[2001::2]:21
flow1(31(ethernet0/1)/308b10): [2001::2]:21->[2003::2]:64362
session: id 22, proto 6, flag 8000000, flag1 20000, flag2 0, flag3 0, created 39684, life 1776, policy 1,app
70(FTP-DATA) flag 0x0, auth_user_id 0, reverse_auth_user_id 0
flow0(32(ethernet0/2)/40208810): [2003::2]:64398->[2001::2]:56008
flow1(31(ethernet0/1)/208810): [2001::2]:56008->[2003::2]:64398
Realizing FTP Service in IPv6-only or IPv4/IPv6 Hybrid Networks Using ALG 401
StoneOS Cookbook
hostname(config-if-eth0/1)# exit
hostname(config-if-eth0/2)# exit
Rule id 1 is created
hostname(config-policy)# rule id 1
hostname(config-policy-rule)# exit
402 Realizing FTP Service in IPv6-only or IPv4/IPv6 Hybrid Networks Using ALG
StoneOS Cookbook
hostname(config)# nat
hostname(config-nat)# snatrule id 1 from any to 192.168.2.10 service any trans-to 2001::10 mode
dynamicport
rule ID=1
rule ID=1
hostname(config-nat)# exit
Realizing FTP Service in IPv6-only or IPv4/IPv6 Hybrid Networks Using ALG 403
StoneOS Cookbook
session: id 64, proto 6, flag e, flag1 20007, flag2 0, flag3 0, created 133143, life 1797, policy 2,app 4(FTP)
flag 0x1, auth_user_id 0, reverse_auth_user_id 0
flow0(32(ethernet0/2)/40300b10): 192.168.2.2:58259->192.168.2.10:21
flow1(31(ethernet0/1)/308b10): [2001::2]:21->[2001::10]:1025
session: id 14, proto 6, flag 8000016, flag1 2000b, flag2 0, flag3 0, created 133147, life 297, policy 2,app
70(FTP-DATA) flag 0x0, auth_user_id 0, reverse_auth_user_id 0
flow0(31(ethernet0/1)/208810): [2001::2]:20->[2001::10]:58261
flow1(32(ethernet0/2)/40200810): 192.168.2.2:58261->192.168.2.10:20
session: id 20, proto 6, flag e, flag1 20007, flag2 0, flag3 0, created 133393, life 1797, policy 2,app 4(FTP)
flag 0x1, auth_user_id 0, reverse_auth_user_id 0
flow0(32(ethernet0/2)/40300b10): 192.168.2.2:58272->192.168.2.10:21
flow1(31(ethernet0/1)/308b10): [2001::2]:21->[2001::10]:1030
session: id 2, proto 6, flag 800000e, flag1 20007, flag2 0, flag3 0, created 133397, life 1797, policy 2,app
70(FTP-DATA) flag 0x0, auth_user_id 0, reverse_auth_user_id 0
flow0(32(ethernet0/2)/40200810): 192.168.2.2:58273->192.168.2.10:61665
flow1(31(ethernet0/1)/208810): [2001::2]:61665->[2001::10]:61665
404 Realizing FTP Service in IPv6-only or IPv4/IPv6 Hybrid Networks Using ALG
StoneOS Cookbook
hostname(config-if-eth0/1)# exit
hostname(config-if-eth0/2)# exit
Rule id 1 is created
hostname(config-policy)# rule id 1
hostname(config-policy-rule)# exit
Realizing FTP Service in IPv6-only or IPv4/IPv6 Hybrid Networks Using ALG 405
StoneOS Cookbook
hostname(config)# nat
hostname(config-nat)# snatrule id 1 from ipv6-any to 2003::10 service any trans-to 192.168.1.10 mode
dynamicport
rule ID=1
rule ID=1
hostname(config-nat)# exit
406 Realizing FTP Service in IPv6-only or IPv4/IPv6 Hybrid Networks Using ALG
StoneOS Cookbook
session: id 6, proto 6, flag e, flag1 2000b, flag2 0, flag3 0, created 40792, life 1799, policy 1,app 4(FTP)
flag 0x1, auth_user_id 0, reverse_auth_user_id 0
flow0(32(ethernet0/2)/40308b10): [2003::2]:64537->[2003::10]:21
flow1(31(ethernet0/1)/300b10): 192.168.1.2:21->192.168.1.10:1034
session: id 5, proto 6, flag 8000016, flag1 20007, flag2 0, flag3 0, created 40798, life 1799, policy 1,app
70(FTP-DATA) flag 0x0, auth_user_id 0, reverse_auth_user_id 0
flow0(31(ethernet0/1)/200810): 192.168.1.2:20->192.168.1.10:64538
flow1(32(ethernet0/2)/40208810): [2003::2]:64538->[2003::10]:20
session: id 21, proto 6, flag e, flag1 2000b, flag2 0, flag3 0, created 40093, life 1799, policy 1,app 4(FTP)
flag 0x1, auth_user_id 0, reverse_auth_user_id 0
flow0(32(ethernet0/2)/40308b10): [2003::2]:64435->[2003::10]:21
flow1(31(ethernet0/1)/300b10): 192.168.1.2:21->192.168.1.10:1026
session: id 14, proto 6, flag 800000e, flag1 2000b, flag2 0, flag3 0, created 40099, life 300, policy 1,app 70
(FTP-DATA) flag 0x0, auth_user_id 0, reverse_auth_user_id 0
flow0(32(ethernet0/2)/40208810): [2003::2]:64436->[2003::10]:56075
flow1(31(ethernet0/1)/200810): 192.168.1.2:56075->192.168.1.10:56075
Realizing FTP Service in IPv6-only or IPv4/IPv6 Hybrid Networks Using ALG 407
StoneOS Cookbook
o Scenario 1: IPv6-only network. In the topology below, an enterprise sets up a Hillstone security device as the export gateway to
connect internal network with the Internet. Both internal and external network IP addresses are deployed with IPv6 addresses.
With the ALG function configured, the internal SIP UC1 and the external SIP UC3 can successfully establish communication with
each other.
o Scenario 2: IPv4 network to IPv6 network. In the topology below, an enterprise sets up a Hillstone security device as the export
gateway to connect internal network with the Internet. The internal network is deployed with IPv4 addresses and the external net-
work is deployed with IPv6 addresses. With the ALG function configured, the internal SIP UC1 and the external SIP UC3 can suc-
cessfully establish communication with each other.
Realizing SIP Communication in IPv6-only or IPv4/IPv6 Hybrid Networks Using ALG 408
StoneOS Cookbook
o Scenario 3: IPv6 network to IPv4 network. In the topology below, an enterprise sets up a Hillstone security device as the export
gateway to connect internal network with the Internet. The internal network is deployed with IPv6 addresses and the external net-
work is deployed with IPv4 addresses. With the ALG function configured, the internal SIP UC1 and the external SIP UC3 can suc-
cessfully establish communication with each other.
409 Realizing SIP Communication in IPv6-only or IPv4/IPv6 Hybrid Networks Using ALG
StoneOS Cookbook
Before starting the configuration, you need to ensure that the configuration of the SIP Server and the SIP user agent (SIP UC) has been
completed. This example only describes the relevant configuration on the device.
Realizing SIP Communication in IPv6-only or IPv4/IPv6 Hybrid Networks Using ALG 410
StoneOS Cookbook
hostname(config-if-eth0/1)# exit
hostname(config-if-eth0/2)# exit
Rule id 1 is created
hostname(config-policy)# rule id 1
hostname(config-policy-rule)# exit
411 Realizing SIP Communication in IPv6-only or IPv4/IPv6 Hybrid Networks Using ALG
StoneOS Cookbook
View the information of media pinhole. Total pinhole count is 5, including 1 register pinhole and 4 media
pinhole.
[Pinhole0]========================================
Seq 10
Flag: Enabled,
[Ingress info]---------------------------------------------------
[Egress info]----------------------------------------------------
[Life info]------------------------------------------------------
After_hit 600
Before_hit 120
Timer 217
[Other info]-----------------------------------------------------
Auth_user_id 0
Realizing SIP Communication in IPv6-only or IPv4/IPv6 Hybrid Networks Using ALG 412
StoneOS Cookbook
hostname(config-if-eth0/1)# exit
hostname(config-if-eth0/2)# exit
Rule id 1 is created
hostname(config-policy)# rule id 1
hostname(config-policy-rule)# exit
413 Realizing SIP Communication in IPv6-only or IPv4/IPv6 Hybrid Networks Using ALG
StoneOS Cookbook
hostname(config)# nat
hostname(config-nat)# snatrule id 1 from any to 192.168.1.10 service any trans-to 2003::10 mode
dynamicport
rule ID=1
rule ID=1
hostname(config-nat)# exit
Realizing SIP Communication in IPv6-only or IPv4/IPv6 Hybrid Networks Using ALG 414
StoneOS Cookbook
View the information of media pinhole. Total pinhole count is 5, including 1 register pinhole and 4 media
pinhole.
[Pinhole
1]========================================================-
====
Seq 15
Flag: Enabled,
[Ingress info]---------------------------------------------------
[Egress info]----------------------------------------------------
[Life info]------------------------------------------------------
After_hit 600
Before_hit 120
Timer 38
[Other info]-----------------------------------------------------
Auth_user_id 0
415 Realizing SIP Communication in IPv6-only or IPv4/IPv6 Hybrid Networks Using ALG
StoneOS Cookbook
hostname(config-if-eth0/1)# exit
hostname(config-if-eth0/2)# exit
Rule id 1 is created
hostname(config-policy)# rule id 1
hostname(config-policy-rule)# exit
Realizing SIP Communication in IPv6-only or IPv4/IPv6 Hybrid Networks Using ALG 416
StoneOS Cookbook
hostname(config)# nat
hostname(config-nat)# snatrule id 1 from ipv6-any to 2001::10 service any trans-to 192.168.2.10 mode
dynamicport
rule ID=1
rule ID=1
hostname(config-nat)# exit
417 Realizing SIP Communication in IPv6-only or IPv4/IPv6 Hybrid Networks Using ALG
StoneOS Cookbook
View the information of media pinhole. Total pinhole count is 5, including 1 register pinhole and 4 media
pinhole.
[Pin-
hole1]====================================================
Seq 36
Flag: Enabled,
[Ingress info]---------------------------------------------------
[Egress info]----------------------------------------------------
[Life info]------------------------------------------------------
After_hit 600
Before_hit 120
Timer 107
[Other info]-----------------------------------------------------
Auth_user_id 0
Realizing SIP Communication in IPv6-only or IPv4/IPv6 Hybrid Networks Using ALG 418
StoneOS Cookbook
In the topology below, PC supports dual protocol stacks. Hillstone device is connected to the corresponding IPv6 network and IPv4 net-
work. It is required to configure the ISATAP tunnel so that the dual-stack host PC in the IPv4 network can access the server in the
intranet IPv6 network.
Configuration Steps
hostname(config-if-eth0/1)# exit
hostname(config-if-eth0/2)# exit
Realizing Dual-stack Host in IPv4 Network Accessing IPv6 Network Via ISATAP Tunnel 419
StoneOS Cookbook
hostname(config-ip6in4-isatap)# exit
hostname(config)#
Configure the tunnel interface and bind the tunnel interface to the ISATAP tunnel.
hostname(config-if-tun1)# exit
hostname(config)#
420 Realizing Dual-stack Host in IPv4 Network Accessing IPv6 Network Via ISATAP Tunnel
StoneOS Cookbook
hostname(config)# policy-global
hostname(config-policy)# rule id 1
Rule id 1 is created
hostname(config-policy-rule)# exit
hostname(config)#
The dual-stack host (10.1.2.2) can access the IPv6 Server (3001::8) through FTP successfully.
Realizing Dual-stack Host in IPv4 Network Accessing IPv6 Network Via ISATAP Tunnel 421
StoneOS Cookbook
* This example is used in a laboratory environment. Please configure the IP addresses of each interface according to the actual con-
nections.
The figure above shows the network topology. This example includes the following two scenarios:
o Scenario 1: 6RD Domain -6RD Domain.The headquarters deploys a Hillstone security device Device and branch A deploys a Hill-
stone security device Device A. Device and Device A support both IPv4 and IPv6 and they are CE devices. Both Device and
Device A are connected to the IPv6 network on one end and the IPv4 network on the other end. Assume that the ISP provides an
IPv6 prefix of 1001:AABB::/32. To allow hosts in two different 6RD domains to communicate, you need to configure a 6RD tun-
nel between Device and Device A.
o Scenario 2: 6RD Domain -IPv6 Network.The headquarters deploys a Hillstone security device Device and branch B deploys a Hill-
stone security device Device B. Both Device and Device B are connected to the IPv6 network on one end and the IPv4 network on
the other end. Device in headquarters is a 6RD CE device and connects to the 6RD domain, which is an IPv6 network. Device B in
branch B is a 6RD BR device and connects to a regular IPv6 network outside the 6RD domain. To allow hosts in the 6RD domain
and IPv6 network to communicate, you need to configure a 6RD tunnel between Device and Device B.
Configuration Tips
For the 6RD Domain -6RD Domain in Scenario 1, the addresses of devices and PC1 at the headquarters and branch A need to meet
the following requirements:
o The IPv6 prefix of the interface ethernet0/1 on the headquarters device (Device) needs to be consistent with the 6RD delegated
prefix calculated by device. (In this example, the 6RD delegated prefix is 1001: AABB: A05::/48)
o The IP address of PC1 and the interface ethernet0/1 of the headquarters device (Device) need to belong to the same IPv6 network
segment. The IP address of PC2 and the interface ethernet0/1 of the branch A device (Device A) need to belong to the same IPv6
network segment.
o The headquarters device (Device) and branch A device (Device A) need to have the same IPv4 prefix for ethernet0/1, and this pre-
fix length needs to be the same as that of the IPv4 prefix configured on the 6RD tunnel (In this example, the IPv4 prefix length is
ipv4-mask-len 16 ).
Step 1: Configure the IPv4 address and zone of the interface ethernet 0/0 of the headquarters device (Device).
hostname(config-if-eth0/0)# exit
hostname(config-ip6in4-6rd)# exit
Note: After you specify the 6RD prefix and IPv4 prefix length, the 6RD CE automatically calculates the 6RD delegated
prefix. To view the 6RD delegated prefix via command show ip6in4 6rd-tunnel [tunnel-name].
hostname(config-if-tun1)# exit
Name: test
Index: 11
Interface: ethernet0/0
IPv6-prefix: 1001:AABB::/32
IPv4-mask-length: 16
Border-relay-address: 0.0.0.0
Sub-tunnel Limit: 10
Step 5: Configure the IPv6 address and zone of the interface ethernet 0/1 of the headquarters device (Device).
hostname(config)#1interface ethernet0/1
hostname(config-if-eth0/1)# exit
hostname(config-vrouter)# exit
hostname(config)# policy-global
hostname(config-policy)# rule id 1
Rule id 1 is created
hostname(config-policy-rule)# exit
hostname(config)#
Set the address to 1001:AABB:A05::2/48 for PC1 based on the 6RD delegated prefix,. This address is in the same network segment as
that of ethernet0/1 of Device.
Note:The method for configuring IPv6 addresses and default route varies based on the operating system of your PC.
Configure Device A
Step 1: Configure the IPv4 address and zone of the interface ethernet 0/0 of the Device A
hostname(config-if-eth0/0)# exit
hostname(config-ip6in4-6rd)# exit
Note: After you specify the 6RD prefix and IPv4 prefix length, the 6RD CE automatically calculates the 6RD delegated
prefix. To view the 6RD delegated prefix via command show ip6in4 6rd-tunnel [tunnel-name].
hostname(config-if-tun1)# exit
Name: test
Index: 11
Interface: ethernet0/0
IPv6-prefix: 1001:AABB::/32
IPv4-mask-length: 16
Border-relay-address: 0.0.0.0
Sub-tunnel Limit: 10
Step 5: Configure the IPv6 address and zone of the interface ethernet 0/1 of the Device A.
hostname(config)#1interface ethernet0/1
hostname(config-if-eth0/1)# exit
hostname(config-vrouter)# exit
hostname(config)# policy-global
hostname(config-policy)# rule id 1
Rule id 1 is created
hostname(config-policy-rule)# exit
hostname(config)#
Set the address to 1001:AABB:A05::2/48 for PC2 based on the 6RD delegated prefix. This address is in the same network segment as
that of ethernet0/1 of Device A.
Note:The method for configuring IPv6 addresses and default route varies based on the operating system of your PC.
Step 1: Configure the IPv4 address and zone of the interface ethernet 0/0 of the headquarters device (Device).
hostname(config-if-eth0/0)# exit
hostname(config-ip6in4-6rd)# exit
Note: After you specify the 6RD prefix and IPv4 prefix length, the 6RD CE automatically calculates the 6RD delegated
prefix. To view the 6RD delegated prefix via command show ip6in4 6rd-tunnel [tunnel-name].
hostname(config-if-tun1)# exit
Name: test
Index: 11
Interface: ethernet0/0
IPv6-prefix: 1001:AABB::/32
IPv4-mask-length: 16
Border-relay-address: 220.119.10.8
Sub-tunnel Limit: 10
Step 5: Configure the IPv6 address and zone of the interface ethernet 0/1 of the headquarters device (Device)
hostname(config)#1interface ethernet0/1
hostname(config-if-eth0/1)# exit
hostname(config-vrouter)# exit
hostname(config)# policy-global
hostname(config-policy)# rule id 1
Rule id 1 is created
hostname(config-policy-rule)# exit
hostname(config)#
Set the address to 1001:AABB:A05::2/48 for PC1 based on the 6RD delegated prefix. This address is in the same network segment as
that of ethernet0/1 of Device.
Note:The method for configuring IPv6 addresses and default route varies based on the operating system of your PC.
Configure Device B
Step 1: Configure the IPv4 address and zone of the interface ethernet 0/0 of the Device B.
hostname(config-if-eth0/0)# exit
hostname(config-ip6in4-6rd)# exit
Note: After you specify the 6RD prefix and IPv4 prefix length, the 6RD CE automatically calculates the 6RD delegated
prefix. To view the 6RD delegated prefix via command show ip6in4 6rd-tunnel [tunnel-name].
hostname(config-if-tun1)# exit
Name: test
Index: 11
Interface: ethernet0/0
IPv6-prefix: 1001:AABB::/32
IPv4-mask-length: 16
Border-relay-address: 0.0.0.0
Sub-tunnel Limit: 10
Step 5: Configure the IPv6 address and zone of the interface ethernet 0/1 of the Device B.
hostname(config)#1interface ethernet0/1
hostname(config-if-eth0/1)# exit
hostname(config-vrouter)# exit
hostname(config)# policy-global
hostname(config-policy)# rule id 1
Rule id 1 is created
hostname(config-policy-rule)# exit
hostname(config)#
Set the address to 2333:aabb::2/64 for PC3 , this address is in the same network segment as that of ethernet0/1 of Device B.
Note:The method for configuring IPv6 addresses and default route varies based on the operating system of your PC.
Result of Scenario 1
Step 1: Use the Ping command on Device to view the tunnel established between headquarters and branch A and their con-
nectivity.
1 64 0.109
2 64 0.131
3 64 0.115
4 64 0.128
5 64 0.110
statistics:
session: id 3407871, proto 41, flag 20, flag1 0, flag2 0, flag3 0, created 272719, life 64000, policy type 0,
policy default, app 0(Other) flag 0x0, auth_user_id 0, reverse_auth_user_id 0
flow0(32(ethernet0/0)/200951): 220.119.10.9:0->220.119.10.5:0
Result of Scenario 2
Step 1: Use the Ping command on Device to view the tunnel established between headquarters and branch B and their con-
nectivity.
1 64 0.115
2 64 0.120
3 64 0.113
4 64 0.112
5 64 0.126
statistics:
session: id 3407871, proto 41, flag 20, flag1 0, flag2 0, flag3 0, created 272719, life 64000, policy type 0,
policy default, app 0(Other) flag 0x0, auth_user_id 0, reverse_auth_user_id 0
flow0(32(ethernet0/0)/200951): 220.119.10.8:0->220.119.10.5:0
Change Log
Cookbook V1
1. " Using Security Policy to Allow Access to Another Zone" on Page 15 (Security Policy)
4. "Allowing the Internet Access via User Authentication" on Page 95 (User Authentication, WebAuth)
5. "Connection between Two Private Networks Using IPSec VPN (IKEv1)" on Page 145 (IPSec VPN)
6. "Allowing Remote Users to Access a Private Network Using SSL VPN" on Page 194 (SSL VPN, SCVPN)
7. " Ensuring Uninterrupted Connection Using HA" on Page 317 (High Availability, HA)
8. " QoS Control" on Page 339 (Quality of Service, QoS, Traffic Management)
Cookbook V2
1. "Protecting Internal Servers and Host to Defend Attack via Abnormal Behavior Detection" on Page 352 (Abnormal Behavior
Detection, ABD)
2. Finding Malware Attacks via Advanced Threat Detection (Advanced Threat Detection, ATD)
Cookbook V3
1. "Decrypting HTTPS Traffic and Identifying the Encrypted Application" on Page 378 (SSL Proxy, Decryption, Encrytion)
2. "Using an iOS/Android Device to Remotely Access Intranet Services" on Page 214 (iOS, Android, Mobile, iPad, remote device,
SSL VPN)
4. "Deploying Tap Mode to Monitor Network Traffic " on Page 31(Tap Mode)
Cookbook V4
2. "Allowing Remote Users ( PC ) to Access a Private Network Using L2TP over IPSec VPN" on Page 222 (L2TP VPN)
3. "Connection between Two Private Networks Using GRE over IPSec VPN" on Page 256 (GRE, IPSec VPN)
Cookbook V5
1. "Protecting Intranet to Defend Attacks via Intrusion Prevention System" on Page 359( IPS )
1. "Protecting Internal Servers and Host to Defend Attack via Abnormal Behavior Detection" on Page 352( ABD )
Cookbook V6
1. "Allowing Remote Users (iOS/Android) to Access a Private Network Using L2TP over IPSec VPN" on Page 241 (L2TP VPN)
Cookbook V7
5. "URL Filtering for HTTPS Traffic without the CA Certificate" on Page 382
Cookbook V8
1. "Connection between Two Private Networks Using IPSec VPN (IKEv2)" on Page 158 (IPSec VPN)
3. "Configuring the Device to Communicate with Zabbix Using SNMP" on Page 40 (SNMP)
Cookbook V8.1
1. "Connecting to Microsoft Azure Using Site-to-Site VPN" on Page 203 (IPSec VPN)
Cookbook V9
2. "Dynamically Manage Access Authority Via Radius Dynamic Authorization" on Page 46 (Authorization)
3. "Realizing Multicast Forwarding Through PIM-SM Multicast Protocol" on Page 71 (Routing, PIM)
4. "Realizing Multicast Forwarding Through PIM-SSM Multicast Protocol" on Page 80 (Routing, PIM)
8. "Realizing FTP Service in IPv6-only or IPv4/IPv6 Hybrid Networks Using ALG" on Page 399(IPv6)
9. "Realizing SIP Communication in IPv6-only or IPv4/IPv6 Hybrid Networks Using ALG" on Page 408 (IPv6)
10. "Realizing Dual-stack Host in IPv4 Network Accessing IPv6 Network Via ISATAP Tunnel" on Page 419 (IPv6)
Cookbook V10
1. "Deploying HA Scenario for Multicast Forwarding Through PIM-SM" on Page 87 (Routing, PIM)
3. "Allowing Remote Users ( PC ) to Access a Private Network Using L2TP and SSL VPN" on Page 275(SSL VPN L2TP VPN)
4. "Threat Intelligence Via Hillstone Cloud Service Platform" on Page 374(Hillstone Cloud Service Platform)
1. "Allowing Remote Users to Access a Private Network Using SSL VPN" on Page 194 (Add the scene of using the Two-Step Veri-
fication function and communicating through TCP.)
Cookbook V11
1. "Binding the Log Processing Process and Database Storage Process to Core MAX" on Page 67 (Core MAX)
2. "Making Two Firewalls Working in Hot Standby Mode by Deploying them in HA Peer to Ensure the Continuity of Service " on
Page 325(HA)
3. "Using Two Devices as Gateways to Forward Business Traffic and Back Up Each Other Based on HSVRP, which Rnsures
Uniterrupted Business Traffic" on Page 330(HA)
4. "Establishment of IPSec VPN Based on Certificate Authentication " on Page 168 (IPSec VPN)
5. "Realizing Dynamic Switch between IPSec Links Using IPSec VPN Smart Link" on Page 181 (IPSec VPN)
6. "Allowing Communication Between IPv6 networks by Configuring a 6RD Tunnel" on Page 422 (IPv6)
7. " Windows User Remotely Accessing Internal Server Through ZTNA" on Page 289 (ZTNA)
8. " Android User Remotely Accessing Internal Server Through ZTNA" on Page 306 (ZTNA)