How can route traffic from one machine to another machine
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Based on this topology NAT is not a solution because I want to direct all traffic from S1 to S2, not NAT. I will use NAT in S2 for internet connection.
What are the default gateway address of the hosts?
Is the S1 <-> S2 connection on a different subnet from the LAN?
As mentioned by battler, enabling ip_forwarding will allow you to route traffic between subnets. You want the two interfaces for S1 to be on different subnets to allow the routing rules to route between the interfaces. The other hosts need to know to use S1 as the default gateway.
battler, thanks a lot. But I said S1 & S2 is not in a subnet and there are routers and switches between S1 and S2.
How can I direct all traffic from S1 to S2, and from S2 to S1?
1: Choose a routing protocol (RIP or OSPF). You can use this if the routers and switches between S1 and S2 are under your control. The advantage of using a dynamic routing protocol is the the automatic rerouting when lines in the network go down.
2: Remote Site VPN (OpenVPN). You can use this if you want to route traffic across networks that are not under your control (like the internet). You can encrypt your data to make sure it's safe to route your traffic across someone else's network.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.