* PREROUTING to a non local subnet
@ 2013-09-09 14:34 Manu
2013-09-16 7:26 ` Manu
2013-09-16 9:23 ` Vigneswaran R
0 siblings, 2 replies; 5+ messages in thread
From: Manu @ 2013-09-09 14:34 UTC (permalink / raw)
To: netfilter
Hello
I'm running iptable v1.4.7 on a linux with two NIC.
One has adress 192.168.1.31 (the lan)
The other has a public IP. Let's say 180.180.180.180
On the lan, I have a VPN which join two network : 192.168.1.0 and
192.168.2.0
I'm trying to forward 5900 port (vnc) to a computer which is on the
second subnet with adress 192.168.2.100
iptables -A PREROUTING -t nat -p tcp -i eth1 --dport 5900 -j DNAT
--to-destination 192.168.2.100:5900
iptables -A FORWARD -p tcp -d 192.168.2.100--dport 5900 -j ACCEPT
and it doesn't work
I've tried the same on the local network with adress 192.168.1.99
iptables -A PREROUTING -t nat -p tcp -i eth1 --dport 5900 -j DNAT
--to-destination 192.168.1.99:5900
iptables -A FORWARD -p tcp -d 192.168.1.99--dport 5900 -j ACCEPT
and it's working like a charm
I've done my test with another computer with public adress 200.200.200.200
I've done a netstat one the two computers
on 192.168.2.100 i've seen he's talking to 180.180.180.180 (<-- my
server running iptable)
on 192.168.1.99 i've seen he's talking to 200.200.200.200 (<-- the
computer on internet which i'm running my test from)
thanks for your attention
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: PREROUTING to a non local subnet
2013-09-09 14:34 PREROUTING to a non local subnet Manu
@ 2013-09-16 7:26 ` Manu
2013-09-16 21:08 ` Humberto Jucá
2013-09-16 9:23 ` Vigneswaran R
1 sibling, 1 reply; 5+ messages in thread
From: Manu @ 2013-09-16 7:26 UTC (permalink / raw)
To: netfilter
Hello
Nobody knows if it possible ?
Le 09/09/2013 16:34, Manu a écrit :
> Hello
>
> I'm running iptable v1.4.7 on a linux with two NIC.
> One has adress 192.168.1.31 (the lan)
> The other has a public IP. Let's say 180.180.180.180
>
> On the lan, I have a VPN which join two network : 192.168.1.0 and
> 192.168.2.0
>
> I'm trying to forward 5900 port (vnc) to a computer which is on the
> second subnet with adress 192.168.2.100
> iptables -A PREROUTING -t nat -p tcp -i eth1 --dport 5900 -j DNAT
> --to-destination 192.168.2.100:5900
> iptables -A FORWARD -p tcp -d 192.168.2.100--dport 5900 -j ACCEPT
> and it doesn't work
>
> I've tried the same on the local network with adress 192.168.1.99
> iptables -A PREROUTING -t nat -p tcp -i eth1 --dport 5900 -j DNAT
> --to-destination 192.168.1.99:5900
> iptables -A FORWARD -p tcp -d 192.168.1.99--dport 5900 -j ACCEPT
> and it's working like a charm
>
> I've done my test with another computer with public adress
> 200.200.200.200
>
> I've done a netstat one the two computers
> on 192.168.2.100 i've seen he's talking to 180.180.180.180 (<-- my
> server running iptable)
> on 192.168.1.99 i've seen he's talking to 200.200.200.200 (<-- the
> computer on internet which i'm running my test from)
>
> thanks for your attention
> --
> To unsubscribe from this list: send the line "unsubscribe netfilter" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: PREROUTING to a non local subnet
2013-09-16 7:26 ` Manu
@ 2013-09-16 21:08 ` Humberto Jucá
0 siblings, 0 replies; 5+ messages in thread
From: Humberto Jucá @ 2013-09-16 21:08 UTC (permalink / raw)
To: Manu, netfilter
Hi,
Try to include a source NAT rule to ensure symmetrical routing.
iptables -A PREROUTING -t nat -p tcp -i eth1 --dport 5900 -j DNAT
--to-destination 192.168.2.100:5900
iptables -A POSTROUTING -t nat -p tcp -d 192.168.2.100 --dport 5900 -j
MASQUERADE
iptables -A FORWARD -p tcp -d 192.168.2.100--dport 5900 -j ACCEPT
2013/9/16 Manu <traqueur@club-internet.fr>:
> Hello
>
> Nobody knows if it possible ?
>
>
> Le 09/09/2013 16:34, Manu a écrit :
>>
>> Hello
>>
>> I'm running iptable v1.4.7 on a linux with two NIC.
>> One has adress 192.168.1.31 (the lan)
>> The other has a public IP. Let's say 180.180.180.180
>>
>> On the lan, I have a VPN which join two network : 192.168.1.0 and
>> 192.168.2.0
>>
>> I'm trying to forward 5900 port (vnc) to a computer which is on the second
>> subnet with adress 192.168.2.100
>> iptables -A PREROUTING -t nat -p tcp -i eth1 --dport 5900 -j DNAT
>> --to-destination 192.168.2.100:5900
>> iptables -A FORWARD -p tcp -d 192.168.2.100--dport 5900 -j ACCEPT
>> and it doesn't work
>>
>> I've tried the same on the local network with adress 192.168.1.99
>> iptables -A PREROUTING -t nat -p tcp -i eth1 --dport 5900 -j DNAT
>> --to-destination 192.168.1.99:5900
>> iptables -A FORWARD -p tcp -d 192.168.1.99--dport 5900 -j ACCEPT
>> and it's working like a charm
>>
>> I've done my test with another computer with public adress 200.200.200.200
>>
>> I've done a netstat one the two computers
>> on 192.168.2.100 i've seen he's talking to 180.180.180.180 (<-- my server
>> running iptable)
>> on 192.168.1.99 i've seen he's talking to 200.200.200.200 (<-- the
>> computer on internet which i'm running my test from)
>>
>> thanks for your attention
>> --
>> To unsubscribe from this list: send the line "unsubscribe netfilter" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
> --
> To unsubscribe from this list: send the line "unsubscribe netfilter" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: PREROUTING to a non local subnet
2013-09-09 14:34 PREROUTING to a non local subnet Manu
2013-09-16 7:26 ` Manu
@ 2013-09-16 9:23 ` Vigneswaran R
[not found] ` <5236FAB3.2000401@club-internet.fr>
1 sibling, 1 reply; 5+ messages in thread
From: Vigneswaran R @ 2013-09-16 9:23 UTC (permalink / raw)
To: Manu; +Cc: netfilter
On 09/09/2013 08:04 PM, Manu wrote:
> Hello
>
> I'm running iptable v1.4.7 on a linux with two NIC.
> One has adress 192.168.1.31 (the lan)
> The other has a public IP. Let's say 180.180.180.180
>
> On the lan, I have a VPN which join two network : 192.168.1.0 and
> 192.168.2.0
>
> I'm trying to forward 5900 port (vnc) to a computer which is on the
> second subnet with adress 192.168.2.100
> iptables -A PREROUTING -t nat -p tcp -i eth1 --dport 5900 -j DNAT
> --to-destination 192.168.2.100:5900
> iptables -A FORWARD -p tcp -d 192.168.2.100--dport 5900 -j ACCEPT
> and it doesn't work
Does this machine have route to 192.168.2.0 network? Try to use tcpdump
and see where the traffic is being dropped.
Regards,
Vignesh
>
> I've tried the same on the local network with adress 192.168.1.99
> iptables -A PREROUTING -t nat -p tcp -i eth1 --dport 5900 -j DNAT
> --to-destination 192.168.1.99:5900
> iptables -A FORWARD -p tcp -d 192.168.1.99--dport 5900 -j ACCEPT
> and it's working like a charm
>
> I've done my test with another computer with public adress
> 200.200.200.200
>
> I've done a netstat one the two computers
> on 192.168.2.100 i've seen he's talking to 180.180.180.180 (<-- my
> server running iptable)
> on 192.168.1.99 i've seen he's talking to 200.200.200.200 (<-- the
> computer on internet which i'm running my test from)
>
> thanks for your attention
> --
> To unsubscribe from this list: send the line "unsubscribe netfilter" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-09-17 4:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-09 14:34 PREROUTING to a non local subnet Manu
2013-09-16 7:26 ` Manu
2013-09-16 21:08 ` Humberto Jucá
2013-09-16 9:23 ` Vigneswaran R
[not found] ` <5236FAB3.2000401@club-internet.fr>
2013-09-17 4:40 ` Vigneswaran R
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.