Connect networks and subnetworks to other host

I’ve got two individual networks and subnetworks that are connected with each other via CAT5 cable. What do I need to set up so that I can connect the host of the two networks to other host outside my network?
