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

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

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?


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
# sudo iptables -t nat -A POSTROUTING -p tcp -d --dport 329-j SNAT --to-source
# 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.