Use iptables port forwarding to improve network access speed

Use iptables port forwarding to improve network access speed

First reference : Brook/iptables port forwarding one-click management script, support DDNS

Generally, IPLC and domestic line machines are used as forwarding servers.
The forwarded machine is a foreign host.

Assume the forwarding server is 1.1.1.1 and the port is 11111
The forwarded server is 2.2.2.2, and the port is 22222

All settings are made on the forwarding server, and the one being forwarded does not matter.
If you use it for personal use, it is recommended to add forwarding for all ports, such as 22-65535

The following takes iptables port forwarding as an example.

1. Check the IP bound to the network card
For many NAT servers, the network card is bound to the intranet IP. Use the intranet IP when setting.

 ip addr

The VPS intranet IP for this demonstration is 192.168.133.156

2. Set up forwarding

 wget -N --no-check-certificate https://zhujiwiki.com/wp-content/uploads/2020/01/iptables-pf.sh && chmod +x iptables-pf.sh
bash iptables-pf.sh

For the first time use, you must select 1. Install iptables

 bash iptables-pf.sh

Select 4. Add iptables port forwarding

After this configuration, 1.1.1.1:11111 is used, and most of the actual traffic goes through 2.2.2.2:22222
For future use and access, use the IP 1.1.1.1 plus the port.

<<:  Yecao Cloud: 139 yuan/year/1GB memory/20GB SSD space/200GB traffic/15Mbps bandwidth/KVM/Hong Kong CN2

>>:  NETfront: $10/month/4 cores/4GB memory/64GB SSD space/1TB traffic/160Mbps port/4 IPs/change IP at any time/KVM/Hong Kong CN2

Recommend

K9VPS: $21/year/1GB/65GB space/1.5TB traffic/1 IP/OpenVZ/Los Angeles

K9VPS, founded in 2014, only provides OpenVZ VPS....

Linux vps automatically backs up remote servers to establish mirror sites

Most Linux VPS use rsync to synchronize and back ...

Stable and free DNS —— dnspark.net

The free DNS resolution service provided by DNS P...

Webtropia: €35/month/i7-4790k/32GB memory/2TB space/unlimited traffic/Germany

Webtropia, owned by myLoc, now has 3 new standalo...

TuneVPS: $30/year/1GB memory/30GB space/1TB traffic/KVM/Los Angeles/Phoenix

TuneVPS has several special annual payment VPSs w...

FireVPS: $20/year/1G memory/100GB space/2TB traffic/KVM/Canada

FireVPS, a newly established hosting provider, is...