routerclub

时间:2024-07-04 16:36:45编辑:阿奇

如何在ros上做dns劫持

在ROS上,可以通过对53端口的UDP访问进行dst-nat,to-address指向我们自己的dns服务器或如果Ros开启DNS服务,也可以指向Ros本身。

WinBox设置:

  本例中使用ROS自带的DNS服务,ROS IP为192.168.27.254。

  首先开启ROS的DNS服务:Winbox中选IP->DNS,在Static页面中点Settings,按下图设置,其中202.96.64.68和202.96.69.38按你所在地区和ISP的DNS填写。





确定后在Winbox中选IP->Firewall,选NAT页面,点红色加号“+”,按下图设置:

Chian=dstnat,Protocol=UDP,Dst.Port=53,Action=dst-nat,To Address=192.168.27



命令行设置:

/ip firewall nat

add action=dst-nat chain=dstnat disabled=no dst-address-type=!local
dst-port=53 protocol=tcp to-addresses=192.168.0.1 to-ports=53

add action=dst-nat chain=dstnat disabled=no dst-address-type=!local
dst-port=53 protocol=udp to-addresses=192.168.0.1 to-ports=53

/ip dns

set allow-remote-requests=yes cache-max-ttl=1w cache-size=4096KiB
max-udp-packet-size=512 primary-dns=202.96.64.68
secondary-dns=202.96.69.38


ROS 双线固定IP,相同网关,怎么做负载或者分流!

ROS 电信两条光纤线路固定IP,同网关,负载或分流脚本如下:
1、首先划分VLAN(我们这里是从2开始排序的)
[admin@MikroTik] > :for i from=2 to=41 do= {interface vlan add name=("vlan".$i) vlan-id=$i interface=ether2-wan }

2、然后添加PPPOE拨号(先添加拨号再手动输入 每个AD的帐号和密码,40条AD设置还是要花点时间了),脚本如下:
[admin@MikroTik] > :for i from=2 to=41 do= {interface pppoe-client add name=("pppoe-out".$i) user=$i password=$i interface=("vlan".$i)}

3、我们这里采用PCC的负载均衡,在ip firewall mangle里添加相应的PCC规则,通过一些脚本添加PCC的规则,注意:如果PPPoE客户端拨号没有成功,那么添加的规则则为红色的,拨号成功后自动正常
[admin@MikroTik] > :for i from=2 to=41 do={/ip firewall mangle add chain=input action=mark-connection new-connection-mark=conn1 in-interface=("pppoe-out".$i)}


上一篇:招华曦城

下一篇:jeep2500四驱