admin管理员组

文章数量:1537537

2024年1月25日发(作者:)

Routeros的安装和电信/网通双线光纤,策略路由/双线分流/双线备份,全局速度限制,线程限制,DHCP服务器,PPPOE服务器和VPN,Hossport设置WEB认证上网方式,防火墙,图文教程 本人QQ:157357366

注意因为网上有很多现成的图片教程,但是真真假假,版本不明,所以我这个集合教程里有很多图片不是原创,并且这里所有技术全部可以使用在2.9以上版本的ROS上。。虽然里面整理的不全部是原创,但是经过我的整理以及一些地方的衔接修改,现在这些东西变得简单易懂了。只要稍微动动脑,这些功能你都能实现,而且几乎这些功能对你都有用处。呵呵,说了这么多废话,意思大概就是只要你认真按着我的这个教程去做,那就一定会打造出属于你自己的路由器的。

RouterOS的安装和破解:

软件的安装:

a. 在BIOS中设置从光盘启动计算机。

b. 使用光盘启动计算机时,会出现下面的界面:让你选择安装的模块,呵呵,我选择全部安装,键盘输入a,然后输入i开始安装。

c.

计算机提醒你是不是要保留以前的设置,我是全新安装的,我按n回车,不保留。然后计算机提示继续否,废话,不继续干嘛,按y继续。计算机开始安装了。

你就等着安装完成出现让你按回车键继续的画面,计算机重新启动后就行了。

由于我安装的是破解的系统,所以计算机重新启动之后就没有要求我输入什么许可证之类的。若你下载的是需要破解的系统,请自己找资料破解,嘿嘿!

在字符界面下,系统的简单初始设置:系统安装之后重新启动,然后出现登陆界面,输入初始用户名admin,口令直接回车。进入RouterOS的字符界面,好了,现在开始我们的简单初始设置阶段。

1、 更改网卡的名称以方便区分不同的网络接口。为方便区分我们作如下规定:接入互联网的网络接口命名为Wan,其接入互联网的方式是通过dhcp客户端动态获取IP地址。接入局域网的互联网接口我们命名为Lan,网卡的IP地址我们规定为192.168.0.254。另外,我们设定内部网络的地址是192.168.0.0,网络掩码为255.255.255.0(也就是/24),网关地址为0.0.0.0(特别提示,这里一定要设定为0.0.0.0,有的教程中把这里设定为192.168.0.254,甚至于有的教程里把Lan的地址设定为192.168.0.1之后还把网关设定为192.168.0.254,我认为这

些设定都是不对的。因为我按照那些教程里设定之后局域网无法共享上网)。

命令执行过程和显示界面如下:

输入:int进入网卡的设置界面,

然后输入print查看网卡是否启用

(备注:默认是启用的,标志是网卡名字前面显示R,比如我的网卡ether1前面显示R。若没有启动,则显示X。若没有启用网卡,则输入命令en 0和en 1)。

输入如下命令更改网卡的名称

en 0

en 1

set 0 name=Lan

set 1 name=Wan

输入/

退回到根目录,设定网卡地址等信息。

输入setup

我们开始设定服务器网卡的信息,输入a出现如下界面

在输入一个a系统让你设定网卡的ip地址,我们要设定局域网接口Lan的地址,

(备注,若这里出现的不是Lan,而是Wan,你需要把它改成Lan)

输入我们设定的Lan的IP地址192.168.0.254/24

系统然后让你输入网关的地址,千万要注意不要输入默认的地址,而是要改为0.0.0.0,特别提醒你哇。

设定完成之后,我们输入x退出局域网网卡的设定。

好了,局域网网卡我们设定成功了,我们终于在一次输入x来退出这个字符界面了,下一步我们将通过windows下的winbox来设定RouterOS。

进入winbox界面。

在局域网的另外一台安装有windows的计算机上,设定其ip地址为192.168.0.1-192.168.0.253中的任意一个就行,然后掩码输入255.255.255.0,网关设定为192.168.0.254。比如我在另外的一台安装有windows XP的计算机上设定如下图:

