I have two pc running on Windows. They are connected with direct Ethernet cable. PC1 has two interfaces. One is connected to the LAN with static ip:172.16.50.2 mask: 255.255.0.0 and gateway: 172.16.20.1. and the second interface is used to connect directly to PC2 with ip: 192.168.0.1 mask:255.255.255.0 and no gateway. PC2 has one interface for direct connecting to PC1 with ip: 192.168.0.2 mask: 255.255.255.0 and gateway: 192.168.0.1 These two PC can see each other with no problem. But I want to access the LAN resources from PC2 without using Bridge on PC1. I have already enabled IP Packet Forwarding in PC1. What specific "route add" command should I use?
PC1 already knows how to get to the LAN, and PC2 already knows how to get to PC1. You can't add a route anywhere to improve on this situation and make PC1 route traffic from PC2 to the LAN.
What you need to do is enable Internet Connection Sharing on PC1's
172.16.50.2 interface. When prompted, select the
192.168.0.1 interface as the "home" network. This will configure PC1 so that it routes traffic between the two interfaces.