About this list Date view Thread view Subject view Author view Attachment view

From: Herbert Poetzl (herbert_at_13thfloor.at)
Date: Mon 21 Feb 2005 - 19:11:15 GMT


On Mon, Feb 21, 2005 at 09:41:42AM +0300, Abdrashitov Dmitry wrote:
> Hello!
> I want give my virtual server private ip-address : 10.0.0.32
> System - Debian Woody
> And this is rules from NAT table:
>
> ****
> ## this is working
> iptables -t nat -A POSTROUTING -p tcp -o eth0 -s 10.0.0.0/26 -j SNAT
> --to-source $real_ip
>
> ## but this is not working
> iptables -t nat -A PREROUTING -p tcp -s 0.0.0.0/0 -d domain1.ru --dport
> 10000 -j DNAT --to 10.0.0.32:10000
> ***
>
> $real_ip - external ip-address
>
> domain1.ru have $real_ip address in provider's DNS
>
> How does that must work?

eth0 Link encap:Ethernet HWaddr 52:54:00:12:34:56
          inet addr:10.0.0.2 Bcast:10.255.255.255 Mask:255.0.0.0
eth0:XXXX Link encap:Ethernet HWaddr 52:54:00:12:34:56
          inet addr:192.168.0.2 Bcast:10.255.255.255 Mask:255.0.0.0

the 10.x.x.x is here instead of a public network ip

iptables -t nat -A POSTROUTING -s 192.168.0.2 \
                -j SNAT --to-source 10.0.0.2
iptables -t nat -A PREROUTING -p tcp -d 10.0.0.2 --dport 80 \
                -j DNAT --to-destination 192.168.0.2

and the vserver XXXX using the ip 192.168.0.2 will
answer to http (port 80) requests to 10.0.0.2 with
a 10.0.0.2 ip, and also be able to reach the network
by 'using' the 10.0.0.2 ip as source address ...

HTH,
Herbert

>
> Dmitry
>
>
>
> _______________________________________________
> Vserver mailing list
> Vserver_at_list.linux-vserver.org
> http://list.linux-vserver.org/mailman/listinfo/vserver
_______________________________________________
Vserver mailing list
Vserver_at_list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


About this list Date view Thread view Subject view Author view Attachment view
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Mon 21 Feb 2005 - 19:11:34 GMT by hypermail 2.1.3