[KONG series ten] IP black and white list ip-restriction limit plugin

IP restricted plugins

IP restriction plug-in, is a very simple plug-in, you can set blacklist IP, whitelist IP This is very simple.

Rules:

IP black and white lists, support single, multiple, range points Segment IP (satisfies the CIDR notation rule). Separate multiple IPs with a comma ,.

CIDR notationThe specifications are as follows:

10.10.10.0/24 < /span>means that 10.10.10.* cannot be accessed.

About CIDR notation Rules are beyond the scope of this article, please refer to it yourselfhttps://zh.wikipedia.org/wiki/%E6%97%A0%E7%B1%BB%E5%88% AB%E5%9F%9F%E9%97%B4%E8%B7%AF%E7%94%B1

1.Set up a blacklist< span class="s1">IP

Here, I will blacklist my own IP< span class="s1">.

The access results are as follows:

{

“message”: “Your IP address is not allowed”< /p>

}

2.< /span>Set up a whitelist

Here is an interesting experiment. If I also set my IP as a whitelist, and Set to blacklist.

So, will the blacklist take effect? Is it a whitelist?

Let’s try it out:

Visit the interface again, and the result is returned correctly:

{

“status”: “UP”,

“diskSpace”: {

“status” : “UP”,

“total”: 19992150016,

” free”: 15094071296,

“threshold”: 10485760

},

“redis”: {

“status”: “UP” ,

“version”: “3.2.5”

},

“db”: {

“status”: “UP” ,

“database”: “MySQL”,

“hello”: 1

},

“configServer”: {

“status”: “UP”,

“propertySources”: [

“file:/opt/configServer/configs/application.yml#dev”,

“file:/opt/configServer/configs/application.yml”

]

< p class="p4"> }

}

From this, we can conclude that if consumer’sip, at the same time match IP in the black and white list, then the white list will take priority. In fact, if you set both a whitelist and a blacklist at the same timeIPis inconsistent, the system will prompt youyou cannot set both a whitelist and a blacklist !


WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 1676 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.