Nota Acap
  • Introduction
  • Linux Guide
    • Fresh Installed Centos 7
    • Changing Network Interfaces in Centos 7
    • Lockdown SSH
    • Recursively change permission Linux
    • Proxy Server IPtables
    • Provisioning Web Server with Custombuild
    • MySQL Basic Management
    • Increasing Existing LVM Disk
  • Windows Guide
  • Application Guide
    • WEB Port IPtables Rate Limit
    • Simple Email Piping Script
    • HTTP Dead
    • Email Relay Outgoing
    • Compiling Extra PHP version (Directadmin)
    • Finding the SPAM (cPanel)
    • HTTP Basic Virtual Host
    • Update Kernel for DRBD Hosts
  • Migration Related
    • Cpanel -> Cpanel (Bulk)
    • IMAPSYNC Basic Scripts
    • Directadmin -> cPanel (Copy/Sync Emails)
    • Basic Rsync Script
Powered by GitBook
On this page

Was this helpful?

  1. Linux Guide

Proxy Server IPtables

Creating a Proxy server to pass services from one IP to another using IPTables

A simple script will do :

#!/bin/bash

iptables -F INPUT
iptables -F OUTPUT
iptables -F FORWARD

iptables -t nat -F PREROUTING -t nat
iptables -t nat -F POSTROUTING -t nat

iptables -A PREROUTING -t nat -d 103.3.173.82 -p udp --dport 53 -j DNAT --to 103.3.173.221
iptables -A PREROUTING -t nat -d 103.3.173.82 -p tcp -m multiport --dport 3306,80,443,110,2525,25,20,21,143,2222 -j DNAT --to 103.3.173.221

iptables -A POSTROUTING -t nat -d 103.3.173.221 -j SNAT --to 103.3.173.82

PreviousRecursively change permission LinuxNextProvisioning Web Server with Custombuild

Last updated 6 years ago

Was this helpful?