Hi everyone,
I'm trying to do a little messing with my config and having difficulty sorting it out. Here's my setup:
- OpenVPN server is set up on my home private network
- I have a work computer that is on the private network at work
- I want to set up the VPN so that the work computer routes all traffic through the VPN
- I need one exception for traffic routing, in that I need the computer to be able to access the printers shared on the work network
After a little googling, I found this Superuser topic (
http://superuser.com/questions/836335/openvpn-over-ssh-port-forwarding-cant-redirect-all-trafic-through-vpn) that seems to do the same thing, but isn't very descriptive. I was hoping you could help to get it sorted properly in my client config file. Let's imagine that the printers I need to access are all shared on the "printers.work.com" domain. For clarification, my home private network is 10.198.0.0/24 and my VPN pool is 10.198.1.0/24
Server:
port 1289
proto udp
dev tun
dev-node OpenVPN
ca "C:\\Program Files\\OpenVPN\\config\\ca.crt"
cert "C:\\Program Files\\OpenVPN\\config\\server.crt"
key "C:\\Program Files\\OpenVPN\\config\\server.key" # This file should be kept secret
dh "C:\\Program Files\\OpenVPN\\config\\dh1024.pem"
server 10.198.1.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 10.198.0.0 255.255.255.0"
push "dhcp-option WINS 10.198.0.2"
push "dhcp-option DNS 10.198.0.2"
push "dhcp-option DOMAIN MYDOMAIN.local"
keepalive 10 120
persist-key
persist-tun
status openvpn-status.log
verb 6
Client:
client
dev tun
proto udp
remote myserver.mydomain.com 1289
resolv-retry infinite
nobind
persist-key
persist-tun
ca "C:\\Program Files\\OpenVPN\\config\\ca.crt"
cert "C:\\Program Files\\OpenVPN\\config\\work-lab.crt"
key "C:\\Program Files\\OpenVPN\\config\\work-lab.key"
ns-cert-type server
comp-lzo
verb 3
redirect-gateway def1
route-method exe
route-delay 2 #wait before adding routes pushed by server config
Thanks!