Deprecated: Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect since PHP 8.1 in /var/www/html/plugins/system/falangdriver/falangdriver.php on line 534
iptables禁IP与解封IP常用命令 - bluetooth蓝牙技术
Support us and view this ad

可选:点击以支持我们的网站

免费文章

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/components/com_comprofiler/plugin/user/plug_cbjdownloads/cbjdownloads.php on line 49

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/components/com_comprofiler/plugin/user/plug_cbblogs/cbblogs.php on line 48

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/components/com_comprofiler/plugin/user/plug_cbarticles/cbarticles.php on line 47

在Linux下,使用ipteables来维护IP规则表。要封停或者是解封IP,其实就是在IP规则表中对入站部分的规则进行添加操作。 要封停一个IP,使用下面这条命令: iptables -I INPUT -s ***.***.***.*** -j DROP 要解封一个IP,使用下面这条命令:   iptables -D INPUT -s ***.***.***.*** -j DROP 参数-I是表示Insert(添加),-D表示Delete(删除)。后面跟的是规则,INPUT表示入站,***.***.***.***表示要封停的IP,DROP表示放弃连接。 此外,还可以使用下面的命令来查看当前的IP规则表:   iptables -list 比如现在要将123.44.55.66这个IP封杀,就输入:   iptables -I INPUT -s 123.44.55.66 -j DROP 要解封则将-I换成-D即可,前提是iptables已经有这条记录。如果要想清空封掉的IP地址,可以输入:   iptables -flush 要添加IP段到封停列表中,使用下面的命令:   iptables -I INPUT -s 121.0.0.0/8 -j DROP 其实也就是将单个IP封停的IP部分换成了Linux的IP段表达式。关于IP段表达式网上有很多详细解说的,这里就不提了。 相信有了iptables的帮助,解决小的DDoS之类的攻击也不在话下! 附:其他常用的命令 编辑 iptables 文件   vi /etc/sysconfig/iptables 关闭/开启/重启防火墙   /etc/init.d/iptables stop   #start 开启   #restart 重启 验证一下是否规则都已经生效:   iptables -L 保存并重启iptables   /etc/rc.d/init.d/iptables save service iptables restart linux下实用iptables封ip段的一些常见命令: 封单个IP的命令是:   iptables -I INPUT -s 211.1.0.0 -j DROP 封IP段的命令是:   iptables -I INPUT -s 211.1.0.0/16 -j DROP iptables -I INPUT -s 211.2.0.0/16 -j DROP iptables -I INPUT -s 211.3.0.0/16 -j DROP 封整个段的命令是:   iptables -I INPUT -s 211.0.0.0/8 -j DROP 封几个段的命令是:   iptables -I INPUT -s 61.37.80.0/24 -j DROP iptables -I INPUT -s 61.37.81.0/24 -j DROP 想在服务器启动自运行的话有三个方法: 1、把它加到/etc/rc.local中 2、iptables-save >;/etc/sysconfig/iptables可以把你当前的iptables规则放到/etc/sysconfig/iptables中,系统启动iptables时自动执行。 3、service iptables save 也可以把你当前的iptables规则放/etc/sysconfig/iptables中,系统启动iptables时自动执行。 后两种更好此,一般iptables服务会在network服务之前启来,更安全。 解封的话:iptables -D INPUT -s IP地址 -j REJECTiptables -F 全清掉了 Linux防火墙Iptable如何设置只允许某个ip访问80端口,只允许特定ip访问某端口?参考下面命令,只允许46.166.150.22访问本机的80端口。如果要设置其他ip或端口,改改即可。   iptables -I INPUT -p TCP –dport 80 -j DROP iptables -I INPUT -s 46.166.150.22 -p TCP –dport 80 -j ACCEPT 在root用户下执行上面2行命令后,重启iptables, service iptables restart 查看iptables是否生效:   [root@www<span< a=""> class="pun">.xxx.com]# iptables -L</span<> Chain INPUT (policy ACCEPT) target           prot opt source               destination ACCEPT     tcp  –  46.166.150.22    anywhere            tcp dpt:http DROP         tcp  –  anywhere             anywhere            tcp dpt:http   Chain FORWARD (policy ACCEPT) target     prot opt source               destination   Chain OUTPUT (policy ACCEPT) target     prot opt source               destination 上面命令是针对整个服务器(全部ip)禁止80端口,如果只是需要禁止服务器上某个ip地址的80端口,怎么办? 下面的命令是只允许来自174.140.3.190的ip访问服务器上216.99.1....

继续阅读完整内容

支持我们的网站,请点击查看下方广告

正在加载广告...

FaLang translation system by Faboba

登陆


Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/src/Menu/AbstractMenu.php on line 164

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 217

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 219

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 227

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 231

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 234

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 237

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 239

Deprecated: Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect since PHP 8.1 in /var/www/html/plugins/system/falangdriver/falangdriver.php on line 100

Deprecated: Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect since PHP 8.1 in /var/www/html/plugins/system/falangdriver/falangdriver.php on line 100
mysqli object is already closed (500 Whoops, looks like something went wrong.)

Error

HTTP 500 Whoops, looks like something went wrong.

mysqli object is already closed

Exception

Error

  1. */
  2. public function disconnect()
  3. {
  4. // Close the connection.
  5. if (\is_callable([$this->connection, 'close'])) {
  6. $this->connection->close();
  7. }
  8. parent::disconnect();
  9. }
  1. */
  2. public function disconnect()
  3. {
  4. // Close the connection.
  5. if (\is_callable([$this->connection, 'close'])) {
  6. $this->connection->close();
  7. }
  8. parent::disconnect();
  9. }
  1. *
  2. * @since 2.0.0
  3. */
  4. public function __destruct()
  5. {
  6. $this->disconnect();
  7. }
  8. /**
  9. * Alter database's character set.
  10. *
DatabaseDriver->__destruct()

Stack Trace

Error
Error:
mysqli object is already closed

  at /var/www/html/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:318
  at mysqli->close()
     (/var/www/html/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:318)
  at Joomla\Database\Mysqli\MysqliDriver->disconnect()
     (/var/www/html/libraries/vendor/joomla/database/src/DatabaseDriver.php:496)
  at Joomla\Database\DatabaseDriver->__destruct()                

Deprecated: Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect since PHP 8.1 in /var/www/html/plugins/system/falangdriver/falangdriver.php on line 100

Deprecated: Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect since PHP 8.1 in /var/www/html/plugins/system/falangdriver/falangdriver.php on line 100