MikroTik – 不能从外部访问webfig /不能从外部ip的SSH到路由器

好,

这是交易。

假设我面向公众的IP是10.0.01。 我不能从外部networking到10.0.01,不能从外部IP SSH到mikrotik路由器

我可以做到这一点,如果我物理连接到路由器(在同一局域网)。 它允许我通过使用10.0.0.1或使用192.168.88.1 webfig和SSH。

但是,如果我在不同的局域网上,无法连接。

顺便说一句,我设置我的IP>服务> webfig的端口是64291和SSH是23。

这是我的防火墙规则和NAT

规则

0 ;;; ALLOW ALL TO LAN chain=input action=accept connection-state=established,related,new in-interface=bridge-local log=no log-prefix="" 1 ;;; ALLOW ICMP (Ping) ON ALL chain=input action=accept protocol=icmp log=no log-prefix="" 2 ;;; Drop Everything Else chain=input action=drop log=no log-prefix="" 3 ;;; default configuration chain=input action=drop in-interface=ether1-gateway log=no log-prefix="" 4 ;;; default configuration chain=forward action=accept connection-state=established,related,new in-interface=bridge-local log=no log-prefix="" 5 ;;; default configuration chain=forward action=drop connection-state=invalid log=no log-prefix="" 6 ;;; default configuration chain=forward action=drop connection-state=new connection-nat-state=!dstnat in-interface=ether1-gateway log=no log-prefix="" 

NAT

 0 ;;; default configuration chain=srcnat action=masquerade to-addresses=XXXX out-interface=ether1-gateway log=no log-prefix="" 1 chain=dstnat action=dst-nat to-addresses=192.168.88.200 protocol=tcp dst-address=XXXX dst-port=80 log=no log-prefix="" 2 chain=srcnat action=src-nat to-addresses=XXXX protocol=tcp src-address=192.168.88.0/24 log=no log-prefix="" 3 chain=dstnat action=dst-nat to-addresses=192.168.88.200 to-ports=22 protocol=tcp dst-address=XXXX dst-port=22 log=no log-prefix="" 4 chain=srcnat action=src-nat to-addresses=192.168.88.200 to-ports=22 protocol=tcp src-address=192.168.88.0/24 log=no log-prefix="" 5 chain=dstnat action=dst-nat to-addresses=192.168.88.1 protocol=tcp dst-address=XXXX dst-port=23 log=no log-prefix="" 

禁用规则#2 +#3并再次testing。 或者你可以为你的ssh + www端口设置一个例外

您正在从ether1-gateway中删除所有stream量。

规则#2 +#3实际上是相同的。 我build议你删除#2


更新的答复

为了build立一个安全的路由器不是最好的做法来改变端口,造成一种错误的安全感。 不过是一个简单的实现。

如何保护打开/redirect端口

 /ip firewall filter add chain=input dst-port=22,80,443 in-interface=ether1-gateway protocol=tcp /ip firewall filter add action=drop chain=input in-interface=ether1-gateway 

PD:ether1-gateway是广域网端口,dst-port是你想要打开的端口。 移动这些filter,取代Mikrotik的第2号和第3号,并保留这个命令!

然后,证实您的密码+连接,并作出主动分析控制你失败/暴力试图连接:

  1. 在Linux系统中使用fail-to-ban,或者使用反暴力攻击脚本 – > Bruteforcelogin预防
  2. 使用长密码,上部+小写字母与数字混合
  3. 使用安全连接,如http s s sh,telnet或http