with the VPN you probably need to get your server to push routing information to client
Also is the VPN server running on your target, or somewhere else on your local network? If 'somewhere else' you may need a tap bridge instead of a tunnel, or iptable rules You could run into problems if you use a common IP address like 192.168.0.x best to mix it up a little, e.g 192.168.219.x so your client doesn't endup talking to something local to it instead of your VPN |
Not sure if you've already done this, but have you already tried pinging the other box?
Also, what verifications have you made to check that the port on the other box is visible from the local box? |
Bit a of a delay with this, as it's "that time of the year" (interpret that as you like).
The VPN server is hosted through my employer so that I can work from home. I've got two computers with SSH server running on them. I can log into both. I've changed my network to 192.168.168.xxx to ensure that it's less common. I've tried pointing my router at either computer for SSH, and neither respond from outside my network if the VPN client is connected. As soon as I disconnect the VPN, then I can connect from outside the network. I believe (please remember I am not a computer person, just a regular guy who is a complete newbie with computers) that this, along with my router log, demonstrates my router port forwarding is working fine. I need to be able to connect to my local network's public IP -> SSH, I'm sure if I talked really nicely to my work they would forward SSH traffic, but depending on which site I'm working for depends on which address I connect to for the VPN and therefore the public IP of that VPN would change too. |
Let me see I have this right..
I think this is because your router is sending all traffic through the VPN BUT lots of guessing going on there, I am probably way off. please detail where the VPN Client is on your network |
Very nearly.
My Broadband connection comes via my router into which all devices are plugged into. I have one main 'server' (a grand word for a very old computer left on all the time), which runs as a SSH server and an OpenVPN client into my work. I want to take my laptop out and about and SSH into my 'server'. I connect into my public IP/Router which forwards on the connection into my 'server'. If OpenVPN isn't running, it works fine. If OpenVPN is running, it fails. |
hmm,
try adding this to your OpenVPN client.conf Code:
route 192.168.168.1 255.255.255.255 net_gateway wait, that will probably kill the VPN OK, back to your sshd config Code:
# What ports, IPs and protocols we listen for Code:
sudo service ssh restart |
I'll try this when I get home.
Thanks :) |
Quote:
|
Quote:
I'll have a look at Prerouting but I'm fairly sure it will make as much sense to me as iptables man page does. |
actually, preroute looks overkill
found this http://serverfault.com/questions/425...nternal-server which looks a perfect fit for you. |
Goodness that does look pretty good!
In my journeys of searching trying to resolve this, I have changed the port to 443 (in case my ISP was blocking certain ports), which (I read) serves a two fold effect. 1) It will get round any public firewalls that try to restrict outgoing ports. 2) More importantly: It may assist in preventing anyone from trying to hack/crack/break into my SSH server as when they port scan me it doesn't look like an SSH server. Would that interfere with my setup at all, as it's a machine with no monitor plugged in, so it's doubtfully any web browsing will occur on it. Please feel free to re-educate me if either of these two 'facts' are not facts at all, as computers and their security are hardly my forté, but they certainly sound plausible. |
Quote:
Also, what's the best method of making it permanent in Debian? I've read about a few methods for making IP tables for example. Thanks |
you need to execute those commands once your VPN is up,
( ok not all of them, e.g. you no longer need echo "201 novpn" >> /etc/iproute2/rt_tables ) so I would look at how you are starting VPN, and if it will run post scripts for you if you are starting via init.d service you could add to that You could also have it 'undo' when the vpn is stopped ( via init.d ) |
Thanks. The VPN starts through /etc/init.d/openvpn which runs at boot so it connects automatically for me. I had a look at that file and there doesn't seem to be anything obvious as to where to put extra commands. In fact, it looks horrifyingly complicated. None of the comments mention anything like "Run X once started" or words to that effect.
I have the commands I entered listed below a file with #!/bin/sh at the top. I have that saved in /etc/openvpn/ and it's executable. |
ok,
I'm on Debian jessie/sid which is not a million miles away from Mint Debian. This is a little crude, using sed to add two functions one to 'fix ssh' and the other to 'undo the fix' to get it to write, add -i Code:
sed -e '/start_vpn ()/ i fix_ssh () {\ I should point out, untested. |
All times are GMT -5. The time now is 06:49 AM. |