找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 25980|回复: 10

【已解决】外网无法SSH远程访问Openwrt ,局域网内没有问题,已开放端口

[复制链接]
本帖最后由 bulier 于 2010-12-1 02:18 编辑

各位大侠, 请教如何设置才能通过SSH远程访问Openwrt?
已经设置好了动态域名解析, SSH也可以在局域网LAN内访问, 现在的问题是我想通过互联网Wan来访问家里的路由器, 不知道该如何设置?

官方论坛里面找了半天, 发现有个帖子是让修改防火墙添加wan的开放端口22. 这个已经做了, 可是还是不能访问。
If you vi /etc/firewall.user you will see:

### Open port to WAN
## -- This allows port 22 to be answered by (dropbear on) the router
iptables -t nat -A prerouting_wan -p tcp --dport 22 -j ACCEPT
iptables        -A input_wan      -p tcp --dport 22 -j ACCEPT

同时我还尝试了在如下方法, 同样是connection time out error。
the new UCI firewall in Kamikaze trunk:

Code:

# uci add firewall rule
# uci set firewall.@rule[-1].src=wan
# uci set firewall.@rule[-1].target=ACCEPT
# uci set firewall.@rule[-1].proto=tcp
# uci set firewall.@rule[-1].dest_port=22
# uci commit firewall
# /etc/init.d/firewall restart


貌似有看到帖子里面提到要做一个tap/tun桥接, 不知道是不是这样? 原理是什么呢?
我的恩山、我的无线 The best wifi forum is right here.
 楼主| | 显示全部楼层
Just google this article:晚上回家试试看
iptables -I INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

设置允许wan访问ssh了吗
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
设置允许wan访问ssh了吗
rickyo0 发表于 2010-11-30 16:11

这个在哪儿设置啊, 我已经设置开放了相关的端口了。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

根本就不需要手动设置开放22端口
只要你设置允许remote ssh就可以了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
根本就不需要手动设置开放22端口
只要你设置允许remote ssh就可以了
rickyo0 发表于 2010-11-30 21:27

能不能简单说说如何才能允许remote ssh呢?找不到设置页面,是要修改配置文件吗?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
已经解决, 是自己不小心把动态域名的用户名写错了。同学们以后遇到类似问题一定要先检查是不是可以通过ip连接上。 还有动态域名是不是配置更新正确。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

遇到同样的问题。。。

Lan内可以连ssh,外网就不行了,设置端口映射了,不行啊。。。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

我已经设置了Allow remote hosts to connect to local SSH forwarded ports,还是无法从外网链接。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

jiche 发表于 2012-4-8 15:06
我已经设置了Allow remote hosts to connect to local SSH forwarded ports,还是无法从外网链接。

已经打开了Allow remote hosts to connect to local SSH forwarded ports
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

外网连就报错 connect is closed by foreign host  咋办
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

欢迎大家光临恩山无线论坛上一条 /1 下一条

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-28 16:15

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表