0

I have two servers. Windows and Linux. Let's say Linux has the IP 1.2.3.4 and Windows 5.6.7.8. I want all traffic to be forwarded to windows as a tunnel. If I connect with 1.2.3.4:329 I want to connect with 5.6.7.8:329.

Allright Linux (ubuntu) server - IP 1.2.3.4 Windows server - IP 5.6.7.8

I want to push all traffic through Linux to Windows. By means of a GRE tunnel or the like.

I hope someone has an idea how to do this and whether this is possible at all?

0

You can use iptables to forward all traffic from Linux to Windows.

Add the following line to /etc/sysctl first:

net.ipv4.ip_forward = 1

Then run the following command as root:

# sysctl -p

Forward traffic with iptables command running by root:

# sudo iptables -t nat -A PREROUTING -p tcp --dport 329 -j DNAT --to-destination 5.6.7.8:329
# sudo iptables -t nat -A POSTROUTING -p tcp -d 5.6.7.8 --dport 329-j SNAT --to-source 1.2.3.4
# sudo iptables -t nat -L -n

Wish it working.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.