Can't connect directly to IP - need to connecting to domain

Need help configuring your VPN? Just post here and you'll get that help.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
GreyIBlack
OpenVpn Newbie
Posts: 2
Joined: Fri Oct 01, 2010 11:03 am

Can't connect directly to IP - need to connecting to domain

Post by GreyIBlack » Fri Oct 01, 2010 11:10 am

Basically, I'm trying to use a VPN to manage a website of mine while at school, but I can't because they are using a port for the CPanel that is blocked by my school's proxy server. The only ports allowed are 80, 8080, and 443 (as far as I can tell) and in order to create a connection on those ports they must have a hostname. I have no idea what the sysadmin was thinking but he decided that we cannot directly connect to IPs. I'd prefer not to bother him based on the reputation and attitude of the technicians at my district, so I'm thinking if it's possible to connect to the domain which would route me to the IP instead of directly to the IP.

openvpn.ovpn (client):

Code: Select all

client
remote vpn.matthewhall.ca 443
persist-key
tls-client
tls-auth ta.key 1
proto 

tcp-client
ca ca.crt
redirect-gateway def1
dev tun
persist-tun
cert crt.crt
comp-lzo
nobind
key key.key
pull
cipher AES-256-CBC
verb 4
However, when connecting, I get this:

Code: Select all

Fri Oct 01 13:54:24 2010 us=400000 Attempting to establish TCP connection with 67.159.56.2:443
Fri Oct 01 13:54:25 2010 us=398000 TCP: connect to 67.159.56.2:443 failed, will try again in 5 seconds: Connection refused (WSAECONNREFUSED)
It does recognize that the remote is vpn.matthewhall.ca:443, but it tries to connect to the IP for it - 67.159.56.2:443. Any reason why it is doing this? Any reason to make it connect to vpn.matthewhall.ca instead?

User avatar
krzee
Forum Team
Posts: 728
Joined: Fri Aug 29, 2008 5:42 pm

Re: Can't connect directly to IP - need to connecting to dom

Post by krzee » Tue Oct 05, 2010 1:55 am

GreyIBlack wrote: It does recognize that the remote is vpn.matthewhall.ca:443, but it tries to connect to the IP for it - 67.159.56.2:443. Any reason why it is doing this? Any reason to make it connect to vpn.matthewhall.ca instead?
There is no such thing... the internet does not route traffic based on hostname. Your computer finds the IP using DNS lookups, then connects to the IP.

Either you can not use that ip:port/protocol because of a firewall, you have not correctly configured a firewall, or you have not setup your port forwarding.

GreyIBlack
OpenVpn Newbie
Posts: 2
Joined: Fri Oct 01, 2010 11:03 am

Re: Can't connect directly to IP - need to connecting to dom

Post by GreyIBlack » Tue Oct 05, 2010 10:40 am

krzee wrote:
GreyIBlack wrote: It does recognize that the remote is vpn.matthewhall.ca:443, but it tries to connect to the IP for it - 67.159.56.2:443. Any reason why it is doing this? Any reason to make it connect to vpn.matthewhall.ca instead?
There is no such thing... the internet does not route traffic based on hostname. Your computer finds the IP using DNS lookups, then connects to the IP.

Either you can not use that ip:port/protocol because of a firewall, you have not correctly configured a firewall, or you have not setup your port forwarding.
I have no control over the firewall, it belongs to the school, as I said. The VPN I am attempting to connect to is using default SSL port, 443. I am able to connect to 443 but when the request reaches the proxy server, the request must be going to a hostname, not directly to an IP, or it returns access denied. It doesn't matter if the traffic is routed to the IP, the DNS lookup has to be performed by the proxy server, but OpenVPN is ignoring that and doing the DNS lookup itself, while browsers do otherwise. I'll add the HTTP proxy to the configuration, but OpenVPN GUI is already doing that itself, supposedly.

EDIT: Alright, that setting is apparently not applied or useless. I applied it myself and now it is working besides one error. Led me to this URL: http://openvpn.net/index.php/open-sourc ... clientserv

But everything seems to be in order now. I'll just have to test it sometime later.

Post Reply