设定完成之后,就可以打开IE浏览器,在地址栏中输入192.168.0.254来访问我们的RouterOS服务器了。(备注:若你的计算机无法访问192.168.0.254,则首先请你检查RouterOS

服务器上接局域网的那根网线是否接到了Wan口上了。若接线正确则请你检查网络的物理连接以及windows操作系统的网络设置等等,网络连接问题不是本文重点,若存在这个问题请你上网查资料来解决)。

我们点击Winbox的图标来下载程序,然后运行这个程序

在connect to 中输入我们的RouterOS服务器的地址192.168.0.254,用户名中输入admin,我

们没有设定密码,所以密码不输入,为了便于以后进入服务器,我们按save按钮保存此次设置。如下图

然后我们点击connect按钮,登陆我们的RouterOS系统。

好了,从今往后,我们基本都在这个winbox模式下对routeros进行操作了。

点击WINBOX里的第一项Interfaces 在弹出画面里 修改网卡名称,分别给三张网卡命名,便于区分传输介质。

设定公网网络接口Wan。

依次点击ip/address, 按“+”号,在interface中选择公网接口Wan,输入公网地址,广播地址等信息,然后apply,接着OK就行了。其他的上网方式请上网找资料进行设置)。

做MASQ伪装 设定局域网共享上网。

在winbox下,依次点击ip /firewall /nat/ ,选择 + 号,chain中选择srcnat,在action,action里面选择 masquerade ,其余选择默认即可,然后apply,接着OK就行了。至此,局域网可以共享上网了。

做双线有3种方法,最早的方法就是添加路由表,策略效率较低。此方法是最简单的,还有一种方法是利用地址列表做MANGLE标记。

做双线备份另外种方法,最简单的就是利用Distance的优先级来做,选择PING检测,主线优先级高于备份路由的优先级,当主线DOWN掉就会显示蓝色失效状态,备份的路由规则就自然生效接替使用。不需要脚本就完成自动切换。

下面讲讲双线分流的做法。双线分流一般都是同ISP的几条线路达到减轻单线带宽不足的情况。下面是最基本的就是平均分配100台机器,50台走一条线。更好的做法可以做到光纤玩游戏,ADSL线路可做分流QQ,WEB等,具体做法就是在目标端口上填写QQ是8000端口,UDP协议,WEB当然是80端口了。都是很灵活的。

下面是 网通CNC的路由表,以电信为主线

下面讲一下全局限制速度和限制线程

限速脚本+ 限线程脚本(2.9.X)

限线程脚本:

:for aaa from 2 to 254 do={/ip firewall filter add chain=forward src-address=(192.168.0. . $aaa)

protocol=tcp connection-limit=50,32 action=drop}

限速脚本:

:for user from 2 to 254 do={/queue simple add name=("第" . $user . "号机")

dst-address=("192.168.0." . $user . "/32") max-limit=2048000/1024000}

说明:

aaa是变量

2 to 254是2~254

192.168.0. . $aaa是IP

192.168.0." . $user也是IP

上两句加起来是192.168.0.2~192.168.0.254

connection-limit=50是线程数这里为50

max-limit=2048000/1024000是上行/下行

使用:

WinBox-System-Scripts-+

Name(脚本名程)

Source(脚本)

OK-选择要运行的脚本-Run Script

查看:

限线程:WinBox-IP-Firewall-Filter Rules(看是否已经填加进来)

限速:WinBox-Queues-Simple Queues(看是否已经填加进来)

设定dhcp服务器。

ip/dhcp server /setup/,在dhcp interface中选择Lan,next,dhcp server space中输入192.168.0.0/24,next,整个局域网的网关是192.168.0.254所以在gateway for dhcp network中输入192.168.0.254,然后next,一路next就行了。

