Route traffic via different pc

I have a problem and was thinking I can do it ZeroTier but now Im not sure. Scenario : Multiple PCs in the network, however, this should only be applied to 2 PCs that will ALWAYS have the same IP address (assigned by ZeroTier).

Scenario to cover:
PC1 (.200) and PC2 (.100) are connected to ZeroTier on the same network. Both are in different locations. I want the PC2 to tunnel all the internet traffic via the PC1 network/public IP.
So if I on PC2 will go to https://iplocation.io/ on PC2 I will see the PUBLIC IP of the PC1 network.

Both, PC1 and PC2 are Windows 10/11

Is that doable via zerotier?

Yes, this is fully supported, but will vary on how to achieve it based on your OS. I don’t generally recommend using a base Windows or Linux host to achieve this, since there’s a large number of freely available Network OSs you can install as VMs to solve this problem. You could simply install something like VyOS, OpenWRT, or OPNsense as a VM on PC1, and point PC2 towards it. You can just treat them as routers, and you don’t need to tune a bunch of knobs to get things working.

I understand that people may not desire to learn a Network OS to solve this, so if you still want to use a Windows host to solve this, here’s some generalized steps:

  • Define a host to use as the exit node (PC1 in your case)
  • In ZeroTier Central, create a default route to that node: 0.0.0.0/0 via <zerotier ip>
  • Configure IP forwarding on that host (will vary by OS)
  • Configure NAT on host interface towards internet (will vary by OS)
  • Enable default route on clients using this: zerotier-cli set <network-id> allowDefault=1

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.