How does the peripheral nervous system connect to the centeral nervous system and vice versa?

Through spinal nerve. Most peripheral nerves connect to the CNS via the spinal cord. Some through autonomic chains.