除此之外,你可能希望某台计算机一直获取某个固定的ip地址,你可以这样设定:ip/dhcp

server/leases/选择+号/,address中输入你想分配给他的ip地址,然后再mac address中输入他的计算机的网卡mac地址,然后apply,接着OK就行了。

设定vpn服务器。

建立vpn的方式有很多种,可以通过pptp协议也可以通过L2TP等,我们这里依pptp协议举例。

Interfaces/在Wan上面右击鼠标,在弹出的菜单中选择add /pptp server/apply/ok。

在IP--Pool里添加地址池。我输入的是192.168.0.100-192.168.0.150,名称命名为pptp-pool

/apply/ok。

在PPP--Profiles中添加规则,在name 中输入pptp-Profile,然后在local address 中选择我们刚才建立的地址池pptp-pool,Remote address中选择pptp-pool。然后在压缩、加密等3个选择yes,最后一个选择defaule。

在PPP--Secrets中添加拨号用户,在name中输入你设定的登陆pptp的用户名。我设定为:pptp-test,密码也设定为pptp-test,service选择pptp,profile选择我们刚才建立的pptp-Profile。(注意,若

我们在pptp-Profile文件中没有设定Remote address,则这里一定要设定一个地址,具体什么地址你随便输入一个就行了,否则window登陆的时候会出问题。)

然后ppp/interfaces/pptp server/,在enabled前面打上钩,在pap和chap等4个选项全打上钩。Apply/ok就行了。

若要添加更过的用户,请重复在PPP—Secrets中的步骤,添加更多的用户。

Vpn服务器建立之后,你可以用Windows XP建立一个到Wan口的公网地址的VPN连接(注意是公网地址哇,别搞错了),然后测试是否成功,呵呵!

建立PPPOE服务器。

在局域网建立PPPOE服务器可以彻底根绝ARP流窜,呵呵,大致步骤和建立vpn服务器差不多。但是要注意我们是建立在Lan口上的。

Interfaces/在Lan上面右击鼠标,在弹出的菜单中选择add /pppoe server/apply/ok。

在IP--Pool里添加地址池。我输入的是192.168.0.151-192.168.0.200,名称命名为pppoe-pool

/apply/ok。

在PPP--Profiles中添加规则,在name 中输入pppoe-Profile,然后在local address 中选择我们刚才建立的地址池pppoe-pool,Remote address中选择pppoe-pool。然后在压缩、加密等3个选择yes,最后一个选择defaule。

在PPP--Secrets中添加拨号用户,在name中输入你设定的登陆pppoe的用户名。我设定为:pppoe-test,密码也设定为pppoe-test,service选择pppoe,profile选择我们刚才建立的pppoe-Profile。

(注意,若我们在pppoe-Profile文件中没有设定Remote address,则这里一定要设定一个地址,具体什么地址你随便输入一个就行了,否则window登陆的时候会出问题。)

然后ppp/interfaces/pppoe server/按+号,在pap和chap等4个选项全打上钩。Apply/ok就行了。

若要添加更过的用户,请重复在PPP—Secrets中的步骤,添加更多的用户。

PPPOE服务器建立之后,你可以用Windows XP建立一个PPPOE拨号连接测试是否成功

hosspot设置

Hosspot是一个很有用的功能,可以控制网络中的计算机对网络的访问,其实现的功能和PPPOE类似。

当局域网中设置了Hosspot服务之后,若客户计算机通过浏览器访问网页时,首先会弹出一个认证页面(类似于国内好像叫作“城市热点”公司的产品提供的局域网认证管理功能),要求输入用户名和密码,只有通过认证的客户才能访问互联网,即便你的计算机设置了DHCP服务并从DHCP服务器获取网关的地址也不行,呵呵!我觉得这方面比PPPOE更好(但是PPPOE可以防止Mac地址欺骗)。好了,下面我们开始设置我们的Hosspot服务了。

