Created
August 24, 2012 06:39
-
-
Save lynus/3446706 to your computer and use it in GitHub Desktop.
openwrt:allow wan ssh into your wrt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
by default,openwrt do not allow ssh access from wan, here are two method to change that: | |
1.login into your wrt from a lan host.issue the following command: | |
iptables -F | |
the command "flush away" all the firewall rules,including the one that rejects ssh request from wan. | |
now you can try ssh from anywhere. | |
aware that the firewall deactivation leads to highly security risk.and after the wrt restarts ,all default firewall configuration comes back.you hava to "flush" the rules once again. | |
2.add the following lines in /etc/config/firewall : | |
config rule | |
option src wan | |
option dest_port 22 | |
option target ACCEPT | |
option proto tcp | |
after restart ('reboot' commmand),wrt accept port 22 request (in this case ,ssh request)from wan. |
10 years later thanks @lynus !
You are welcome! I cannot believe it's 10 years. How time flies.
11 years later thanks @lynus 👍
It works. For recent OpenWRT destros, you would need to add '
mark
config rule
option src 'wan'
option dest_port '22'
option target 'ACCEPT'
option proto 'tcp'
12 years later thank you @lynus
thank you @lynus !
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
10 years later thanks @lynus !