You can achieve this by defining the default gateway adress and the connection/interface used to reach it. By default your system only knows how to reach the locally defined subnet (I guess it's a /24 network mask, so you can reach adresses 192.168.17.1 to 192.168.17.254 without any changes). Now you must tell it the address of the gateway and which interface is connected to it.
E.g.: You have interface eth0 connected to your LAN with IP 192.168.17.16 and netmask 24 (= 255.255.255.0), then you define the default gateway by saying "default gw is 192.168.1.254 reachable via eth0".
With CentOS7 the network managment is done by NetworkManager. You can use the cli to setup the default gateway:
sudo nmcli connection modify eth0 ipv4.gateway "192.168.1.254"
sudo nmcli connection up eth0
See also https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/networking_guide/sec-configuring_static_routes_using_nmcli
You can also modify configuraton files directly by following this guide:
Edit (as I can't post comments):
You can connect to any address that is reachable via a physically connected network. The poster didn't tell us if there are multiple physical networks involved and if there is some dedicated router that does the connection between the networks. Therefore I suggest he can reach the gateway directly and only needs to tell his system which interface to use.