0

Okay, so here's the deal. I have two PCs setup for gaming. One is specifically for streaming, and the other is just for gaming. In order to get the video output from the gaming PC to the streaming PC, I use the NDI plugin with OBS Studio, which allows me to output video via an ethernet cable to my streaming PC, where that video is then received, processed, and sent to Twitch, YouTube, or wherever. The way I have the network setup, is I have my gaming laptop connected to my streaming PC via a crossover cable, and then I have my gaming computer connected to my ap via a (different, obviously) ethernet cable. The problem is, from my laptop, I can only access the internet if I use Wi-Fi (since my laptop only has one ethernet port, unlike my streaming PC), and Wi-Fi is not ideal for gaming. So, I would like to find a way to allow my streaming PC to act almost like a switch, and allow any traffic not destined for it (i.e. the gaming traffic, and not the NDI traffic) to automatically get forwarded to the AP as if it were directly connected, therefore allowing my gaming laptop to access both the internet and send its screencapture through the ethernet cable. I have been playing around with the routing tables for the past hour, and can't quite get it to work. I am running Windows 10 on my gaming PC, and a debian-based linux distro on my streaming PC. Any help would be greatly appreciated! Thanks!

Edit: I understand that using a simple switch would be the easiest solution, but I would still like to know how to make it work the way I originally mentioned, for learning sake. So for now, let's assume I only have the two PCs, one crossover cable, and one patch cable connected to the AP. Thanks!

5
  • 1
    But why not use an actual ethernet switch? The dedicated chip will almost always offer better performance than the streaming PC's already quite burdened CPU. Nov 22, 2018 at 22:49
  • You're definitely right, the problem is that I don't own one, and I was hoping to find a fix tonight! :) But you're right, I may end up getting one as a future investment, or possibly even a capture card. But for now, if I could get this to work, it would be the cheapest option, which is definitely good for me! Besides, I think my streaming PC should be able to handle it. I've got two Intel Xeon server-grade processors in it, as well as two separate nics, if need-be, to handle the connections.
    – Noah
    Nov 22, 2018 at 22:58
  • You could create a bridge and attach the two interfaces to it. But you're probably better off using the existing wired connection you have using the AP's switch. Nov 23, 2018 at 1:42
  • Do you own a router? (I mean the typical "4 LAN ports" home router.) The LAN ports in those are actually an internal switch and can be used here. But honestly, a good 5-port Gigabit switch costs... $20 or so? Nov 23, 2018 at 8:20
  • It would depend on the OS you're using. Windows simply supports Internet Connection Sharing which you could use. Doing the routing manually can be hard on Windows depending on your version and edition. For Linux you would change /proc/sys/net/ipv4/ip_forward.
    – Seth
    Nov 29, 2018 at 13:28

1 Answer 1

0

There are two options.


Messing with routing tables only helps if you are trying to turn the streaming PC into a router, i.e. have two different subnets on different sides. In your case though, there are no changes needed to the PC's routing table at all (after all, it already knows both networks), but instead to the gaming PC and the main LAN router.

  1. Make sure both networks (the LAN and the gaming PC's mini-net) use different subnet prefixes.

  2. On the gaming PC, make sure the streaming PC is set as the "default gateway".

  3. On the streaming PC, make sure IP forwarding is enabled:

    sysctl net.ipv4.conf.all.forwarding=1
    
  4. On the LAN's main router, add a static route towards the mini-net:

    • Destination: <mini-net's subnet address/mask>
    • Gateway: <streaming PC's main LAN address>
  5. If and only if the main router has no option to add static routes (and still dares to call itself a router), instead enable SNAT on the streaming PC by adding an iptables "masquerade" rule.

    Note: Using NAT would mean that all ports to the gaming PC must be manually forwarded twice – once from router to streaming PC, and then from the streaming PC to the gaming PC (by adding DNAT rules to iptables).


On the other hand, if you want to turn the streaming PC into a switch, what you're looking for the "bridge" feature in Linux. Configuring it varies between distributions; here's how to do it by hand (temporarily), or via NetworkManager, or via traditional Debian ifupdown, but the general principle is:

  1. Remove all IP configuration from both Ethernet ports.
  2. Create a virtual "bridge" interface.
  3. Add both Ethernet interfaces as "ports" to the bridge.
  4. Configure IP (e.g. DHCP) on the bridge interface only.

Now everything that's attached to both Ethernet interfaces becomes part of the same subnet. The gaming PC can use DHCP to get its address directly from your main LAN router.

1
  • Thank you! That's the answer I was looking for! :)
    – Noah
    Nov 23, 2018 at 20:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .