- DrayOS 4, imported, syslog, firewall_filter, brute_force_protection, blacklist, vpn_blocking, local_filter, country_filter
How to block an unknown IP address which keeps dialing VPN to Vigor Router? (DrayOS4)
Since firmware 4.4.0, Vigor Router supports the local filter that can be applied for Vigor Router itself. With the local filter, we can block some unknown IP addresses which keep dialing the VPN or keep trying to access the router with the HTTP protocol. Moreover, we can also block IPs from specified countries to prevent the attack by the IP from a specified country. In this article, we demonstrate some practical applications for the local filter.
Application 1: Add the unknown IP into IP Blacklist
- Go to Firewall >> Defense Setup and enable Dos Defense.
- Click White/Black IP List Option.
Select log if you want to see from Syslog Explorer.
Input the unknown peer's IP and click Add to add the IP into Black IP List.
| Note: | The Source IP supports 4 options to define IP properties. |
| IP can input single IP address. | |
| IP Object can apply to object profile defined in Objects Setting >> IP Object in advance. | |
| IP Group can apply to group object profile defined in Objects Setting >> IP Group in advance. | |
| Country Object can only apply to object profile defined in Objects Setting >> Country Object in advance. |
In the Syslog, we will receive an alert from the router when the IP in blacklist attempt to access.
Application 2: Allow the VPN service from a specified country
- Go to Objects Setting >> Country Object to create a profile.
- Give a profile name.
- Add the country we would like to allow.
- Click OK to save.
-
Go to Objects Setting >> Service Type Object to create a profile.
Here we take SSL VPN for example.- Give a profile name.
- Choose the protocol this service uses.
- Enter the port this service would use in Destination Port.
- Click OK to save.
-
Note: Different service uses different service port PPTP -> TCP 1723, GRE(protocol 47) L2TP -> TCP 1701, UDP 500/4500 IPsec -> UDP 500/4500, ESP(protocol 50) SSL -> TCP 443 OpenVPN -> TCP 443/1194, UDP 1194 -
(Optional) If we want to block many services, we can add those service objects into the Service Type Group.
-
Go to Firewall >> Filter Setup to create a rule that block the VPN service from any Source IP.
- Enable this rule.
- Choose WAN->Localhost for Direction.
- Select Any on Source IP/Country.
- Select the Service Object(or Service Group) created in Step2 on Service Type.
- Choose Block If no further match for Filter. (Check Syslog to show the logs of this rule.)
- Click OK to save.

- Create another rule to allow the specified country to use this service.
- Enable this rule.
- Choose WAN->Localhost for Direction.
- Select the Country Object created in step1 on Source IP/Country.
- Select the Service Object(or Service Group) created in Step2 on Service Type.
- Choose Pass Immediately for Filter. (Check Syslog to show the logs of this rule.)
- Click OK to save.
-
Note: If the service is SSL VPN, please change the HTTPS Management Port of the router. Otherwise, the firewall rule would also block the access of the router's WUI page.

-
In the Syslog, we will see the firewall logs when an IP from this country tries to dial a VPN connection.


Application 3: Block VPN connection by Brute Force Protection
Vigor Router supports VPN server options in Brute Force Protection which enables users to deny VPN account login attempts from brute-force attack.
- Go to System Maintenance >> Management to set up Brute Force Protection.
- enable Brute Force Protection.
- select VPN server option.
- setup Maximum login failures from 1 to 255 times.
-
setup Penalty period from 1 to 31536000 seconds(365 days).
-
In the Syslog, we will see firewall logs that peer with the same IP will be denied by Brute Force Protection after it has exceeded maximum login failure time.
To learn how to use Syslog Utility to collect the syslog, please refer to the article Collecting router's Syslog
Note: DrayTek Routers includes GeoLite2 data created by MaxMind, available from https://www.maxmind.com.
