Re: DNAT Internet gate problem on centos

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Now i know why you wait, when I ask. Depends on time I will find a (my)
way. :-)

#!/bin/sh
IPTBLV4=/usr/sbin/iptables

if [ $# -eq 0 ]
  then
    echo "No arguments supplied"
   GATE=XX.XX.XX.XX
  else
   GATE=$1
fi

nslookup $GATE

echo "1" > /proc/sys/net/ipv4/ip_forward

$IPTBLV4 -F -t nat

$IPTBLV4 -t nat -A PREROUTING -p tcp --dport PORT1 -j DNAT
--to-destination $GATE:PORT1
$IPTBLV4 -t nat -A PREROUTING -p tcp --dport PORT2 -j DNAT
--to-destination $GATE:PORT2

.
.
.
.

#global 
$IPTBLV4 -t nat -A POSTROUTING -j MASQUERADE

$IPTBLV4 -L -t nat -v

/usr/sbin/service iptables save 

This works on the vserver to the gate -> transparent to local gate ->
transparent to network again -> local machines.

Why? I don't like my provider, but he's the fastest and cheapest in
town. 

The people of today are just too curious.

Sincerely

Andy

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
https://lists.centos.org/mailman/listinfo/centos



[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux