Redirect Traffic From linux to anther machine

General support questions
Post Reply
bencp
Posts: 30
Joined: 2018/09/20 18:30:00

Redirect Traffic From linux to anther machine

Post by bencp » 2018/12/15 18:20:04

Hello all, i create a port forwarding from my router to my Linux machine.
I want to redirect this traffic to the windows machine , but the traffic should pass through the linux machine.
How can i do this? thanks

lightman47
Posts: 1522
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: Redirect Traffic From linux to anther machine

Post by lightman47 » 2018/12/15 19:14:34

What is your actual goal here (details!)?

For instance, the likely but not helpful answer to your generic question might be 'unplug the cable from the router to your linux machine and plug it into the Windows machine'.

I'm sure that's not what your trying to accomplish but haven't mentioned.

Are you trying to 'supply Internet' to another machine? Are you trying to "monitor" traffic to the other machine? The answers are very different depending on what you're trying to do. Details are everything. The also implied assumption is that the linux machine has two network cards - one connected to the router and the second connected to the Windows machine (see how details matter?).

;)

bencp
Posts: 30
Joined: 2018/09/20 18:30:00

Re: Redirect Traffic From linux to anther machine

Post by bencp » 2018/12/15 19:57:33

lightman47 wrote:
2018/12/15 19:14:34
What is your actual goal here (details!)?

For instance, the likely but not helpful answer to your generic question might be 'unplug the cable from the router to your linux machine and plug it into the Windows machine'.

I'm sure that's not what your trying to accomplish but haven't mentioned.

Are you trying to 'supply Internet' to another machine? Are you trying to "monitor" traffic to the other machine? The answers are very different depending on what you're trying to do. Details are everything. The also implied assumption is that the linux machine has two network cards - one connected to the router and the second connected to the Windows machine (see how details matter?).

;)
Hey
I just want to forward traffic from linux to windows .
Like , if someone access to linux machine on port 9999 , the linux should forword the traffic to windows.
just want that the linux will be the machine that forward all.

lightman47
Posts: 1522
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: Redirect Traffic From linux to anther machine

Post by lightman47 » 2018/12/15 20:04:33

Ahh! I see.

bencp
Posts: 30
Joined: 2018/09/20 18:30:00

Re: Redirect Traffic From linux to anther machine

Post by bencp » 2018/12/15 21:24:00

lightman47 wrote:
2018/12/15 20:04:33
Ahh! I see.
so you have an idea ?

User avatar
jlehtone
Posts: 4530
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Redirect Traffic From linux to anther machine

Post by jlehtone » 2018/12/15 21:40:55

But why? You already have a router, where you have to explicitly forward to somewhere. You could forward to Windows there.

Your router, Linux, and Windows are on the same subnet. When a packet form outside arrives to router, it has sender's address and router's address. Router's forward-rule changes the destination from router to Linux and then router routes the packet.

If your Linux forwards too, it will replace the destination from Linux to Windows, and then route the packet.

Windows receives packet. Destination is Windows, just like you want. Source is the original sender.
Windows will create a reply. The reply has Windows as sender and the outsider's address as destination.
Can you tell where Windows will send that packet and why?

Post Reply