How can i have network access to linux server from a computer that shares internet connection?

Solution 1:

I solved by creating a second network between those using my spare router. .... i lost my direct ssh connection to linux from windows pc. How i can have both internet and direct network ssh access to linux server based on this setup?

Adding the second router has you did has very likely given you two networks (two subnets).

Put the second network on the same subnet as the first network.

This will give you (as you asked) direct connection between computers and Internet on both.

To put two routers on the same subnet, follow the general steps below (has worked for me for a long time and numerous routers).

Make sure you can access the router settings on both routers - you will need this.

Connect a LAN port on the second router to a LAN port on the first router. Do not connect to the WAN port of the second router.

Give the second router a Static IP address on the main network. This avoids the second router getting lost if you reset things.

Turn DHCP OFF on the second router.

Now you have one subnet and you can make everything work together.