iptables 防火墙端口限速

某些 VPS 带宽长时间超速,容易引发厂商主动 QOS 甚至被短时间的断网。 使用 iptables 防火墙对端口进行适当程度的限速。需要安装 iptables,注意限速规则 Rule ,不要受到其他 Rule 规则的影响!iptables 8080端口限速命令:iptables -A OUTPUT -p tcp --sport 8080-m limit --limit 1000/s --lim

- 阅读全文 -

UFW 防火墙开启端口转发

一、修改 /etc/default/ufwvi /etc/default/ufw将 DEFAULT_FORWARD_POLICY="DROP" 的 DROP 改为 ACCEPT。二、修改 /etc/ufw/sysctl.confvi /etc/ufw/sysctl.conf添加 net/ipv4/ip_forward=1 ,注意不要重复添加。三、修改 /etc/ufw/before.rules将以

- 阅读全文 -

定时更新域名解析的 IP 至防火墙

定时获取域名所解析的 IP ,并将 IP 添加至 UFW 防火墙规则;仅适用于 IPv4 网络的机器!# 新建脚本 vi /usr/ufwip.shShell 脚本内容如下,请自行替换 google.com 为自己的域名:#!/bin/bash # crontab 任务:每20分钟执行一次 # */20 * * * * bash /usr/ufwip.sh > /dev/null if

- 阅读全文 -

UFW 防火墙的安装及常用命令

UFW,或称Uncomplicated Firewall,是iptables的一个接口,为不熟悉防火墙概念的初学者提供了易于使用的界面,同时支持IPv4和IPv6,广受欢迎。使用UFW来管理防火墙规则,十分方便好用。安装UFW# Ubuntu & Debian使用以下命令 apt-get install ufw -y # CentOS使用以下命令 yum install epel-rel

- 阅读全文 -

CentOS 7 卸载firewalld安装iptables

CentOS 7卸载删除firewalld防火墙,安装iptables防火墙。一、CentOS 7卸载firewalld防火墙命令关闭开机启动,停用firewalld,卸载firewalld防火墙;systemctl disable firewalld systemctl stop firewalld systemctl mask firewalld systemctl disable firew

- 阅读全文 -