Reply
New Contributor
c0m3-in
Posts: 1
0

Forwarding port though hamachi using iptables

Hello, I have a situation that can be described as bellow:

 

CentOS A: 103.113.137.xxx (eth0 - WAN network) --- 5.140.162.xxx (ham0 - Hamachi)

Win32 B: 202.113.133.xx (WAN network) ----  5.a.b.c (hamachi)

 

I use iptables to forward port from A to B, hoping that it works

 

iptables -t nat -A PREROUTING --dst 103.113.137.xxx -i eth0 -p tcp --dport 80 -j DNAT --to-destination 5.140.162.xxx:80
iptables -t nat -A POSTROUTING -p tcp --dst 5.140.162.xxx --dport 80 -j SNAT --to-source 103.113.137.xxx

 But it did not. I cannot

 

If I change the forward target to an ip that not in hamachi network, in this example: 202.113.133.xx. It works perfectly.

 

Please tell me which part that I'm wrong?

 

Thanks

New Contributor
rolfk
Posts: 1
0

Re: Forwarding port though hamachi using iptables

Hi ,

 

Did you already fix this problem i have the same situation.

LAN site with client who want to connect to the Hamachi network. but i cant get it work :(

 

regards,

rolf