Best quick forword visitors from old server to new server


Hey guys !

I will explain the best way forword all visitor to the new server quickly

step 1 : set net.ipv4.ip_forward > 1

# nano /etc/sysctl.conf

# replace net.ipv4.ip_forward=0 to net.ipv4.ip_forward=1

# save file .

# sysctl -p

step 2 :

Then, we will add a rule telling to forward the traffic on port 80 to ip on port 80:

note : it’s new server

 # iptables -t nat -A PREROUTING -p tcp –dport 80 -j DNAT –to-destination

and finally, we ask IPtables to masquerade:

# iptables -t nat -A POSTROUTING -j MASQUERADE

Regards 🙂

Share Button