Tutorial for VPS beginners, how to play with VPS cloud server, and use iptables to limit VPS cloud server traffic. Detailed tutorial sharing

888u

Last update at :2024-01-29,Edit by888u

Nowadays, more and more friends are playing VPS cloud servers, and there are all kinds of VPS server merchants. The traffic rules of the VPS cloud server products launched by each merchant are also different. There are unlimited traffic VPS cloud servers and restricted traffic VPS. Cloud server,

This issue focuses on the tutorial on how to use iptables to limit VPS cloud server traffic. It is mainly aimed at VPS cloud servers that have traffic limits. Alibaba Cloud VPS cloud servers also have products that limit traffic. Someone seized the opportunity to cause trouble. , a sea view room is gone

So, what should we do if we want to limit the use of VPS cloud server traffic? What if the VPS cloud server automatically limits the outflow of traffic after how much traffic it has run in a day? We use iptables rules to limit the traffic on the VPS cloud server in a single day. If it exceeds the limit, all packets will be lost. Interested friends can try it

iptables rules are as follows:

iptables -F a40g [Rule to delete specified chain or all chains] iptables -F OUTPUT iptables -P OUTPUT ACCEPT [Set the default rule policy for the specified chain, which does not work for custom chains]

iptables -N a40g [Create user-defined chain] iptables -A a40g -m a --a 75161927680 -j RETURN [-A adds rules at the end of the specified chain, RETURN - the firewall stops executing subsequent Rules in the current chain and returns to the calling chain] iptables -A a40g -j DROP

iptables -A OUTPUT -o eth0+ -j a40g

Add daily scheduled execution tasks:

08 00 ***

By the way, the traffic limit is in bytes, 1MB=1048576 bytes. Friends who need to limit the daily traffic of the VPS cloud server can try it. We have personally tested it to be effective

Recommended site search: dynamic IP server, free cloud server, US server website, Hong Kong server rental, US virtual host, domain name registration query US anti-attack server, how to check IP, Korean server recommendation, check address by IP,

p>

Tutorial for VPS beginners, how to play with VPS cloud server, and use iptables to limit VPS cloud server traffic. Detailed tutorial sharing

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码