首先我们要更改www服务的端口。过程如下:从WinBox中,依次点击:IP/Services,然后双击WWW,在弹出的窗口的Port处中输入一个端口号码,我这里输入8080。然后apply /OK。

然后,在Lan口增加hotspot服务,过程如下:从winbox中,依次点击:IP/hotspot,点击servers中的setup按钮,在hotspot Interfaces中选择Lan,Next,Local address of network 中不要使用默认的IP192.168.0.254/24,而要设置为其他的与你的真实的局域网的地址不同的IP段,比如我设置为10.10.10.1/24,否则远程客户通过VPN连接以及PPPOE客户端通过Lan连接的时候会出问题 ,NEXT,address pool of network中输入通过hotspot认证后的客户的IP地址的地址段(我采用了默认的IP段10.10.10.2-10.10.10.254),NETX,在 sele certificate中不作选择(这是认证的方式,为简单起见,我选择了None),在Ip address of smtp server中不输入,next,dns server中输入dns服务器的地址,netx, dns name中随便输入,然后在create local hotspot user(建立本地hotspot用户)中,输入你要登陆的用户名和密码),next,OK。什么,这时候winbox提示网络连接断开?

呵呵,不要着急,这代表我们的hotspot服务已经建立并开始运行了。客户机输入任何网址,

都自动跳转到登陆页面,输入账号密码,继续浏览。如果使用ftp、pop3等,也必须先通过网页登录,才可以使用,当然使用winbox的时候也必须先登录。我们现在在地址栏中输入一个网址,在弹出的登陆页面中输入我们刚才的用户名和密码吧。出现欢迎界面之后(这时候不要在网页中点击log off),你就可以再一次启动winbox了。

若你要增加更多的hotspot服务的用户,请在winbox中依次点击ip/hotspot/user/按“+”号,增加用户并输入密码!

下面是防火墙部分

/ ip firewall filter

add chain=input connection-state=invalid action=drop

comment="丢弃非法连接数据" disabled=no

add chain=input protocol=tcp dst-port=80 connection-limit=20,0 action=drop

comment="限制总http连接数为20" disabled=no

add chain=input protocol=tcp psd=21,3s,3,1 action=drop

comment="探测并丢弃端口扫描连接" disabled=no

add chain=input protocol=tcp connection-limit=3,32 src-address-list=black_list

action=tarpit comment="压制DoS攻击" disabled=no

add chain=input protocol=tcp connection-limit=10,32

action=add-src-to-address-list address-list=black_list

address-list-timeout=1d comment="探测DoS攻击" disabled=no

add chain=input dst-address-type=!local action=drop comment="丢弃掉非本地数据"

disabled=no

add chain=input protocol=icmp action=jump jump-target=ICMP

comment="跳转到ICMP链表" disabled=no

add chain=ICMP protocol=icmp icmp-options=0:0-255 limit=5,5 action=accept

comment="Ping应答限制为每秒5个包" disabled=no

add chain=ICMP protocol=icmp icmp-options=3:3 limit=5,5 action=accept

comment="Traceroute限制为每秒5个包" disabled=no

add chain=ICMP protocol=icmp icmp-options=3:4 limit=5,5 action=accept

comment="MTU线路探测限制为每秒5个包" disabled=no

add chain=ICMP protocol=icmp icmp-options=8:0-255 limit=5,5 action=accept

comment="Ping请求限制为每秒5个包" disabled=no

add chain=ICMP protocol=icmp icmp-options=11:0-255 limit=5,5 action=accept

comment="Trace TTL限制为每秒5个包" disabled=no

add chain=ICMP protocol=icmp action=drop comment="丢弃掉任何ICMP数据"

disabled=no

add chain=forward connection-state=invalid action=drop

comment="丢弃非法数据包" disabled=no

add chain=forward protocol=tcp connection-limit=80,32 action=drop

comment="限制每个主机TCP连接数为80条" disabled=no

add chain=forward src-address-type=!unicast action=drop

comment="丢弃掉所有非单播数据" disabled=no

