2
1
I have a DD-WRT router which I would like access remotely via SSH. The DD-WRT is behind an ADSL router which has port forwarding for port 22 enabled, DD-WRT SSH access and service are set to port 22, as well. Remote access works fine. However, the DD-WRT is supposed to be permanently connected to a VPN server (using the built-in OpenVPN client).
The OpenVPN connection works fine but the remote SSH access only works when the VPN client is disabled.
I am reading that this may be related to all traffic being routed outbound through the VPN gateway, including traffic coming in through WAN. Is it correct that I would need to define a custom iptables setting for requests coming in through WAN to be responded via WAN, as well? If yes, how would I go about it? If no, what else could I do?
I am having a similar issue with the web GUI at port 8080 and a PPTP VPN server at port 1723, so I believe the issue is not related to SSH as such.
Here are the details of my setup:
Devices:
- TP-Link W8151N ADSL router
- TP-Link WR1043ND router with DD-WRT 25544
IP Addresses:
- ADSL router external:
115.x.x.x
- ADSL router internal:
192.168.1.1
- DD-WRT WAN IP:
192.168.1.100
(from ADSL router) - DD-WRT IP:
192.168.10.1
- DD-WRT IP external (VPN):
119.x.x.x
- DDNS alias pointing at the ADSL router’s connection:
115.x.x.x
Configuration:
- ADSL router with port forwarding activated for ports 22 / 8080, DDNS to
192.168.1.100
- DD-WRT set to allow remote GUI management at 8080, also from remote IPs and SSH access at 22, SSH activated in services, also at 22.
- DD-WRT connected to OpenVPN using built-in client feature in 'Services' tab
Edit 05 March: What I have tried in the meantime:
Adding the following to the Policy Based Routing field in OpenVPN client settings (idea: traffic that comes from the WAN ip should be routed back to the WAN interface, vlan2 or ppp0):
ip rule add from 192.168.1.1 table 200
ip route add default via 192.168.1.1 dev vlan2 table 200
ip route flush cache
Result: When VPN connection is established, I can no longer access the GUI and the web either. My router is set to reboot after three minutes of not being able to reach Google DNS, so after three minutes I have access to GUI and web again but only until the VPN connection is back up.
Am I completely on the wrong track with this approach?
I had a similar issue with a similar question. Perhaps my answer to my question can help you: http://superuser.com/a/900575/42531
– x-x – 2015-04-12T04:05:55.793Thanks, but possible misunderstanding? Posted my own solution below two weeks ago ;-) – nhee – 2015-04-14T15:23:21.157
Opps! I noticed an unaccepted answer but not who answered it. :) – x-x – 2015-04-14T22:15:27.390