LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Forward all ssh traffic bypassing VPN. (https://www.linuxquestions.org/questions/linux-networking-3/forward-all-ssh-traffic-bypassing-vpn-4175536719/)

theisotopes 03-14-2015 08:40 AM

Forward all ssh traffic bypassing VPN.
 
Hello,

I'm running Ubuntu with iptables at home. I can ssh into the PC with no issues at all.

When I enable my VPN from the Ubuntu system, I can no longer ssh into my system, which is expected.

I'm wondering if anyone can help me with the iptables rule I need to set to forward all ssh traffic to my ISP gateway rather than the default gateway that gets set once the VPN is active.

I hit my IP via port 2222 externally when I want to ssh. I have a port forward rule on my router to forward all 2222 traffic to port 22 on my Ubuntu box. (This works fine unless VPN is active).

Lets say my Ubuntu box has eth0 at 192.168.1.200
and lets say my ISP gateway on the router is 27.96.200.200

I'm sure it is a fairly simple rule that needs to be set, if anyone could give me an example I'd be hugely appreciative.

Thanks a lot.
Craig

sag47 03-15-2015 08:20 AM

What are your iptables rules? You should post them but redact public IPs.

theisotopes 03-15-2015 08:23 AM

Hello, I don't have any iptables rules set up at the moment.

iptables is empty.

I was hoping for a rule just to do this if it is even possible.

Thanks

sag47 03-15-2015 09:14 AM

Have you tried to SSH to 192.168.1.200:22? Here's a link to my firewall rules. I SSH to my internal interface through VPN.

philix 03-18-2015 05:31 AM

Quote:

Originally Posted by theisotopes (Post 5332013)
Hello,

I'm running Ubuntu with iptables at home. I can ssh into the PC with no issues at all.

When I enable my VPN from the Ubuntu system, I can no longer ssh into my system, which is expected.

I'm wondering if anyone can help me with the iptables rule I need to set to forward all ssh traffic to my ISP gateway rather than the default gateway that gets set once the VPN is active.

I hit my IP via port 2222 externally when I want to ssh. I have a port forward rule on my router to forward all 2222 traffic to port 22 on my Ubuntu box. (This works fine unless VPN is active).

Lets say my Ubuntu box has eth0 at 192.168.1.200
and lets say my ISP gateway on the router is 27.96.200.200

I'm sure it is a fairly simple rule that needs to be set, if anyone could give me an example I'd be hugely appreciative.

Thanks a lot.
Craig

The usual trend during the VPN connectivity would be to create a new NIC called VNIC* or uTun* which takes precedence for any network connectivity both INBOUND and OUTBOUND
Please check whether the INBOUND SSH connectivity is heading towards that VPN NIC

Thanks
Philix


All times are GMT -5. The time now is 09:52 PM.