add chain=forward content=.exe action=drop comment="禁止.exe文件通过"

disabled=yes

add chain=forward content=.dll action=drop comment="禁止.dll文件通过"

disabled=yes

add chain=forward protocol=icmp action=jump jump-target=ICMP

comment="跳转到ICMP链表" disabled=no

add chain=forward action=jump jump-target=virus comment="跳转到病毒链表"

disabled=no

add chain=virus protocol=tcp dst-port=41 action=drop

comment="-1" disabled=no

add chain=virus protocol=tcp dst-port=82 action=drop

comment=".Y@mm" disabled=no

add chain=virus protocol=tcp dst-port=113 action=drop

comment=".A/B/C/D/E/F-1" disabled=no

add chain=virus protocol=tcp dst-port=2041 action=drop

comment=".A/B/C/D/E/F-2" disabled=no

add chain=virus protocol=tcp dst-port=3150 action=drop

comment="-2" disabled=no

add chain=virus protocol=tcp dst-port=3067 action=drop

comment=".A/B/C/D/E/F-3" disabled=no

add chain=virus protocol=tcp dst-port=3422 action=drop

comment="nz.R-1" disabled=no

add chain=virus protocol=tcp dst-port=6667 action=drop

comment=".A/B/C/D/E/F-4" disabled=no

add chain=virus protocol=tcp dst-port=6789 action=drop

comment=".S/T/U@mm" disabled=no

add chain=virus protocol=tcp dst-port=8787 action=drop

comment="-1" disabled=no

add chain=virus protocol=tcp dst-port=8879 action=drop

comment="-2" disabled=no

add chain=virus protocol=tcp dst-port=8967 action=drop

comment=".A/B-2" disabled=no

add chain=virus protocol=tcp dst-port=9999 action=drop

comment=".A/B-3" disabled=no

add chain=virus protocol=tcp dst-port=20034 action=drop

comment="-2" disabled=no

add chain=virus protocol=tcp dst-port=21554 action=drop

comment="-1" disabled=no

add chain=virus protocol=tcp dst-port=31666 action=drop

comment="-3" disabled=no

add chain=virus protocol=tcp dst-port=43958 action=drop

comment="nz.R-2" disabled=no

add chain=virus protocol=tcp dst-port=999 action=drop

comment="-3" disabled=no

add chain=virus protocol=tcp dst-port=6670 action=drop

comment="-4" disabled=no

add chain=virus protocol=tcp dst-port=6771 action=drop

comment="-5" disabled=no

add chain=virus protocol=tcp dst-port=60000 action=drop

comment="-6" disabled=no

add chain=virus protocol=tcp dst-port=2140 action=drop

comment="-7" disabled=no

add chain=virus protocol=tcp dst-port=10067 action=drop

comment="-1" disabled=no

add chain=virus protocol=tcp dst-port=10167 action=drop

comment="-2" disabled=no

add chain=virus protocol=tcp dst-port=3700 action=drop

comment="-3" disabled=no

add chain=virus protocol=tcp dst-port=9872-9875 action=drop

comment="-4" disabled=no

add chain=virus protocol=tcp dst-port=6883 action=drop

comment="-1" disabled=no

add chain=virus protocol=tcp dst-port=26274 action=drop

comment="-2" disabled=no

add chain=virus protocol=tcp dst-port=4444 action=drop

comment="-3" disabled=no

add chain=virus protocol=tcp dst-port=47262 action=drop

comment="-4" disabled=no

add chain=virus protocol=tcp dst-port=3791 action=drop

comment="-1" disabled=no

add chain=virus protocol=tcp dst-port=3801 action=drop

comment="-2" disabled=no

add chain=virus protocol=tcp dst-port=65390 action=drop

comment="-3" disabled=no

add chain=virus protocol=tcp dst-port=5880-5882 action=drop

comment="-1" disabled=no

add chain=virus protocol=tcp dst-port=5888-5889 action=drop

