Satış ve Destek +90 (216) 521 78 00

Sepetim Giriş Yap | Kayıt Ol
Tenik Data
How to Redirect HTTP traffic to another IP using iptables - TeknikDATA Hosting Hizmetleri

Bilgi Merkezi

Ana sayfa > Bilgi Merkezi > English > Apache > How to Redirect HTTP traffic to another IP using iptables

How to Redirect HTTP traffic to another IP using iptables

How to Redirect HTTP traffic to another IP using iptables

I want to redirect all traffic coming to the old server’s http port(during the TTL change period) to the webserver running in new server with a different ip .

DETAILS:

Service : Apache(port 80 and 443)
Interface name in old server(this is a vps) : venet0
Destination ip : 198.89.54.263

SOLUTION:

Use iptables nat to redirect http and https traffic to another server ip and port. Execute the following commands in the source server.

iptables -t nat -A PREROUTING -i venet0 -p tcp –dport 80 -m conntrack –ctstate NEW -j DNAT –to 98.59.254.163:80
iptables -t nat -A PREROUTING -i venet0 -p tcp –dport 443 -m conntrack –ctstate NEW -j DNAT –to 98.59.254.163:443
iptables -t nat -A PREROUTING -m conntrack –ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -A POSTROUTING -t nat -j MASQUERADE

Bulut Hosting Bireysel Hosting Kurumsal Hosting Bayi Hosting Uygulama Hosting Wordpress Hosting Joomla Hosting Drupal Hosting E-Ticaret Hosting Haber Hosting Veritabanı Hosting MySQL Hosting MongoDB Hosting PostgreSQL Hosting
Bulut Sunucu Bulut Sunucu Sunucu Barındırma Sunucu Kiralama Sunucu Yük Dengeleyici Bulut Sunucu Standart Bulut Sunucu Enterprise Bulut Sunucu SSD Premium Bulut Sunucu Sunucu Yük Dengeleyici Kiralama Güvenlik Duvarı Kiralama
Kurumsal Email Sunucu Standart Email Sunucu Professional Email Sunucu Enterprise Email Sunucu Bulut Email Bulut E-Posta Hosting Hosted Zimbra Spam/Virüs Gateway Mail Back Up Smart Host ETRN Hizmeti E-Posta Servisleri
Domain Alan Adı Tescil Alan Adı Transfer Alan Adı Yenileme TÜrkçe Alan Adı Kayıt Marka Tescil Marka Tescil Başvuru
CDN Çözümleri Statik Cache Hizmeti İçerik Hızlandırma Coğrafi İçerik Dağıtımı CDN Depolama SSL Sertifika Comodo SSL QuickSSL True BusinessID SSL

LiveZilla Live Help