ROUTEOS使用笔记.docx
- 文档编号:8303105
- 上传时间:2023-01-30
- 格式:DOCX
- 页数:12
- 大小:23.01KB
ROUTEOS使用笔记.docx
《ROUTEOS使用笔记.docx》由会员分享,可在线阅读,更多相关《ROUTEOS使用笔记.docx(12页珍藏版)》请在冰豆网上搜索。
ROUTEOS使用笔记
ROUTEOS使用笔记
宽带和ADSL(PPPoE)不一样。
宽带:
单击IP,DHCP Clients,Enable,Add Default Route,Interface 选择ether2,hostname为Client1,OK。
再次打开DHCP Clients,查
看Status页看是否获取IP地址,如果获取了就完工了。
ADSL拨号设置如下:
在WINBOX中,点interfaces-->增加(+)-->pppoe clients-->dial out
在user框输入adsl拨号用户名,在password框输入密码,并对选项框打勾(保存ADSL密码)-->APPLY.
------------------------------------------------------------------------------------------
设置NAT共享上网ip--》firewall-sourcenat,选择+号,选择action,action里面选择masquerade
/ip firewall mangle add protocol tcp tcp-options syn-only tcp-mss 1448
------------------------------------------------------------------------
开DHCP
添加ippool地址池
再开ipdhcpserver设上网关和dns
---------------------------------------------------------------------------
用RouterOS封PP点点通和VPP
因为本网吧经常有人利用PP点点通和VPP下载黄色电影,不但影响不好,而且很占
网络资源,降底网速,其它玩游戏者老是叫卡.所以作了以下处理:
用WINBOX登录,在IP-->Firewall的forward处添加:
第一条规则:
General页中的Dst.address改为210.15.29.67/32
Action页中的Action改为drop或reject
第二条规则:
General页中的Dst.address改为210.15.29.68/32
Action页中的Action改为drop或reject
第三条规则:
Advanced页中的content改为pp365
Action页中的Action改为drop或reject
这样设置后,别人登录PP点点能或VPP时就会提示说网络不通.
不知道PP和VPP还有没有其它服务器,有的话请告诉我IP址.
装个天网防火墙,然后分别登录pp点点通和pp,登陆的时候防火墙会提示ip连接的,将ip记下来,然后写在防火墙的规则里面.
用CommView可以看连接的。
我就是用它来看QQ的连接。
并封掉了其IP。
QQGame也玩不了了
-------------------------------------------------------------------
ROUTEROS下限IP的TCP连接数(限线程),
来自每个IP地址最多允许有15个并发连接
/ipfirewallruleforwardaddprotocol=tcptcp-options=syn-onlyconnection-limit=15\
action=drop
專門限制一個IP的連接數
/ipfirewallruleforwardaddprotocol=tcptcp-options=syn-only
src-address=192.168.0.249/32connection-limit=15action=drop
--------------------------------------------------------------------------------------
如果有一些网页打不开,你ISP的MTU=1492,请在IP>Firewall>Mangle>单击红加号>Protocol选择TCP>TcpOptions选择sync>
Actions选择accept>TCPMSS:
1448。
------------------------------------------------------------------------------------------
ip-》firewall-》filterfules,选择+号,ininterface选择内网网卡(local),其他默认
这条路由允许来自内网的连接,如果有限制,可以修改srcaddress的ip段,或者content内容过滤
ip-》firewall-》filterchains选中input,选择drop
这条规则禁止所有的外部连接
以上两条规则,屏蔽来自外网的所有连接
一些恶意网站和广告,也可以从这里屏蔽
例如,可以加一条规则,禁止登陆新浪聊天室:
ip-》firewall-》filterfules,选择forward
选择+号,advanced里面content输上,action里面选择return,即可
如果换成,新浪主页的广告就没有了
防火墙设置需要较强的网络知识,可以参考有关资料,或者天网等防火墙里面的规则
---------------------------------------------------------------------------------------------------
如果内部有需要对外发布的服务,例如ftp、web等,可以在ip firewall 的destination nat中设置,添加是注
意:
dst.address 要用你对外的ip,选择相应的协议,端口号,另外acction中选择 nat ,天上内网对应主机
ip 、端口号。
--------------------------------------------------------------------------------------------------
全面解决ROUTEROSIP限速问题
比如我要限:
172.18.62.63的下载为:
上限100Kbit-下限256Kbit,上行为:
上限100Kbit-200Kbit下限,具体可以这样做:
1、下载带宽IP---SimpleQueues---"+"
Name=downSrcAddress=0.0.0.0/0DstAddress=192.168.0.8/32terface=eth1(内网网卡)limitat=100000Maxlimit=256000
2、上传带宽IP---Firewall---Mangle---"+"
SrcAddress=192.168.0.8/32InInterface=eth1(内网网卡)DstAddress=0.0.0.0/0Protocol=allAction=acceptFlowMark=UP
3.Queues---QueuesTree---"+"
Name=UPParent=eth2(外网网卡)Flow=UPlimit=100000MaxLimit=200000
你要限多少个IP,就写多少个。
我写了近:
300来个IP,上行下行没有问题。
我这里是250台这样的网络,才4M的带宽,随时保持60-100来户人同时在线。
ROUTEROS运行了4天4夜,PING值一般小于:
10MS,没有发现丢包现像
,速度用户反馈速度很快,不过我的防火墙设了一些规则,朋友们如果感兴趣,自己编些规则,与天网差不多,如果不熟TCP/IP的朋友,买一本回
来,不出1个月,你就精通了。
在Queues---QueuesTree里面还可以看在线用户当前速率。
方便无比。
你要限谁就限谁。
我这里有6万个IP,我只开放172.18.60.0-172.18.60.127;172.18.61.0-172.18.61.127;
172.18.62.0-172.18.62.63
所以限了近:
300来个IP。
还可以限一个网段如:
172.18.60.0/25
限制一个网段用PCQ
1.Markallpacketswithflowall:
用flowall标记所有数据包
/ipfirewallmangleaddaction=acceptmark-flow=all
2.CreatetwoPCQqueuetypes-onefordownloadandoneforupload.Fordownloadtraffic:
创建两条PCQ类型,下载和上传
queueswillbeclassifiedbydst-addressandforupload-bysrc-address:
/queuetypeaddname=PCQ-Downloadkind=pcqpcq-rate=65536\
pcq-classifier=dst-address
/queuetypeaddname=PCQ-Uploadkind=pcqpcq-rate=32768\
pcq-classifier=src-address
3.Addtwoqueuerules-onefordownloadandoneforupload:
添加PCQ规则,下载和上传/
queuetreeaddparent=Localqueue=PCQ-Downloadflow=all
/queuetreeaddparent=Publicqueue=PCQ-Uploadflow=all
-----------------------------------------------------------------------------------------------
关于解决不能上XX的问题
把TCP MSS 1448改成1432
----------------------------------------------------------------------------------------------------
这是官方的在线模拟
http:
//demo.mt.lv/
下载 MikroTik WinBox Console
我们做好的管理登陆界面也是这样的,
打开winbox
在Connect To填 demo.mt.lv
用户名Login填 demo
密码留空
然后点connect连接
---------------------------------------------------------------------------------------------------------------
RouterOS的端口映射很简单.
在终端中的ip/firewall/dst-nat里面
比如我要映射80端口到192.168.0.100,外网地址是218.26.x.x(假设)
输入addaction=natprotocol=tcpdst-address=218.26.x.x/32:
80to-dst-address=192.168.0.100
就ok了,需要注意的是做nat的时候,dst-address的子网掩码必须是32,也就是255.255.255.255,否则不行,很多朋友出问题就是出在这里.
----------------------------------------------------------------------------------------------------------
记录网卡MAC地址才能限制网卡上网。
具体设置如下。
在防火墙里面的filterrules项选择forward然后添加一项设定也就是“+”号,
在advanced项里面的src.mac.address项里面加入网卡的MAC地址,然后在ACTION中选择DROP项。
这样子添加后,那块网卡的ip地址无论咋换,都
无法上网。
除非它把网卡换了。
我就是这样子作出来得,效果不错。
-----------------------------------------------------------------------------------------
[admin@MikroTik]systembackup>save导出配置文件,就是备份
[admin@MikroTik]systembackup>load导入配置文件,就是恢复
-----------------------------------------------------------------------
如果改了端口用winbox打不开了的解决方法
用SSH进入
/ipser
/ipser/>setwwwport80
/ipser/>setftpport21
-------------------------------------------------------
官方防火墙设置如下:
/ipfirewall
setinputname="input"policy=acceptcomment=""
setforwardname="forward"policy=acceptcomment=""
setoutputname="output"policy=acceptcomment=""
addname="virus"policy=nonecomment=""
/ipfirewallruleforward
addconnection-state=invalidaction=dropcomment="Dropinvalid\
connections"disabled=no
addconnection-state=establishedaction=acceptcomment="Established\
connections"disabled=no
addconnection-state=relatedaction=acceptcomment="Relatedconnections"\
disabled=no
addaction=jumpjump-target=viruscomment="!
!
!
Checkforwell-known\
viruses!
!
!
"disabled=no
addprotocol=udpaction=acceptcomment="UDP"disabled=no
addprotocol=icmplimit-count=50limit-burst=2limit-time=5s\
action=acceptcomment="Allowlimitedpings"disabled=no
addprotocol=icmpaction=dropcomment="Dropexcesspings"disabled=no
/ipfirewallruleinput
addconnection-state=invalidaction=dropcomment="Dropinvalid\
connections"disabled=no
addtcp-options=non-syn-onlyconnection-state=establishedaction=accept\
comment="Acceptestablishedconnections"disabled=no
addconnection-state=relatedaction=acceptcomment="Acceptrelated\
connections"disabled=no
addaction=jumpjump-target=viruscomment="!
!
!
Checkforwell-known\
viruses!
!
!
"disabled=no
addprotocol=udpaction=acceptcomment="UDP"disabled=no
addprotocol=icmplimit-count=50limit-burst=2limit-time=5s\
action=acceptcomment="Allowlimitedpings"disabled=no
addprotocol=icmpaction=dropcomment="Dropexcesspings"disabled=no
adddst-address=:
22protocol=tcpaction=acceptcomment="SSHfordemo\
purposes"disabled=no
adddst-address=:
23protocol=tcpaction=acceptcomment="Telnetfordemo\
purposes"disabled=no
adddst-address=:
80protocol=tcpaction=acceptcomment="httpfordemo\
purposes"disabled=no
adddst-address=:
3987protocol=tcpaction=acceptcomment="winboxfor\
demopurposes"disabled=no
addsrc-address=159.148.172.192/28action=acceptcomment="From\
Mikrotiklsnetwork"disabled=no
addsrc-address=10.0.0.0/8action=acceptcomment="FromMikrotikls\
network"disabled=no
addaction=droplog=yescomment="Loganddropeverythingelse"\
disabled=no
/ipfirewallruleoutput
addprotocol=tcptcp-options=syn-onlyaction=droplog=yescomment=""\
disabled=no
/ipfirewallrulevirus
adddst-address=:
134-139protocol=tcpaction=dropcomment="DropBlaster\
Worm"disabled=no
adddst-address=:
134-139protocol=udpaction=dropcomment="Drop\
MessengerWorm"disabled=no
adddst-address=:
445protocol=tcpaction=dropcomment="DropBlaster\
Worm"disabled=no
adddst-address=:
445protocol=udpaction=dropcomment="DropBlaster\
Worm"disabled=no
adddst-address=:
593protocol=tcpaction=dropcomment="________"\
disabled=no
adddst-address=:
1024-1030protocol=tcpaction=dropcomment="________"\
disabled=no
adddst-address=:
1080protocol=tcpaction=dropcomment="DropMyDoom"\
disabled=no
adddst-address=:
1214protocol=tcpaction=dropcomment="________"\
disabled=no
adddst-address=:
1363protocol=tcpaction=dropcomment="ndmrequester"\
disabled=no
adddst-address=:
1364protocol=tcpaction=dropcomment="ndmserver"\
disabled=no
adddst-address=:
1368protocol=tcpaction=dropcomment="screencast"\
disabled=no
adddst-address=:
1373protocol=tcpaction=dropcomment="hromgrafx"\
disabled=no
adddst-address=:
1377protocol=tcpaction=dropcomment="cichlid"\
disabled=no
adddst-address=:
1433-1434protocol=tcpaction=dropcomment="Worm"\
disabled=no
adddst-address=:
2745protocol=tcpaction=dropcomment="BagleVirus"\
disabled=no
adddst-address=:
2283protocol=tcpaction=dropcomment="DropDumaru.Y"\
disabled=no
adddst-address=:
2535protocol=tcpaction=dropcomment="DropBeagle"\
disabled=no
adddst-address=:
2745protocol=tcpaction=dropcomment="DropBeagle.C-K"\
disabled=no
adddst-address=:
3127-3128protocol=tcpaction=dropcomment="Drop\
MyDoom"disabled=no
adddst-address=:
3410protocol=tcpaction=dropcomment="DropBackdoor\
Opti
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- ROUTEOS 使用 笔记