comment="-2" disabled=no

add chain=virus protocol=tcp dst-port=30100-30103 action=drop

comment="-1" disabled=no

add chain=virus protocol=tcp dst-port=30133 action=drop

comment="-2" disabled=no

add chain=virus protocol=tcp dst-port=7300-7301 action=drop

comment="-1" disabled=no

add chain=virus protocol=tcp dst-port=7306-7308 action=drop

comment="-2" disabled=no

add chain=virus protocol=tcp dst-port=79 action=drop

comment="-1" disabled=no

add chain=virus protocol=tcp dst-port=5031 action=drop

comment="-2" disabled=no

add chain=virus protocol=tcp dst-port=5321 action=drop

comment="-3" disabled=no

add chain=virus protocol=tcp dst-port=6400 action=drop

comment="-1" disabled=no

add chain=virus protocol=tcp dst-port=7777 action=drop

comment="-2" disabled=no

add chain=virus protocol=tcp dst-port=1047 action=drop

comment="-1" disabled=no

add chain=virus protocol=tcp dst-port=6969-6970 action=drop

comment="-2" disabled=no

add chain=virus protocol=tcp dst-port=2774 action=drop comment="SubSeven-1"

disabled=no

add chain=virus protocol=tcp dst-port=27374 action=drop comment="SubSeven-2"

disabled=no

add chain=virus protocol=tcp dst-port=1243 action=drop comment="SubSeven-3"

disabled=no

add chain=virus protocol=tcp dst-port=1234 action=drop comment="SubSeven-4"

disabled=no

add chain=virus protocol=tcp dst-port=6711-6713 action=drop

comment="SubSeven-5" disabled=no

add chain=virus protocol=tcp dst-port=16959 action=drop comment="SubSeven-7"

disabled=no

add chain=virus protocol=tcp dst-port=25685-25686 action=drop

comment="-1" disabled=no

add chain=virus protocol=tcp dst-port=25982 action=drop

comment="-2" disabled=no

add chain=virus protocol=tcp dst-port=31337-31339 action=drop

comment="-3" disabled=no

add chain=virus protocol=tcp dst-port=8102 action=drop comment="Trojan"

disabled=no

add chain=virus protocol=tcp dst-port=8011 action=drop comment=""

disabled=no

add chain=virus protocol=tcp dst-port=7626 action=drop comment=""

disabled=no

add chain=virus protocol=tcp dst-port=19191 action=drop

comment="HoYian" disabled=no

add chain=virus protocol=tcp dst-port=23444-23445 action=drop

comment="" disabled=no

add chain=virus protocol=tcp dst-port=2583 action=drop

comment="-1" disabled=no

add chain=virus protocol=tcp dst-port=3024 action=drop

comment="-2" disabled=no

add chain=virus protocol=tcp dst-port=4092 action=drop

comment="-3" disabled=no

add chain=virus protocol=tcp dst-port=5714 action=drop

comment="-4" disabled=no

add chain=virus protocol=tcp dst-port=1010-1012 action=drop

comment="Doly1.0/1.35/1.5trojan-1" disabled=no

add chain=virus protocol=tcp dst-port=1015 action=drop

comment="Doly1.0/1.35/1.5trojan-2" disabled=no

add chain=virus protocol=tcp dst-port=2004-2005 action=drop

comment="-1" disabled=no

add chain=virus protocol=tcp dst-port=9878 action=drop

comment="-2" disabled=no

add chain=virus protocol=tcp dst-port=2773 action=drop

comment="..Trojan-1" disabled=no

add chain=virus protocol=tcp dst-port=7215 action=drop

comment="-2" disabled=no

add chain=virus protocol=tcp dst-port=54283 action=drop

comment="-3" disabled=no

add chain=virus protocol=tcp dst-port=1003 action=drop

comment="BackDoorTrojan-1" disabled=no

add chain=virus protocol=tcp dst-port=5598 action=drop

