0

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?

1 Answer 1

0

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.

2
  • But I don't want PC2 to get ip from LAN dhcp.
    – Mohammad
    Commented Jul 9, 2017 at 11:16
  • Please see updated Answer Commented Jul 9, 2017 at 12:34

You must log in to answer this question.

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