我用的 openwrt ,日志上天天有国外 ip ,我现在对外端口全部通过 nginx 代理,包括 http ,ssh 等, 只要是国外 ip 就返回 404, 同时监视日志只要是国外 ip 就丢到 ipset 里面永久封禁:
```
{"msec": "1695250093.634", "connection": "11974", "connection_requests": "1", "pid": "28", "request_id": "04618a16e27a69de2c2dd35d3be619e2", "request_length": "118", "remote_addr": "165.227.180.202", "remote_user": "", "remote_port": "45458", "time_local": "21/Sep/2023:06:48:13 +0800", "time_iso8601": "2023-09-21T06:48:13+ 08:00", "request": "GET /ab2g HTTP/1.1", "request_uri": "/ab2g", "args": "", "code": "404", "body_bytes_sent": "118", "bytes_sent": "297", "http_referer": "", "http_user_agent": "Mozilla/5.0 zgrab/0.x", "http_x_forwarded_for": "", "http_host": "218.74.49.39:8443", "server_name": "
book.happyxhw.cn", "request_time": "0.000", "upstream": "", "upstream_connect_time": "", "upstream_header_time": "", "upstream_response_time": "", "upstream_response_length": "", "upstream_cache_status": "", "ssl_protocol": "TLSv1.2", "ssl_cipher": "ECDHE-RSA-AES128-GCM-SHA256", "scheme": "https", "request_method": "GET", "server_protocol": "HTTP/1.1", "pipe": ".", "gzip_ratio": "1.36", "http_cf_ray": "", "allowed": "no", "geoip_country_code": "US", "geoip_city": "Clifton"}
```