Best quick forword visitors from old server to new server

read-gaz-shine-small-tran.1

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 10.0.0.2 on port 80:

note : 10.0.0.2 it’s new server

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

and finally, we ask IPtables to masquerade:

# iptables -t nat -A POSTROUTING -j MASQUERADE

Regards 🙂

Share Button