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

North Hosts Limited: £7.5/month/2GB RAM/500GB hard drive/2TB traffic/UK

North Hosts Limited, a regular UK hosting provide...

Ethernetserver: $3.6/year/1GB memory/30GB space/1TB traffic/OpenVZ/Los Angeles

Ethernetserver, a British hosting company, a form...

Uovz: 20 yuan/month/1GB memory/30GB space/2TB traffic/DDOS/KVM/French OVH

Uovz, a Chinese hosting provider, has been introd...

LayerVPS: £25/month/E3-1220v6/4GB RAM/1TB HDD/10TB bandwidth/100Mbps/DDOS/UK

LayerVPS, a British merchant, should have been es...

Preface to "Secrets of Google Adsense": How to use this book

Dear readers, thank you for purchasing the second...

myLoc: €4.99/month/2GB RAM/75GB storage/unlimited traffic/KVM/Germany

myLoc is a long-established German hosting compan...

LunarPages Hosting's Latest 30% Discount Code (Including Free Dedicated IP)

Discount code: China30 Discount content: Use this...