comment="BackDoorTrojan-2" disabled=no

add chain=virus protocol=tcp dst-port=5698 action=drop

comment="BackDoorTrojan-3" disabled=no

add chain=virus protocol=tcp dst-port=31554 action=drop

comment="SchainwindlerTrojan-2" disabled=no

add chain=virus protocol=tcp dst-port=18753 action=drop

comment="-1" disabled=no

add chain=virus protocol=tcp dst-port=20432 action=drop

comment="-2" disabled=no

add chain=virus protocol=tcp dst-port=65000 action=drop

comment="" disabled=no

add chain=virus protocol=tcp dst-port=11831 action=drop

comment="LatinusTrojan-1" disabled=no

add chain=virus protocol=tcp dst-port=29559 action=drop

comment="LatinusTrojan-2" disabled=no

add chain=virus protocol=tcp dst-port=1784 action=drop

comment="Snid.X2Trojan-1" disabled=no

add chain=virus protocol=tcp dst-port=3586 action=drop

comment="Snid.X2Trojan-2" disabled=no

add chain=virus protocol=tcp dst-port=7609 action=drop

comment="Snid.X2Trojan-3" disabled=no

add chain=virus protocol=tcp dst-port=12348-12349 action=drop

comment="BionetTrojan-1" disabled=no

add chain=virus protocol=tcp dst-port=12478 action=drop

comment="BionetTrojan-2" disabled=no

add chain=virus protocol=tcp dst-port=57922 action=drop

comment="BionetTrojan-3" disabled=no

add chain=virus protocol=tcp dst-port=3127 action=drop

comment=".a1." disabled=no

add chain=virus protocol=tcp dst-port=6777 action=drop

comment=".a." disabled=no

add chain=virus protocol=tcp dst-port=8866 action=drop

comment="e.b" disabled=no

add chain=virus protocol=tcp dst-port=2745 action=drop

comment="e.c-g/j-l" disabled=no

add chain=virus protocol=tcp dst-port=2556 action=drop

comment="e.p/q/r/n" disabled=no

add chain=virus protocol=tcp dst-port=20742 action=drop

comment="e.m-2" disabled=no

add chain=virus protocol=tcp dst-port=4751 action=drop

comment="e.s/t/u/v" disabled=no

add chain=virus protocol=tcp dst-port=2535 action=drop

comment="/ab/w/x-z-2" disabled=no

add chain=virus protocol=tcp dst-port=5238 action=drop

comment="loit" disabled=no

add chain=virus protocol=tcp dst-port=1068 action=drop comment=".a"

disabled=no

add chain=virus protocol=tcp dst-port=5554 action=drop

comment=".b/c/f" disabled=no

add chain=virus protocol=tcp dst-port=9996 action=drop

comment=".b/c/f" disabled=no

add chain=virus protocol=tcp dst-port=9995 action=drop comment=".d"

disabled=no

add chain=virus protocol=tcp dst-port=10168 action=drop

comment="e.a/b/c/d" disabled=no

add chain=virus protocol=tcp dst-port=20808 action=drop

comment="" disabled=no

add chain=virus protocol=tcp dst-port=1092 action=drop

comment="e.f/g" disabled=no

add chain=virus protocol=tcp dst-port=20168 action=drop

comment="e.f/g" disabled=no

add chain=virus protocol=tcp dst-port=1363-1364 action=drop

comment="ter" disabled=no

add chain=virus protocol=tcp dst-port=1368 action=drop comment=""

disabled=no

add chain=virus protocol=tcp dst-port=1373 action=drop comment="hromgrafx"

disabled=no

add chain=virus protocol=tcp dst-port=1377 action=drop comment="cichainlid"

disabled=no

add chain=virus protocol=tcp dst-port=3410 action=drop

comment="rotocol" disabled=no

add chain=virus protocol=tcp dst-port=8888 action=drop

comment="e.b" disabled=no

