Hello,
I have a Linksys 1900ac running OpenWrt Chaos Calmer 15.05-rc2. I have replaced Dropbear with OpenSSH.
I am unable to SSH to it from the WAN side. I want to SSH to the router when I traveling.
I am able to SSH to it from the LAN side.
I have seen several posts regarding this but I have not found a solution that works for me.
In troubleshooting this, I have configured OpenSSH to listen on port 22 instead of the custom port I was using.
The relevant rules in /etc/config/firewall are:
config rule
option target 'ACCEPT'
option dest_port '22'
option proto 'tcp'
option name 'SSH From WAN'
option src 'wan'
option dest_ip '192.168.101.10'
config redirect
option enabled '1'
option target 'DNAT'
option src 'wan'
option dest 'lan'
option proto 'tcp'
option dest_ip '192.168.101.10'
option dest_port '22'
option name 'WAN SSH to SSH'
option src_port '2202'
I tried it with and without the src_port option.
I notice there is no src_dport option. I assume this is the same as src_port above.
I have added the following to /etc/firewall.user
#SSH for every host from WAN
iptables -A input_wan_rule -p tcp --dport 2202 -j ACCEPT
I tried the above with port 22 as well.
From an OSX box and from an Android device I am using the following to connect:
ssh -p 2202 root@my_ip_address
and
ssh root@my_ip_address
I am able to ssh to the router from within the network.
What am I missing? What else do I need to do?
Here is the whole configuration:
~# cat /etc/config/firewall
config defaults
option syn_flood '1'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'REJECT'
config zone
option name 'lan'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
option network 'lan'
config zone
option name 'wan'
option output 'ACCEPT'
option masq '1'
option mtu_fix '1'
option input 'ACCEPT'
option forward 'ACCEPT'
option network 'wan wan6'
config rule
option name 'Allow-DHCP-Renew'
option src 'wan'
option proto 'udp'
option dest_port '68'
option target 'ACCEPT'
option family 'ipv4'
config rule
option name 'Allow-Ping'
option src 'wan'
option proto 'icmp'
option icmp_type 'echo-request'
option family 'ipv4'
option target 'ACCEPT'
config rule
option name 'Allow-IGMP'
option src 'wan'
option proto 'igmp'
option family 'ipv4'
option target 'ACCEPT'
config rule
option name 'Allow-DHCPv6'
option src 'wan'
option proto 'udp'
option src_ip 'fe80::/10'
option src_port '547'
option dest_ip 'fe80::/10'
option dest_port '546'
option family 'ipv6'
option target 'ACCEPT'
config rule
option name 'Allow-MLD'
option src 'wan'
option proto 'icmp'
option src_ip 'fe80::/10'
list icmp_type '130/0'
list icmp_type '131/0'
list icmp_type '132/0'
list icmp_type '143/0'
option family 'ipv6'
option target 'ACCEPT'
config rule
option name 'Allow-ICMPv6-Input'
option src 'wan'
option proto 'icmp'
list icmp_type 'echo-request'
list icmp_type 'echo-reply'
list icmp_type 'destination-unreachable'
list icmp_type 'packet-too-big'
list icmp_type 'time-exceeded'
list icmp_type 'bad-header'
list icmp_type 'unknown-header-type'
list icmp_type 'router-solicitation'
list icmp_type 'neighbour-solicitation'
list icmp_type 'router-advertisement'
list icmp_type 'neighbour-advertisement'
option limit '1000/sec'
option family 'ipv6'
option target 'ACCEPT'
config rule
option name 'Allow-ICMPv6-Forward'
option src 'wan'
option dest '*'
option proto 'icmp'
list icmp_type 'echo-request'
list icmp_type 'echo-reply'
list icmp_type 'destination-unreachable'
list icmp_type 'packet-too-big'
list icmp_type 'time-exceeded'
list icmp_type 'bad-header'
list icmp_type 'unknown-header-type'
option limit '1000/sec'
option family 'ipv6'
option target 'ACCEPT'
config include
option path '/etc/firewall.user'
config rule
option target 'ACCEPT'
option dest_port '22'
option proto 'tcp'
option name 'SSH From WAN'
option src 'wan'
option dest_ip '192.168.101.10'
config forwarding
option dest 'lan'
option src 'wan'
config forwarding
option dest 'wan'
option src 'lan'
config redirect
option enabled '1'
option target 'DNAT'
option src 'wan'
option dest 'lan'
option proto 'tcp'
option dest_ip '192.168.101.10'
option dest_port '22'
option name 'WAN SSH to SSH'
option src_port '2202'
=V=
(Last edited by VirG on 17 Jan 2016, 13:24)