add chain=virus protocol=udp dst-port=44444 action=drop

comment="-7" disabled=no

add chain=virus protocol=udp dst-port=8998 action=drop

comment=".f-3" disabled=no

add chain=virus protocol=udp dst-port=123 action=drop comment=".f-1"

disabled=no

add chain=virus protocol=tcp dst-port=3198 action=drop

comment=".a2." disabled=no

add chain=virus protocol=tcp dst-port=139 action=drop comment="Drop Blaster

Worm" disabled=no

add chain=virus protocol=tcp dst-port=135 action=drop comment="Drop Blaster

Worm" disabled=no

add chain=virus protocol=tcp dst-port=445 action=drop comment="Drop Blaster

Worm" disabled=no

add chain=forward action=accept comment="接受所有数据" disabled=no

将这个脚本复制之后保存为 文件然后通过FTP://路由器IP地址

将文件拷贝到路由器FTP目录上

在终端操作下(Terminal)执行import命令导入防火墙规则:

[admin@NAT] > import

如果提示以下内容说明操作成功:

Opening script file

Script file loaded and executed successfully

注意添加对.exe和.dll文件内容的过滤,这两条规则默认为禁用,可以选择使用。

在防火墙规则链中增加了ICMP和virus两个链表,ICMP是对ICMP协议的数据做过滤(包括ping、traceroute等)。在virus中是对常见的病毒端口进行过滤,在foreward的链表中,增加了限制TCP连接数为80的规则

控制上班时间上网的方法

如下:

需要打开控制的时候把

“ALL”那项删除!

另外也可以添加 自己的私人通道!!

如VIP那项!!我自己的内部IP :192.168.1.184/32

这里的192.168.1.0/24 只是示例 请根据自己的网段设置,如果自己的是192.168.0.0网段就设置成192.168.0.0/24

上班的时候其他员工不能上网

总不能 让他们以为断线什么的吧!!

现在我们可以通过

D-nat的办法!把所有IP都解析到公司的网站或者内部WWW 或者OA 系统!!嘎嘎

好阴险哦

这样公司员工不管输入什么IP 或者地址都只能访问公司的网站或者OA 系统而已!!

现在我们开始编写脚本

其实照着抄就可以拉

不过你得懂得原理

就更好拉

到这个步骤就是

计划任务的事情了

应该能看得懂吧

WinBox-System-Scheduler-+

这个步骤只要稍微用心点就能看明白的,多做几次就熟悉了。

下面讲一下基于IPIP连接方式的虚拟双线教程

环境测试二台ROS2.96的路由。电信(单线)IP:219.159.78.68(以下就称为A机内网IP段192.168.88段) 网通(单线) IP:219.159.78.87(以下就称为B机内网IP段192.168.0段)

好了看我的说明:

A机设置:先在AB机之间建一个虚拟通道连接方式用IPIP。

[admin@219.159.78.68] interface ipip> add local-address=219.159.78.68

remote-address=219.159.78.87 disabled=no

[admin@219.159.78.68] ip address> add address=10.0.0.1/24 interface=ipip1 把10.0.0.1这个IP分

配给IPIP1这块虚拟网卡

B机设置:

[admin@219.159.78.87] interface ipip> add local-address=219.159.78.87

remote-address=219.159.78.68 disabled=no

[admin@219.159.78.87] ip address> add address=10.0.0.2/24 interface=ipip1 把10.0.0.2这个IP分配给IPIP1这块虚拟网卡

----------------------------------------------------------------------------------------------------------------------------------

通过这样设置就可以在A机的命令控制台里ping 通10.0.0.2(也就是B机的虚拟网卡的IP) 这个IP了。基本上AB机的虚拟通道就算建立起来了。

然后在A机的IP routes加规则 套用我上面发的那个路由表就可以了,导入IP规则,然后建立策略路由 MARK处别忘了选择CHINANET 网关处把虚拟网卡IP添上

本文标签: 输入地址设定网卡局域网