آموزش نصب و کانفیگ MikroTik
[CENTER][B][FONT=Arial][SIZE=4]MikroTik[/SIZE][/FONT][/B][/CENTER]
[SIZE=3][FONT=Tahoma]MikroTik[/FONT][FONT=Tahoma] یک سرور مبتنی بر [/FONT][FONT=Tahoma]kernel [/FONT][FONT=Tahoma]لینوکس است که بر روی یک [/FONT][FONT=Tahoma]pc [/FONT][FONT=Tahoma]معمولی قابل نصب و سرویس دهی به صورت کاملا پایدار می باشد.[/FONT][/SIZE]
[SIZE=3][FONT=Tahoma]MikroTik[/FONT][FONT=Tahoma] ویژگی های زیادی دارد که برخی از آنها را ذکر میکنیم. [/FONT][/SIZE]
[SIZE=3][FONT=Tahoma]یکی از ویژگی های [/FONT][FONT=Tahoma]MikroTik[/FONT][FONT=Tahoma] این است که اکثر سرویسهای آن مانند [/FONT][FONT=Tahoma]NAT , Bandwidth Manager , Filtering [/FONT][FONT=Tahoma]و ... بر روی [/FONT][FONT=Tahoma]Layer3 [/FONT][FONT=Tahoma]انجام می پذیرد و به همین دلیل نیازی به لایه های بالاتر ندارد که این خود مقدار قابل توجهی در بالا بردن کیفیت و [/FONT][FONT=Tahoma]performance [/FONT][FONT=Tahoma]سیستم تاثیر دارد. این امر به ما این امکان را می دهد که بر روی یک [/FONT][FONT=Tahoma]pc [/FONT][FONT=Tahoma]معمولی به عنوان مثال یک کامپیوتر [/FONT][FONT=Tahoma]Pentium 2 [/FONT][FONT=Tahoma]با [/FONT][FONT=Tahoma]64M[/FONT][FONT=Tahoma] فضای [/FONT][FONT=Tahoma]RAM[/FONT][FONT=Tahoma] مقدار زیادی پهنای باند را رد کرده و اعمالی مثل [/FONT][FONT=Tahoma]NAT[/FONT][FONT=Tahoma] و [/FONT][FONT=Tahoma]Filtering[/FONT][FONT=Tahoma] روی آنها انجام دهیم.[/FONT][/SIZE]
[SIZE=3][FONT=Tahoma]در واقع [/FONT][FONT=Tahoma]MikroTik [/FONT][FONT=Tahoma]از [/FONT][FONT=Tahoma]pc [/FONT][FONT=Tahoma]های ما یک [/FONT][FONT=Tahoma]router [/FONT][FONT=Tahoma]کارآمد می سازد و این امکان را به ما می دهد که به آسانی بر روی آن پورتهای مختلف را اضافه و کم کنیم.[/FONT][/SIZE]
[SIZE=3][FONT=Tahoma]یکی دیگر از ویژگی های [/FONT][FONT=Tahoma]MikroTik [/FONT][FONT=Tahoma]پایداری آن است. [/FONT][FONT=Tahoma]MikroTik[/FONT][FONT=Tahoma] همانند یک روتر قوی از سرعت بوت بالا و عملکرد خودکار بدون نیاز به هیچ گونه [/FONT][FONT=Tahoma]login[/FONT][FONT=Tahoma] یا استارت کردن هر نوع سرویس بر خوردار است. [/FONT][/SIZE]
[SIZE=3][FONT=Tahoma]علاوه بر دسترسی محلی می توان [/FONT][FONT=Tahoma]MikroTik[/FONT][FONT=Tahoma] را به وسیله [/FONT][FONT=Tahoma]Telnet[/FONT][FONT=Tahoma] و [/FONT][FONT=Tahoma]SSH[/FONT][FONT=Tahoma] و[/FONT][FONT=Tahoma] Web server[/FONT][FONT=Tahoma] داخلی آن و رابط ویندوزی ارائه شده به همراه[/FONT][FONT=Tahoma] MikroTik[/FONT][FONT=Tahoma] به نام [/FONT][FONT=Tahoma]Winbox[/FONT][FONT=Tahoma] تنظیم کرد.[/FONT][/SIZE]
[SIZE=3][FONT=Tahoma]دیگر قابلیت قابل توجه [/FONT][FONT=Tahoma]MikroTik[/FONT][FONT=Tahoma] سرعت نصب و سرعت تنظیمات آن است. [/FONT][FONT=Tahoma]MikroTik[/FONT][FONT=Tahoma] در عرض چند دقیقه نصب و براحتی تنظیم میشود و این قابلیت در آن وجود دارد که بتوان تنظیمات آن را [/FONT][FONT=Tahoma]Import[/FONT][FONT=Tahoma] و [/FONT][FONT=Tahoma]Export[/FONT][FONT=Tahoma] کرد.[/FONT][/SIZE]
[SIZE=3][FONT=Tahoma]دیگر نقطه قوت [/FONT][FONT=Tahoma]MikroTik[/FONT][FONT=Tahoma] به صرفه بودن آن نسبت به نمونه های مشابه سخت افزاری است. با خرید یک عدد [/FONT][FONT=Tahoma]RouterOs [/FONT][FONT=Tahoma]و یک سرور با قدرتی متناسب با کار ما میتوانیم کارایی گرانفیمت ترین سخت افزارهارا با چندین برابر هزینه کمتر داشته باشیم. البته بماند که ما اکثرا از ورژن های کرک شده استفاده کرده و آنچنان پهنای باندی نداریم که بیشتر از یک کامپیوتر [/FONT][FONT=Tahoma]P3 [/FONT][FONT=Tahoma]نیاز شود.[/FONT][/SIZE]
[SIZE=3][FONT=Tahoma]در ادامه بعد از توضیح و آموزش [/FONT][FONT=Tahoma]NAT, Filtering [/FONT][FONT=Tahoma]توسط [/FONT][FONT=Tahoma]MikroTik[/FONT][FONT=Tahoma] به یک مثال برای یادگیری بیشتر خواهیم پرداحت.[/FONT][/SIZE]
[B][FONT=Tahoma]NAT[/FONT][/B][B][FONT=Tahoma]:[/FONT][/B]
[SIZE=3][FONT=Tahoma]NAT[/FONT][FONT=Tahoma] یا [/FONT][FONT=Tahoma]Network Address Translation[/FONT][FONT=Tahoma] یک استاندارد در اینترنت است که به کامپیوتر های داحل یک شبکه این اجازه را می دهد که از یک رنج [/FONT][FONT=Tahoma]IP[/FONT][FONT=Tahoma] برای ارتباط داخلی و از یک رنج دیکر برای ارتباط خارجی استفاده کنند. به شبکه داحلی که از [/FONT][FONT=Tahoma]NAT [/FONT][FONT=Tahoma]استفاده می کند اصطلاحا [/FONT][FONT=Tahoma]Natted Network [/FONT][FONT=Tahoma]می گویند. برای ایجاد [/FONT][FONT=Tahoma]NAT[/FONT][FONT=Tahoma] باید در شبکه داخلی یک عدد [/FONT][FONT=Tahoma]NAT gateway [/FONT][FONT=Tahoma]داشته باشیم که ترجمه آدرسها در آن صورت گیرد.[/FONT][/SIZE]
[SIZE=3][B][FONT=Tahoma]در کل 2 نوع [/FONT][/B][B][FONT=Tahoma]NAT [/FONT][/B][B][FONT=Tahoma]وجود دارد[/FONT][/B][/SIZE]
[FONT=Symbol][SIZE=3]·[/SIZE] [/FONT][SIZE=3][FONT=Tahoma]SRCNAT[/FONT][FONT=Tahoma] یا [/FONT][FONT=Tahoma]Source Nat[/FONT][FONT=Tahoma] :[/FONT][/SIZE]
[SIZE=3][FONT=Tahoma]از این فرم [/FONT][FONT=Tahoma]Nat[/FONT][FONT=Tahoma] وقتی استفاده میکنیم که می خواهیم [/FONT][FONT=Tahoma]IP[/FONT][FONT=Tahoma] های [/FONT][FONT=Tahoma]Invalid[/FONT][FONT=Tahoma] یک شبکه داخلی یا [/FONT][FONT=Tahoma]Natted Network[/FONT][FONT=Tahoma] را به یک [/FONT][FONT=Tahoma]Valid IP[/FONT][FONT=Tahoma] ترجمه کنیم.در این حالت هر پکتی که به [/FONT][FONT=Tahoma]gateway[/FONT][FONT=Tahoma] برسد [/FONT][FONT=Tahoma]IP[/FONT][FONT=Tahoma] آن به یک [/FONT][FONT=Tahoma]Valid IP[/FONT][FONT=Tahoma] ترجمه گشته و بر روی اینترنت ارسال می شود. عکس این عمل برای پکت هایی که به پکت های قبلی [/FONT][FONT=Tahoma]Reply[/FONT][FONT=Tahoma] می شوند صادق است و عکس این عمل صورت میگیرد.[/FONT][/SIZE]
[FONT=Symbol][SIZE=3]·[/SIZE] [/FONT][SIZE=3][FONT=Tahoma]DSTNAT[/FONT][FONT=Tahoma] یا[/FONT][FONT=Tahoma]Destination Nat[/FONT][FONT=Tahoma] :[/FONT][/SIZE]
[SIZE=3][FONT=Tahoma]این فرم [/FONT][FONT=Tahoma]NAT[/FONT][FONT=Tahoma] را وقتی انجام می دهیم که بخواهیم یک شبکه [/FONT][FONT=Tahoma]private[/FONT][FONT=Tahoma] را برای شبکه[/FONT][FONT=Tahoma]public[/FONT][FONT=Tahoma] خود قابل دسترسی قرار دهیم. در این عمل [/FONT][FONT=Tahoma]Valid IP [/FONT][FONT=Tahoma]خود را به [/FONT][FONT=Tahoma]Invalid IP[/FONT][FONT=Tahoma] ترجمه میکنیم.[/FONT][/SIZE]
[SIZE=3][B][FONT=Tahoma]Redirect[/FONT][/B][B][FONT=Tahoma] و [/FONT][/B][B][FONT=Tahoma]Masquerade[/FONT][/B][/SIZE]
[SIZE=3][FONT=Tahoma]Redirect[/FONT][FONT=Tahoma] و [/FONT][FONT=Tahoma]Masquerade[/FONT][FONT=Tahoma] یک نوع خاص [/FONT][FONT=Tahoma]dstnat[/FONT][FONT=Tahoma] و [/FONT][FONT=Tahoma]srcnat[/FONT][FONT=Tahoma] است. [/FONT][FONT=Tahoma]Redirect[/FONT][FONT=Tahoma] یک نوع از [/FONT][FONT=Tahoma]dstnat[/FONT][FONT=Tahoma] است که نیازی به تعریف [/FONT][FONT=Tahoma]to-address[/FONT][FONT=Tahoma] ندارد و تنها شناساندن اینترفیس ورودی کافی است و [/FONT][FONT=Tahoma]Masquerade[/FONT][FONT=Tahoma] یک نوع [/FONT][FONT=Tahoma]srcnat[/FONT][FONT=Tahoma] است که نیازی به تعریف [/FONT][FONT=Tahoma]to-address[/FONT][FONT=Tahoma] ندارد و تنها معرفی یک اینترفیس خروجی کافی است. در این حالات دیگر فرقی ندارد که چه [/FONT][FONT=Tahoma]IP[/FONT][FONT=Tahoma] به اینترفیس ها متصل میگردد هر [/FONT][FONT=Tahoma]IP [/FONT][FONT=Tahoma]در رنج [/FONT][FONT=Tahoma]IP[/FONT][FONT=Tahoma] های [/FONT][FONT=Tahoma]add[/FONT][FONT=Tahoma] شده به اینترفیس عمل می کند. در [/FONT][FONT=Tahoma]Redirect[/FONT][FONT=Tahoma] فیلد [/FONT][FONT=Tahoma]to-port[/FONT][FONT=Tahoma] برای فرستادن کل ترافیک به یک پورت خاص است که بیشتر برای اعمالی نظیر [/FONT][FONT=Tahoma]web-proxy[/FONT][FONT=Tahoma] استفاده می شود.[/FONT][/SIZE]
[LEFT][B][I][FONT=Verdana]Property Description[/FONT][/I][/B]
[B][COLOR=black][FONT=Verdana]action[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] (accept | add-dst-to-address-list | add-src-to-address-list | dst-nat | jump | log | masquerade | netmap | passthrough | redirect | return | same | src-nat; default: [B]accept[/B]) - action to undertake if the packet matches the rule [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]accept[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] - accepts the packet. No action is taken, i.e. the packet is passed through and no more rules are applied to it [/FONT][/COLOR]
[FONT=Verdana][COLOR=black][B]add-dst-to-address-list[/B] - adds destination address of an IP packet to the address list specified by [B]address-list[/B] parameter [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]add-src-to-address-list[/B] - adds source address of an IP packet to the address list specified by [B]address-list[/B] parameter [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]dst-nat[/B] - replaces destination address of an IP packet to values specified by [B]to-addresses[/B] and [B]to-ports[/B] parameters [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]jump[/B] - jump to the chain specified by the value of the [B]jump-target[/B] parameter [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]log[/B] - each match with this action will add a message to the system log [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]masquerade[/B] - replaces source address of an IP packet to an automatically determined by the routing facility IP address [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]netmap[/B] - creates a static 1:1 mapping of one set of IP addresses to another one. Often used to distribute public IP addresses to hosts on private networks [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]passthrough[/B] - ignores this rule goes on to the next one [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]redirect[/B] - replaces destination address of an IP packet to one of the router's local addresses [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]return[/B] - passes control back to the chain from where the jump took place [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]same[/B] - gives a particular client the same source/destination IP address from supplied range for each connection. This is most frequently used for services that expect the same client address for multiple connections from the same client [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]src-nat[/B] - replaces source address of an IP packet to values specified by [B]to-addresses[/B] and [B]to-ports[/B] parameters [/COLOR][/FONT]
[B][COLOR=black][FONT=Verdana]address-list[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]name[/I]) - specifies the name of the address list to collect IP addresses from rules having [B]action=add-dst-to-address-list[/B] or [B]action=add-src-to-address-list[/B] actions. These address lists could be later used for packet matching [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]address-list-timeout[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]time[/I]; default: [B]00:00:00[/B]) - time interval after which the address will be removed from the address list specified by [B]address-list[/B] parameter. Used in conjunction with [B]add-dst-to-address-list[/B] or [B]add-src-to-address-list[/B] actions [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]00:00:00[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] - leave the address in the address list forever [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]chain[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] (dstnat | srcnat | [I]name[/I]) - specifies the chain to put a particular rule into. As the different traffic is passed through different chains, always be careful in choosing the right chain for a new rule. If the input does not match the name of an already defined chain, a new chain will be created [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]dstnat[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] - a rule placed in this chain is applied before routing. The rules that replace destination addresses of IP packets should be placed there [/FONT][/COLOR]
[FONT=Verdana][COLOR=black][B]srcnat[/B] - a rule placed in this chain is applied after routing. The rules that replace the source addresses of IP packets should be placed there [/COLOR][/FONT]
[B][COLOR=black][FONT=Verdana]comment[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]text[/I]) - a descriptive comment for the rule. A comment can be used to identify rules form scripts [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]connection-bytes[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]integer[/I]-[I]integer[/I]) - matches packets only if a given amount of bytes has been transfered through the particular connection [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]0[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] - means infinity, [I]exempli gratia[/I]: [B]connection-bytes=2000000-0[/B] means that the rule matches if more than 2MB has been transfered through the relevant connection [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]connection-limit[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]integer[/I],[I]netmask[/I]) - restrict connection limit per address or address block [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]connection-mark[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]name[/I]) - matches packets marked via mangle facility with particular connection mark [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]connection-type[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] (ftp | gre | h323 | irc | mms | pptp | quake3 | tftp) - matches packets from related connections based on information from their connection tracking helpers. A relevant connection helper must be enabled under [B]/ip firewall service-port[/B] [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]content[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]text[/I]) - the text packets should contain in order to match the rule [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]dst-address[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]IP address[/I]/[I]netmask[/I] | [I]IP address[/I]-[I]IP address[/I]) - specifies the address range an IP packet is destined to. Note that console converts entered [B]address/netmask[/B] value to a valid network address, i.e.:[B]1.1.1.1/24[/B] is converted to [B]1.1.1.0/24[/B] [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]dst-address-list[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]name[/I]) - matches destination address of a packet against user-defined address list [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]dst-address-type[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] (unicast | local | broadcast | multicast) - matches destination address type of the IP packet, one of the: [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]unicast[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] - IP addresses used for one point to another point transmission. There is only one sender and one receiver in this case [/FONT][/COLOR]
[FONT=Verdana][COLOR=black][B]local[/B] - matches addresses assigned to router's interfaces [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]broadcast[/B] - the IP packet is sent from one point to all other points in the IP subnetwork [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]multicast[/B] - this type of IP addressing is responsible for transmission from one or more points to a set of other points [/COLOR][/FONT]
[B][COLOR=black][FONT=Verdana]dst-limit[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]integer[/I]/[I]time[/I]{0,1},[I]integer[/I],dst-address | dst-port | src-address{+},[I]time[/I]{0,1}) - limits the packet per second (pps) rate on a per destination IP or per destination port base. As opposed to the [B]limit[/B] match, every destination IP address / destination port has it's own limit. The options are as follows (in order of appearance): [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]Count[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] - maximum average packet rate, measured in packets per second (pps), unless followed by [B]Time[/B] option [/FONT][/COLOR]
[FONT=Verdana][COLOR=black][B]Time[/B] - specifies the time interval over which the packet rate is measured [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]Burst[/B] - number of packets to match in a burst [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]Mode[/B] - the classifier(-s) for packet rate limiting [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]Expire[/B] - specifies interval after which recorded IP addresses / ports will be deleted [/COLOR][/FONT]
[B][COLOR=black][FONT=Verdana]dst-port[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]integer[/I]: 0..65535-[I]integer[/I]: 0..65535{*}) - destination port number or range [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]hotspot[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]multiple choice: [/I]from-client | auth | local-dst) - matches packets received from clients against various Hot-Spot. All values can be negated [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]from-client[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] - true, if a packet comes from HotSpot client[/FONT][/COLOR]
[FONT=Verdana][COLOR=black][B]auth[/B] - true, if a packet comes from authenticted client[/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]local-dst[/B] - true, if a packet has local destination IP address[/COLOR][/FONT]
[B][COLOR=black][FONT=Verdana]icmp-options[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]integer[/I]:[I]integer[/I]) - matches ICMP Type:Code fields [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]in-interface[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]name[/I]) - interface the packet has entered the router through [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]ipv4-options[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] (any | loose-source-routing | no-record-route | no-router-alert | no-source-routing | no-timestamp | none | record-route | router-alert | strict-source-routing | timestamp) - match ipv4 header options [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]any[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] - match packet with at least one of the ipv4 options [/FONT][/COLOR]
[FONT=Verdana][COLOR=black][B]loose-source-routing[/B] - match packets with loose source routing option. This option is used to route the internet datagram based on information supplied by the source [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]no-record-route[/B] - match packets with no record route option. This option is used to route the internet datagram based on information supplied by the source [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]no-router-alert[/B] - match packets with no router alter option [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]no-source-routing[/B] - match packets with no source routing option [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]no-timestamp[/B] - match packets with no timestamp option [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]record-route[/B] - match packets with record route option [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]router-alert[/B] - match packets with router alter option [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]strict-source-routing[/B] - match packets with strict source routing option [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]timestamp[/B] - match packets with timestamp [/COLOR][/FONT]
[B][COLOR=black][FONT=Verdana]jump-target[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] (dstnat | srcnat[I]name[/I]) - name of the target chain to jump to, if the [B]action=jump[/B] is used [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]limit[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]integer[/I]/[I]time[/I]{0,1},[I]integer[/I]) - restricts packet match rate to a given limit. Usefull to reduce the amount of log messages [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]Count[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] - maximum average packet rate, measured in packets per second (pps), unless followed by [B]Time[/B] option [/FONT][/COLOR]
[FONT=Verdana][COLOR=black][B]Time[/B] - specifies the time interval over which the packet rate is measured [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]Burst[/B] - number of packets to match in a burst [/COLOR][/FONT]
[B][COLOR=black][FONT=Verdana]log-prefix[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]text[/I]) - all messages written to logs will contain the prefix specified herein. Used in conjunction with [B]action=log[/B] [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]nth[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]integer[/I],[I]integer[/I]: 0..15,[I]integer[/I]{0,1}) - match a particular Nth packet received by the rule. One of 16 available counters can be used to count packets [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]Every[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] - match every [B]Every+1[/B]th packet. For example, if [B]Every=1[/B] then the rule matches every 2nd packet [/FONT][/COLOR]
[FONT=Verdana][COLOR=black][B]Counter[/B] - specifies which counter to use. A counter increments each time the rule containing [B]nth[/B] match matches [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]Packet[/B] - match on the given packet number. The value by obvious reasons must be between [B]0[/B] and [B]Every[/B]. If this option is used for a given counter, then there must be at least [B]Every+1[/B] rules with this option, covering all values between [B]0[/B] and [B]Every[/B] inclusively. [/COLOR][/FONT]
[B][COLOR=black][FONT=Verdana]out-interface[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]name[/I]) - interface the packet is leaving the router through [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]packet-mark[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]text[/I]) - matches packets marked via mangle facility with particular packet mark [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]packet-size[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]integer[/I]: 0..65535-[I]integer[/I]: 0..65535{0,1}) - matches packet of the specified size or size range in bytes [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]Min[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] - specifies lower boundary of the size range or a standalone value [/FONT][/COLOR]
[FONT=Verdana][COLOR=black][B]Max[/B] - specifies upper boundary of the size range [/COLOR][/FONT]
[B][COLOR=black][FONT=Verdana]phys-in-interface[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]name[/I]) - matches the bridge port physical input device added to a bridge device. It is only useful if the packet has arrived through the bridge [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]phys-out-interface[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]name[/I]) - matches the bridge port physical output device added to a bridge device. It is only useful if the packet will leave the router through the bridge [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]protocol[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] (ddp | egp | encap | ggp | gre | hmp | icmp | idrp-cmtp | igmp | ipencap | ipip | ipsec-ah | ipsec-esp | iso-tp4 | ospf | pup | rdp | rspf | st | tcp | udp | vmtp | xns-idp | xtp | [I]integer[/I]) - matches particular IP protocol specified by protocol name or number. You should specify this setting if you want to specify ports [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]psd[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]integer[/I],[I]time[/I],[I]integer[/I],[I]integer[/I]) - attempts to detect TCP and UDP scans. It is advised to assign lower weight to ports with high numbers to reduce the frequency of false positives, such as from passive mode FTP transfers [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]WeightThreshold[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] - total weight of the latest TCP/UDP packets with different destination ports coming from the same host to be treated as port scan sequence [/FONT][/COLOR]
[FONT=Verdana][COLOR=black][B]DelayThreshold[/B] - delay for the packets with different destination ports coming from the same host to be treated as possible port scan subsequence [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]LowPortWeight[/B] - weight of the packets with privileged (<=1024) destination port [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]HighPortWeight[/B] - weight of the packet with non-priviliged destination port [/COLOR][/FONT]
[B][COLOR=black][FONT=Verdana]random[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]integer[/I]) - match packets randomly with given propability [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]routing-mark[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]name[/I]) - matches packets marked by mangle facility with particular routing mark [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]same-not-by-dst[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] (yes | no) - specifies whether to account or not to account for destination IP address when selecting a new source IP address for packets matched by rules with [B]action=same[/B] [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]src-address[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]IP address[/I]/[I]netmask[/I] | [I]IP address[/I]-[I]IP address[/I]) - specifies the address range an IP packet is originated from. Note that console converts entered [B]address/netmask[/B] value to a valid network address, i.e.:[B]1.1.1.1/24[/B] is converted to [B]1.1.1.0/24[/B] [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]src-address-list[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]name[/I]) - matches source address of a packet against user-defined address list [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]src-address-type[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] (unicast | local | broadcast | multicast) - matches source address type of the IP packet, one of the: [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]unicast[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] - IP addresses used for one point to another point transmission. There is only one sender and one receiver in this case [/FONT][/COLOR]
[FONT=Verdana][COLOR=black][B]local[/B] - matches addresses assigned to router's interfaces [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]broadcast[/B] - the IP packet is sent from one point to all other points in the IP subnetwork [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]multicast[/B] - this type of IP addressing is responsible for transmission from one or more points to a set of other points [/COLOR][/FONT]
[B][COLOR=black][FONT=Verdana]src-mac-address[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]MAC address[/I]) - source MAC address [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]src-port[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]integer[/I]: 0..65535-[I]integer[/I]: 0..65535{*}) - source port number or range [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]tcp-mss[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]integer[/I]: 0..65535) - matches TCP MSS value of an IP packet [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]time[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]time[/I]-[I]time[/I],sat | fri | thu | wed | tue | mon | sun{+}) - allows to create filter based on the packets' arrival time and date or, for locally generated packets, departure time and date [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]to-addresses[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]IP address[/I]-[I]IP address[/I]{0,1}; default: [B]0.0.0.0[/B]) - address or address range to replace original address of an IP packet with [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]to-ports[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]integer[/I]: 0..65535-[I]integer[/I]: 0..65535{0,1}) - port or port range to replace original port of an IP packet with [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]tos[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] (max-reliability | max-throughput | min-cost | min-delay | normal) - specifies a match to the value of Type of Service (ToS) field of IP header [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]max-reliability[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] - maximize reliability (ToS=4) [/FONT][/COLOR]
[FONT=Verdana][COLOR=black][B]max-throughput[/B] - maximize throughput (ToS=8) [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]min-cost[/B] - minimize monetary cost (ToS=2) [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]min-delay[/B] - minimize delay (ToS=16) [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]normal[/B] - normal service (ToS=0) [/COLOR][/FONT][/LEFT]
[CENTER][/CENTER]
[B][FONT=Tahoma][SIZE=3]Filter[/SIZE][/FONT][/B]
[SIZE=3][FONT=Tahoma]Filter[/FONT][FONT=Tahoma] یک بخش از فایروال است.[/FONT][/SIZE]
[FONT=Tahoma][SIZE=3]فایروال چیست؟[/SIZE][/FONT]
[FONT=Tahoma][SIZE=3]فایروال در لغت به معنی دیواره آتش است اما در مفهوم مانند یک دیوار است که دور یک شهر کشیده شده و معابری مانند دروازه های شهر در آن وجود دارد که نگهبانانی در آنها وجود دارند که عبور و مرور را کنترل می نمایند.[/SIZE][/FONT]
[SIZE=3][FONT=Tahoma]در شبکه فایروال ها معمولا روی [/FONT][FONT=Tahoma]gateway[/FONT][FONT=Tahoma] نصب می شوند و تمامی عبور و مرور ها را کنترل می نمایند. که معمولا کار حفاظت اطلاعات داخلی را از هجوم های خارجی را بر عهده دارد.[/FONT][/SIZE]
[SIZE=3][FONT=Tahoma]فایروالها ممکن است استراتژی های مختلفی داشته باشند.که به نوع شبکه و نوع و [/FONT][FONT=Tahoma]level[/FONT][FONT=Tahoma] حفاظت بستگی دارد. [/FONT][/SIZE]
[SIZE=3][FONT=Tahoma]MikroTik[/FONT][FONT=Tahoma] دارای یک[/FONT][FONT=Tahoma]packet filter [/FONT][FONT=Tahoma]قوی است که ویژگی های آن در زیر آورده شده است.[/FONT][/SIZE]
[LIST][*][FONT=Verdana]stateful packet filtering [/FONT][*][FONT=Verdana]peer-to-peer protocols filtering [/FONT][*][FONT=Verdana]traffic classification by: [/FONT][LIST][*][FONT=Verdana]source MAC address [/FONT][*][FONT=Verdana]IP addresses (network or list) and address types (broadcast, local, multicast, unicast) [/FONT][*][FONT=Verdana]port or port range [/FONT][*][FONT=Verdana]IP protocols [/FONT][*][FONT=Verdana]protocol options (ICMP type and code fields, TCP flags, IP options and MSS) [/FONT][*][FONT=Verdana]interface the packet arrived from or left through [/FONT][*][FONT=Verdana]internal flow and connection marks [/FONT][*][FONT=Verdana]ToS (DSCP) byte [/FONT][*][FONT=Verdana]packet content [/FONT][*][FONT=Verdana]rate at which packets arrive and sequence numbers [/FONT][*][FONT=Verdana]packet size [/FONT][*][FONT=Verdana]packet arrival time [/FONT][*][FONT=Verdana]and much more! [/FONT][/LIST][/LIST]
[SIZE=3][B][FONT=Tahoma]قائده کلی [/FONT][/B][B][FONT=Tahoma]Filtering[/FONT][/B][/SIZE]
[SIZE=3][FONT=Tahoma]فایروال بر پایه رول های آن بنا شده است یعنی فایروال و روتر کاری را انجام می دهد که رول ها بگویند. هر رول از 2 قسمت تشکیل شده است قسمت اول مشخص می کند که کدام پکت با رول ما [/FONT][FONT=Tahoma]match[/FONT][FONT=Tahoma] میشود و قسمت دوم عملی که روی پکت باید انجام بگیرد را مشخص می کند.[/FONT][/SIZE]
[SIZE=3][FONT=Tahoma]رول ها بر اساس [/FONT][FONT=Tahoma]chain[/FONT][FONT=Tahoma] آنها برای مدیریت بهتر دسته بندی می شوند. هر رول 3 حالت به صورت پیش فرض میتواند داشته باشد. [/FONT][FONT=Tahoma]Input[/FONT][FONT=Tahoma] و [/FONT][FONT=Tahoma]forward[/FONT][FONT=Tahoma] و [/FONT][FONT=Tahoma]output[/FONT][FONT=Tahoma] که به معنی پکت هایی که به مقصد روتر می آیند و پکت هایی که از روتر رد می شوند و پکت هایی که از مبدا روتر خارج می شوند هستند. حالتهایی هم به صورت دستی می توان برای فایروال تعریف کرد.[/FONT][/SIZE]
[LEFT][B][I][FONT=Verdana]Property Description[/FONT][/I][/B]
[B][COLOR=black][FONT=Verdana]action[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] (accept | add-dst-to-address-list | add-src-to-address-list | drop | jump | log | passthrough | reject | return | tarpit; default: [B]accept[/B]) - action to undertake if the packet matches the rule [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]accept[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] - accept the packet. No action is taken, i.e. the packet is passed through and no more rules are applied to it [/FONT][/COLOR]
[FONT=Verdana][COLOR=black][B]add-dst-to-address-list[/B] - adds destination address of an IP packet to the address list specified by [B]address-list[/B] parameter [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]add-src-to-address-list[/B] - adds source address of an IP packet to the address list specified by [B]address-list[/B] parameter [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]drop[/B] - silently drop the packet (without sending the ICMP reject message) [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]jump[/B] - jump to the chain specified by the value of the [B]jump-target[/B] parameter [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]log[/B] - each match with this action will add a message to the system log [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]passthrough[/B] - ignores this rule and goes on to the next one [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]reject[/B] - reject the packet and send an ICMP reject message [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]return[/B] - passes control back to the chain from where the jump took place [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]tarpit[/B] - captures and holds incoming TCP connections (replies with SYN/ACK to the inbound TCP SYN packet) [/COLOR][/FONT]
[B][COLOR=black][FONT=Verdana]address-list[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]name[/I]) - specifies the name of the address list to collect IP addresses from rules having [B]action=add-dst-to-address-list[/B] or [B]action=add-src-to-address-list[/B] actions. These address lists could be later used for packet matching [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]address-list-timeout[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]time[/I]; default: [B]00:00:00[/B]) - time interval after which the address will be removed from the address list specified by [B]address-list[/B] parameter. Used in conjunction with [B]add-dst-to-address-list[/B] or [B]add-src-to-address-list[/B] actions [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]00:00:00[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] - leave the address in the address list forever [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]chain[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] (forward | input | output | [I]name[/I]) - specifies the chain to put a particular rule into. As the different traffic is passed through different chains, always be careful in choosing the right chain for a new rule. If the input does not match the name of an already defined chain, a new chain will be created [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]comment[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]text[/I]) - a descriptive comment for the rule. A comment can be used to identify rules form scripts [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]connection-bytes[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]integer[/I]-[I]integer[/I]) - matches packets only if a given amount of bytes has been transfered through the particular connection [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]0[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] - means infinity, [I]exempli gratia[/I]: [B]connection-bytes=2000000-0[/B] means that the rule matches if more than 2MB has been transfered through the relevant connection [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]connection-limit[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]integer[/I],[I]netmask[/I]) - restrict connection limit per address or address block [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]connection-mark[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]name[/I]) - matches packets marked via mangle facility with particular connection mark [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]connection-state[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] (estabilished | invalid | new | related) - interprets the connection tracking analysis data for a particular packet [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]estabilished[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] - a packet which belongs to an existing connection, [I]exempli gratia[/I] a reply packet or a packet which belongs to already replied connection [/FONT][/COLOR]
[FONT=Verdana][COLOR=black][B]invalid[/B] - a packet which could not be identified for some reason. This includes out of memory condition and ICMP errors which do not correspond to any known connection. It is generally advised to drop these packets [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]new[/B] - a packet which begins a new TCP connection [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]related[/B] - a packet which is related to, but not part of an existing connection, such as ICMP errors or a packet which begins FTP data connection (the later requires enabled FTP connection tracking helper under [B]/ip firewall service-port[/B]) [/COLOR][/FONT]
[B][COLOR=black][FONT=Verdana]connection-type[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] (ftp | gre | h323 | irc | mms | pptp | quake3 | tftp) - matches packets from related connections based on information from their connection tracking helpers. A relevant connection helper must be enabled under [B]/ip firewall service-port[/B] [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]content[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]text[/I]) - the text packets should contain in order to match the rule [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]dst-address[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]IP address[/I]/[I]netmask[/I] | [I]IP address[/I]-[I]IP address[/I]) - specifies the address range an IP packet is destined to. Note that console converts entered [B]address/netmask[/B] value to a valid network address, i.e.:[B]1.1.1.1/24[/B] is converted to [B]1.1.1.0/24[/B] [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]dst-address-list[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]name[/I]) - matches destination address of a packet against user-defined address list [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]dst-address-type[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] (unicast | local | broadcast | multicast) - matches destination address type of the IP packet, one of the: [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]unicast[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] - IP addresses used for one point to another point transmission. There is only one sender and one receiver in this case [/FONT][/COLOR]
[FONT=Verdana][COLOR=black][B]local[/B] - matches addresses assigned to router's interfaces [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]broadcast[/B] - the IP packet is sent from one point to all other points in the IP subnetwork [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]multicast[/B] - this type of IP addressing is responsible for transmission from one or more points to a set of other points [/COLOR][/FONT]
[B][COLOR=black][FONT=Verdana]dst-limit[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]integer[/I]/[I]time[/I]{0,1},[I]integer[/I],dst-address | dst-port | src-address{+},[I]time[/I]{0,1}) - limits the packet per second (pps) rate on a per destination IP or per destination port base. As opposed to the [B]limit[/B] match, every destination IP address / destination port has it's own limit. The options are as follows (in order of appearance): [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]Count[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] - maximum average packet rate, measured in packets per second (pps), unless followed by [B]Time[/B] option [/FONT][/COLOR]
[FONT=Verdana][COLOR=black][B]Time[/B] - specifies the time interval over which the packet rate is measured [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]Burst[/B] - number of packets to match in a burst [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]Mode[/B] - the classifier(-s) for packet rate limiting [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]Expire[/B] - specifies interval after which recorded IP addresses / ports will be deleted [/COLOR][/FONT]
[B][COLOR=black][FONT=Verdana]dst-port[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]integer[/I]: 0..65535-[I]integer[/I]: 0..65535{*}) - destination port number or range [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]hotspot[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]multiple choice: [/I]from-client | auth | local-dst | http) - matches packets received from clients against various Hot-Spot. All values can be negated [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]from-client[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] - true, if a packet comes from HotSpot client[/FONT][/COLOR]
[FONT=Verdana][COLOR=black][B]auth[/B] - true, if a packet comes from authenticted client[/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]local-dst[/B] - true, if a packet has local destination IP address[/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]hotspot[/B] - true, if it is a TCP packet from client and either the transparent proxy on port 80 is enabled or the client has a proxy address configured and this address is equal to the address:port pair of the IP packet[/COLOR][/FONT]
[B][COLOR=black][FONT=Verdana]icmp-options[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]integer[/I]:[I]integer[/I]) - matches ICMP Type:Code fields [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]in-interface[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]name[/I]) - interface the packet has entered the router through [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]ipv4-options[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] (any | loose-source-routing | no-record-route | no-router-alert | no-source-routing | no-timestamp | none | record-route | router-alert | strict-source-routing | timestamp) - match ipv4 header options [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]any[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] - match packet with at least one of the ipv4 options [/FONT][/COLOR]
[FONT=Verdana][COLOR=black][B]loose-source-routing[/B] - match packets with loose source routing option. This option is used to route the internet datagram based on information supplied by the source [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]no-record-route[/B] - match packets with no record route option. This option is used to route the internet datagram based on information supplied by the source [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]no-router-alert[/B] - match packets with no router alter option [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]no-source-routing[/B] - match packets with no source routing option [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]no-timestamp[/B] - match packets with no timestamp option [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]record-route[/B] - match packets with record route option [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]router-alert[/B] - match packets with router alter option [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]strict-source-routing[/B] - match packets with strict source routing option [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]timestamp[/B] - match packets with timestamp [/COLOR][/FONT]
[B][COLOR=black][FONT=Verdana]jump-target[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] (forward | input | output | [I]name[/I]) - name of the target chain to jump to, if the [B]action=jump[/B] is used [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]limit[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]integer[/I]/[I]time[/I]{0,1},[I]integer[/I]) - restricts packet match rate to a given limit. Usefull to reduce the amount of log messages [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]Count[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] - maximum average packet rate, measured in packets per second (pps), unless followed by [B]Time[/B] option [/FONT][/COLOR]
[FONT=Verdana][COLOR=black][B]Time[/B] - specifies the time interval over which the packet rate is measured [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]Burst[/B] - number of packets to match in a burst [/COLOR][/FONT]
[B][COLOR=black][FONT=Verdana]log-prefix[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]text[/I]) - all messages written to logs will contain the prefix specified herein. Used in conjunction with [B]action=log[/B] [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]nth[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]integer[/I],[I]integer[/I]: 0..15,[I]integer[/I]{0,1}) - match a particular Nth packet received by the rule. One of 16 available counters can be used to count packets [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]Every[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] - match every [B]Every+1[/B]th packet. For example, if [B]Every=1[/B] then the rule matches every 2nd packet [/FONT][/COLOR]
[FONT=Verdana][COLOR=black][B]Counter[/B] - specifies which counter to use. A counter increments each time the rule containing [B]nth[/B] match matches [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]Packet[/B] - match on the given packet number. The value by obvious reasons must be between [B]0[/B] and [B]Every[/B]. If this option is used for a given counter, then there must be at least [B]Every+1[/B] rules with this option, covering all values between [B]0[/B] and [B]Every[/B] inclusively. [/COLOR][/FONT]
[B][COLOR=black][FONT=Verdana]out-interface[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]name[/I]) - interface the packet will leave the router through [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]p2p[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] (all-p2p | bit-torrent | blubster | direct-connect | edonkey | fasttrack | gnutella | soulseek | warez | winmx) - matches packets from various peer-to-peer (P2P) protocols [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]packet-mark[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]text[/I]) - matches packets marked via mangle facility with particular packet mark [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]packet-size[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]integer[/I]: 0..65535-[I]integer[/I]: 0..65535{0,1}) - matches packet of the specified size or size range in bytes [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]Min[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] - specifies lower boundary of the size range or a standalone value [/FONT][/COLOR]
[FONT=Verdana][COLOR=black][B]Max[/B] - specifies upper boundary of the size range [/COLOR][/FONT]
[B][COLOR=black][FONT=Verdana]phys-in-interface[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]name[/I]) - matches the bridge port physical input device added to a bridge device. It is only useful if the packet has arrived through the bridge [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]phys-out-interface[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]name[/I]) - matches the bridge port physical output device added to a bridge device. It is only useful if the packet will leave the router through the bridge [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]protocol[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] (ddp | egp | encap | ggp | gre | hmp | icmp | idrp-cmtp | igmp | ipencap | ipip | ipsec-ah | ipsec-esp | iso-tp4 | ospf | pup | rdp | rspf | st | tcp | udp | vmtp | xns-idp | xtp | [I]integer[/I]) - matches particular IP protocol specified by protocol name or number. You should specify this setting if you want to specify ports [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]psd[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]integer[/I],[I]time[/I],[I]integer[/I],[I]integer[/I]) - attempts to detect TCP and UDP scans. It is advised to assign lower weight to ports with high numbers to reduce the frequency of false positives, such as from passive mode FTP transfers [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]WeightThreshold[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] - total weight of the latest TCP/UDP packets with different destination ports coming from the same host to be treated as port scan sequence [/FONT][/COLOR]
[FONT=Verdana][COLOR=black][B]DelayThreshold[/B] - delay for the packets with different destination ports coming from the same host to be treated as possible port scan subsequence [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]LowPortWeight[/B] - weight of the packets with privileged (<=1024) destination port [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]HighPortWeight[/B] - weight of the packet with non-priviliged destination port [/COLOR][/FONT]
[B][COLOR=black][FONT=Verdana]random[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]integer[/I]: 1..99) - matches packets randomly with given propability [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]reject-with[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] (icmp-admin-prohibited | icmp-echo-reply | icmp-host-prohibited | icmp-host-unreachable | icmp-net-prohibited | icmp-network-unreachable | icmp-port-unreachable | icmp-protocol-unreachable | tcp-reset | [I]integer[/I]) - alters the reply packet of [B]reject[/B] action [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]routing-mark[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]name[/I]) - matches packets marked by mangle facility with particular routing mark [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]src-address[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]IP address[/I]/[I]netmask[/I] | [I]IP address[/I]-[I]IP address[/I]) - specifies the address range an IP packet is originated from. Note that console converts entered [B]address/netmask[/B] value to a valid network address, i.e.:[B]1.1.1.1/24[/B] is converted to [B]1.1.1.0/24[/B] [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]src-address-list[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]name[/I]) - matches source address of a packet against user-defined address list [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]src-address-type[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] (unicast | local | broadcast | multicast) - matches source address type of the IP packet, one of the: [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]unicast[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] - IP addresses used for one point to another point transmission. There is only one sender and one receiver in this case [/FONT][/COLOR]
[FONT=Verdana][COLOR=black][B]local[/B] - matches addresses assigned to router's interfaces [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]broadcast[/B] - the IP packet is sent from one point to all other points in the IP subnetwork [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]multicast[/B] - this type of IP addressing is responsible for transmission from one or more points to a set of other points [/COLOR][/FONT]
[B][COLOR=black][FONT=Verdana]src-mac-address[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]MAC address[/I]) - source MAC address [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]src-port[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]integer[/I]: 0..65535-[I]integer[/I]: 0..65535{*}) - source port number or range [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]tcp-flags[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] (ack | cwr | ece | fin | psh | rst | syn | urg) - tcp flags to match [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]ack[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] - acknowledging data [/FONT][/COLOR]
[FONT=Verdana][COLOR=black][B]cwr[/B] - congestion window reduced [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]ece[/B] - ECN-echo flag (explicit congestion notification) [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]fin[/B] - close connection [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]psh[/B] - push function [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]rst[/B] - drop connection [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]syn[/B] - new connection [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]urg[/B] - urgent data [/COLOR][/FONT]
[B][COLOR=black][FONT=Verdana]tcp-mss[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]integer[/I]: 0..65535) - matches TCP MSS value of an IP packet [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]time[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] ([I]time[/I]-[I]time[/I],sat | fri | thu | wed | tue | mon | sun{+}) - allows to create filter based on the packets' arrival time and date or, for locally generated packets, departure time and date [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]tos[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] (max-reliability | max-throughput | min-cost | min-delay | normal) - specifies a match for the value of Type of Service (ToS) field of an IP header [/FONT][/COLOR]
[B][COLOR=black][FONT=Verdana]max-reliability[/FONT][/COLOR][/B][COLOR=black][FONT=Verdana] - maximize reliability (ToS=4) [/FONT][/COLOR]
[FONT=Verdana][COLOR=black][B]max-throughput[/B] - maximize throughput (ToS=8) [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]min-cost[/B] - minimize monetary cost (ToS=2) [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]min-delay[/B] - minimize delay (ToS=16) [/COLOR][/FONT]
[FONT=Verdana][COLOR=black][B]normal[/B] - normal service (ToS=0) [/COLOR][/FONT][/LEFT]
[CENTER][FONT=Arial][SIZE=4]نصب MikroTik[/SIZE][/FONT][/CENTER]
[SIZE=3][FONT=Tahoma]برای نصب [/FONT][FONT=Tahoma]MikroTik [/FONT][FONT=Tahoma]ابتدا باید [/FONT][FONT=Tahoma]minimum hardware requirment[/FONT][FONT=Tahoma] آن را بررسی کنیم که داخل سایت رسمی [/FONT][FONT=Tahoma]www.MikroTik.com[/FONT][FONT=Tahoma] نوشته شده است. اما به طور تجربی برای [/FONT][FONT=Tahoma]1Mbps[/FONT][FONT=Tahoma] پهنای باند و سرویسهایی مثل [/FONT][FONT=Tahoma]NAT , Filtering , Bandwidth manager , DNS[/FONT][FONT=Tahoma] حد افل یک کامپیوتر [/FONT][FONT=Tahoma]pentium 2[/FONT][FONT=Tahoma] به همراه [/FONT][FONT=Tahoma]64MB [/FONT][FONT=Tahoma]فضای [/FONT][FONT=Tahoma]RAM[/FONT][FONT=Tahoma] و یک هارد دیسک [/FONT][FONT=Tahoma]2.1GB[/FONT][FONT=Tahoma] یا کمتر و 2 عدد کارت شبکه کافی است.[/FONT][/SIZE]
[SIZE=3][FONT=Tahoma]برای نصب از روی [/FONT][FONT=Tahoma]CD[/FONT][FONT=Tahoma] باید ابتدا [/FONT][FONT=Tahoma]image[/FONT][FONT=Tahoma] آن را از لینکی که در آخر مقاله آمده دانلود کرده و بر روی [/FONT][FONT=Tahoma]CD[/FONT][FONT=Tahoma] به صورت [/FONT][FONT=Tahoma]image[/FONT][FONT=Tahoma] رایت کرده به صورتی که [/FONT][FONT=Tahoma]CD [/FONT][FONT=Tahoma]پس از [/FONT][FONT=Tahoma]write[/FONT][FONT=Tahoma] کردن [/FONT][FONT=Tahoma]bootable[/FONT][FONT=Tahoma] باشد.[/FONT][/SIZE]
[SIZE=3][FONT=Tahoma]CD[/FONT][FONT=Tahoma] را داخل [/FONT][FONT=Tahoma]cd-rom[/FONT][FONT=Tahoma] سیستمس که میخواهید [/FONT][FONT=Tahoma]MikroTik [/FONT][FONT=Tahoma]روی آن نصب کنید قرار دهید. و [/FONT][FONT=Tahoma]first boot device[/FONT][FONT=Tahoma] کامپیوتر خود را روی [/FONT][FONT=Tahoma]cd-rom[/FONT][FONT=Tahoma] قرار دهید. بعد از بوت شدن از روی [/FONT][FONT=Tahoma]CD[/FONT][FONT=Tahoma] یک صفحه باز خواهد شد که لیست [/FONT][FONT=Tahoma]service [/FONT][FONT=Tahoma]ها را نشان میدهد که می توان با [/FONT][FONT=Tahoma]spacebar[/FONT][FONT=Tahoma] آنها را انتخاب و یا از انتخاب خارح کرد. بعد از انتخاب [/FONT][FONT=Tahoma]package[/FONT][FONT=Tahoma] های مربوطه کلید [/FONT][FONT=Tahoma]"i"[/FONT][FONT=Tahoma] را فشار می دهیم. 2 عدد سوال از شما پرسیده می شود 1- سیستم به شما می گوید که با نصب [/FONT][FONT=Tahoma]MikroTik[/FONT][FONT=Tahoma] تمامی اطلاعات روی هارد دیسک شما پاک خواهد شد 2-از شما سوال می شود که اگر قبلا روی سیستم شما [/FONT][FONT=Tahoma]MikroTik[/FONT][FONT=Tahoma] نصب شده است آیا می خواهید تنظیمات قبلی نگهداری شوند؟ که اگر در دو حالت حرف [/FONT][FONT=Tahoma]"y"[/FONT][FONT=Tahoma] را وارد کرده و کلید [/FONT][FONT=Tahoma]ENTER[/FONT][FONT=Tahoma] را فشار دهیم سیستم شروع به نصب می کند.[/FONT][/SIZE]
[SIZE=3][FONT=Tahoma]بعد از کامل شدن نصب یک پیغام ظاهر می شود که نصب شما به پایان رسیده است و کلید[/FONT][FONT=Tahoma]ENTER[/FONT][FONT=Tahoma] را برای [/FONT][FONT=Tahoma]Reboot[/FONT][FONT=Tahoma] شدن سیستم خود فشار دهید.[/FONT][/SIZE]
[SIZE=3][FONT=Tahoma]سپس سیستم [/FONT][FONT=Tahoma]Reboot [/FONT][FONT=Tahoma]شده و روتر شما آماده استفاده است.[/FONT][/SIZE]
[SIZE=3][FONT=Tahoma]تنظیمات [/FONT][FONT=Tahoma]MikroTik[/FONT][/SIZE]
[SIZE=3][FONT=Tahoma]اختصاص [/FONT][FONT=Tahoma]IP address[/FONT][FONT=Tahoma] به کارت های شبکه:[/FONT][/SIZE]
[SIZE=3][FONT=Tahoma]ما یک [/FONT][FONT=Tahoma]LAN [/FONT][FONT=Tahoma]را در نظر می گیریم که از طریق [/FONT][FONT=Tahoma]MikroTik [/FONT][FONT=Tahoma]به یک روتر متصل و از همین طریق به اینترنت متصل است. فرض می کنیم که [/FONT][FONT=Tahoma]IP [/FONT][FONT=Tahoma]روتر ما [/FONT][FONT=Tahoma]217.219.100.1 255.255.255.128[/FONT][FONT=Tahoma] و [/FONT][FONT=Tahoma]IP[/FONT][FONT=Tahoma] شبکه داخلی ما [/FONT][FONT=Tahoma]172.16.0.0 255.255.255.0 [/FONT][FONT=Tahoma]بنابر این [/FONT][FONT=Tahoma]IP[/FONT][FONT=Tahoma] کارت شبکه خارجی ما [/FONT][FONT=Tahoma]217.219.100.2 255.255.255.128[/FONT][FONT=Tahoma] و [/FONT][FONT=Tahoma]IP[/FONT][FONT=Tahoma] کارت شبکه داخلی ما [/FONT][FONT=Tahoma]172.16.0.1 255.255.255.0[/FONT][FONT=Tahoma] و [/FONT][FONT=Tahoma]default gateway[/FONT][FONT=Tahoma] ما [/FONT][FONT=Tahoma]217.219.100.1[/FONT][FONT=Tahoma] می شود.[/FONT][/SIZE]
[SIZE=3][FONT=Tahoma]برای انجام دادن تنظیمات روتر ابتدا باید به آن [/FONT][FONT=Tahoma]login[/FONT][FONT=Tahoma] کنیم. [/FONT][FONT=Tahoma]Username[/FONT][FONT=Tahoma] و [/FONT][FONT=Tahoma]password[/FONT][FONT=Tahoma] روتر به صورت پیش فرض [/FONT][FONT=Tahoma]admin[/FONT][FONT=Tahoma] با پسورد [/FONT][FONT=Tahoma]blank[/FONT][FONT=Tahoma] (خالی) است. یوزر و پسورد را وارد می کنیم و وارد میشویم.[/FONT][/SIZE]
[SIZE=3][FONT=Tahoma]ابتدا باید [/FONT][FONT=Tahoma]IP[/FONT][FONT=Tahoma] ها را [/FONT][FONT=Tahoma]set[/FONT][FONT=Tahoma] کنیم. برای اینکار [/FONT][FONT=Tahoma]command [/FONT][FONT=Tahoma]های زیر را وارد می کنیم: [/FONT][/SIZE]
[LEFT][COLOR=#916c6a][FONT=Courier New][admin@MikroTik] ip address> add address=217.219.100.2/25 interface=ether0[/FONT][/COLOR]
[COLOR=#916c6a][FONT=Courier New][admin@MikroTik] ip address> add address=172.16.0.1/24 interface=ether1[/FONT][/COLOR]
[COLOR=#916c6a][FONT=Courier New][admin@MikroTik] ip address> print[/FONT][/COLOR]
[COLOR=#916c6a][FONT=Courier New]Flags: X - disabled, I - invalid, D - dynamic[/FONT][/COLOR]
[COLOR=#916c6a][FONT=Courier New]# ADDRESS NETWORK BROADCAST INTERFACE[/FONT][/COLOR]
[COLOR=#916c6a][FONT=Courier New]0 217.219.100.2/25 217.219.100.0 217.219.100.127 ether0[/FONT][/COLOR]
[COLOR=#916c6a][FONT=Courier New]1 172.16.0.1 172.16.0.0 172.16.0.255 ether1[/FONT][/COLOR]
[COLOR=#916c6a][FONT=Courier New][admin@MikroTik] ip address>[/FONT][/COLOR][/LEFT]
[SIZE=3][FONT=Tahoma]اکنون [/FONT][FONT=Tahoma]IP[/FONT][FONT=Tahoma] های ما [/FONT][FONT=Tahoma]add[/FONT][FONT=Tahoma] شده اند. برای اینکه یک [/FONT][FONT=Tahoma]default gateway[/FONT][FONT=Tahoma] برای روتر مشخص کنیم باید یک [/FONT][FONT=Tahoma]static route [/FONT][FONT=Tahoma]برای آن بنویسیم. برای این کار [/FONT][FONT=Tahoma]command [/FONT][FONT=Tahoma]های زیر را وارد می نمائیم:[/FONT][/SIZE]
[LEFT][COLOR=#916c6a][FONT=Courier New][admin@MikroTik] ip route> add gateway=217.219.100.1[/FONT][/COLOR]
[COLOR=#916c6a][FONT=Courier New][admin@MikroTik] ip route> print[/FONT][/COLOR]
[COLOR=#916c6a][FONT=Courier New]Flags: X - disabled, A - active, D - dynamic,[/FONT][/COLOR]
[COLOR=#916c6a][FONT=Courier New]C - connect, S - static, r - rip, b - bgp, o - ospf[/FONT][/COLOR]
[COLOR=#916c6a][FONT=Courier New]# DST-ADDRESS G GATEWAY DISTANCE INTERFACE[/FONT][/COLOR]
[COLOR=#916c6a][FONT=Courier New]1 ADC 217.219.100.0/25 ether0[/FONT][/COLOR]
[COLOR=#916c6a][FONT=Courier New]2 ADC 172.16.0.0/24 ether1[/FONT][/COLOR]
[COLOR=#916c6a][FONT=Courier New]3 A S 0.0.0.0/0 r 217.219.100.1 ether0[/FONT][/COLOR]
[COLOR=#916c6a][FONT=Courier New][admin@MikroTik] ip route>[/FONT][/COLOR][/LEFT]
[SIZE=3][FONT=Tahoma]اکنون روتر شما به اینترنت متصل است برای تست آن میتوانید یک [/FONT][FONT=Tahoma]IP[/FONT][FONT=Tahoma] داخل اینترنت را پینگ کنید به ترتیب زیر:[/FONT][/SIZE]
[LEFT][COLOR=#916c6a][FONT=Courier New][admin@MikroTik] > ping 4.2.2.1[/FONT][/COLOR]
[COLOR=#916c6a][FONT=Courier New]4.2.2.1 64 byte ping: ttl=237 time=256 ms[/FONT][/COLOR]
[COLOR=#916c6a][FONT=Courier New]4.2.2.1 64 byte ping: ttl=237 time=413 ms[/FONT][/COLOR]
[COLOR=#916c6a][FONT=Courier New]4.2.2.1 64 byte ping: ttl=237 time=311 ms[/FONT][/COLOR]
[COLOR=#916c6a][FONT=Courier New]4.2.2.1 64 byte ping: ttl=237 time=283 ms[/FONT][/COLOR]
[COLOR=#916c6a][FONT=Courier New]5 packets transmitted, 4 packets received, 20% packet loss[/FONT][/COLOR]
[COLOR=#916c6a][FONT=Courier New]round-trip min/avg/max = 256/315.7/413 ms[/FONT][/COLOR]
[COLOR=#916c6a][FONT=Courier New][admin@MikroTik] >[/FONT][/COLOR][/LEFT]
[SIZE=3][B][FONT=Tahoma]تنظیم [/FONT][/B][B][FONT=Tahoma]NAT[/FONT][/B][B][FONT=Tahoma] در روتر:[/FONT][/B][/SIZE]
[SIZE=3][FONT=Tahoma]در اینجا ما فقط می خواهیم آدرس های شبکه داخلی به یک آدرس خارجی و معتبر در اینترنت ترجمه شود. پس باید از [/FONT][FONT=Tahoma]srcnat[/FONT][FONT=Tahoma] استفاده کنیم. که هم می توان از [/FONT][FONT=Tahoma]masquerade[/FONT][FONT=Tahoma] استفاده کرد هم می توان از [/FONT][FONT=Tahoma]srcnat[/FONT][FONT=Tahoma] به همراه وارد کردن آدرس شبکه داخلی از طریق فیلد [/FONT][FONT=Tahoma]to-address[/FONT][FONT=Tahoma] استفاده کرد. ما اینجا هر دو روش را توضیح خواهیم داد.[/FONT][/SIZE]
[FONT=Tahoma][SIZE=3]Masquerade[/SIZE][/FONT]
[FONT=Tahoma][SIZE=3]در این حالت فقط کافی است اینترفیس خروجی را مشخص کنیم که به ترتیب زیر عمل می کنیم:[/SIZE][/FONT]
[LEFT][COLOR=#916c6a][FONT=Courier New]/ip firewall nat add chain=srcnat action=masquerade out-interface=ether0[/FONT][/COLOR][/LEFT]
[SIZE=3][FONT=Tahoma]به این ترتیب کلیه [/FONT][FONT=Tahoma]IP[/FONT][FONT=Tahoma] هایی که در شبکه ما هستند از هر اینترفیسی که باشند اگر روتر را [/FONT][FONT=Tahoma]default gateway[/FONT][FONT=Tahoma] خود قرار دهند به اینترنت متصل می گردند.[/FONT][/SIZE]
[SIZE=3][FONT=Tahoma]Srcnat[/FONT][/SIZE]
[SIZE=3][FONT=Tahoma]در این حالت ما یک یا چند [/FONT][FONT=Tahoma]IP[/FONT][FONT=Tahoma] خاص را به یک [/FONT][FONT=Tahoma]IP[/FONT][FONT=Tahoma] ولید [/FONT][FONT=Tahoma]NAT[/FONT][FONT=Tahoma] می کنیم. در این حالت امنیت و کنترل بیشتری روی شبکه خود داریم.[/FONT][/SIZE]
[LEFT][COLOR=#916c6a][FONT=Courier New]/ip firewall nat add chain=srcnat src-address=172.16.0.0/24 action=src-nat \[/FONT][/COLOR]
[COLOR=#916c6a][FONT=Courier New]to-addresses=217.219.100.2[/FONT][/COLOR][/LEFT]
[SIZE=3][FONT=Tahoma]در حالت فوق هر کامپیوتر با [/FONT][FONT=Tahoma]IP[/FONT][FONT=Tahoma] در رنج [/FONT][FONT=Tahoma]172.16.0.0 255.255.255.0[/FONT][FONT=Tahoma] و [/FONT][FONT=Tahoma]default gateway[/FONT][FONT=Tahoma]172.16.0.1[/FONT][FONT=Tahoma] می تواند از اینترنت استفاده کند. ما میتوانیم به جای یک رنج [/FONT][FONT=Tahoma]IP[/FONT][FONT=Tahoma] یک [/FONT][FONT=Tahoma]IP[/FONT][FONT=Tahoma] خاص یا یک رنج مخدود ت را انتخاب کنیم.[/FONT][/SIZE]
[SIZE=3][FONT=Tahoma]تنظیمات [/FONT][FONT=Tahoma]Filter[/FONT][/SIZE]
[SIZE=3][FONT=Tahoma]رول های [/FONT][FONT=Tahoma]Filter[/FONT][FONT=Tahoma] بسته به نیاز ما باید ساخته شوند . ما فعلا فرض میگیریم که می خواهیم ابتدا تنها به 3 کامپیوتر اجازه استفاده از اینترنت را بدهیم و برای همه پورت 135 را ببندیم و برای کلیه کامپیوتر ها [/FONT][FONT=Tahoma]ping[/FONT][FONT=Tahoma] بسته باشد و پورت [/FONT][FONT=Tahoma]telnet[/FONT][FONT=Tahoma] روتر برای همه بسته باشد. برای اعمال فوق الذکر به این ترتیب عمل می کنیم.[/FONT][/SIZE]
[SIZE=3][FONT=Tahoma]ما قصد بستن پورت 135 برای کلیه [/FONT][FONT=Tahoma]IP[/FONT][FONT=Tahoma] ها را داریم پس رول زیر را می نویسیم:[/FONT][/SIZE]
[COLOR=#916c6a]/ip firewall filter add chain=forward dst-port=135 protocol=tcp action=drop[/COLOR]
[SIZE=3][FONT=Tahoma]به این ترتیب تمام درخواستها به این پورت [/FONT][FONT=Tahoma]drop[/FONT][FONT=Tahoma] می شوند.[/FONT][/SIZE]
[SIZE=3][FONT=Tahoma]حال باید رولی را ایجاد کنیم که [/FONT][FONT=Tahoma]ping[/FONT][FONT=Tahoma] بسته شود این رول نیز مانند رول قبل است:[/FONT][/SIZE]
[COLOR=#916c6a]/ip firewall filter add chain=forward protocol=icmp action=drop[/COLOR]
[SIZE=3][FONT=Tahoma]و اما رول بعد بستن پورت [/FONT][FONT=Tahoma]telnet[/FONT][FONT=Tahoma] به روتر:[/FONT][/SIZE]
[SIZE=3][FONT=Tahoma]در این حالت باید [/FONT][FONT=Tahoma]chain[/FONT][FONT=Tahoma] را [/FONT][FONT=Tahoma]input[/FONT][FONT=Tahoma] قرار دهیم به معنی تمام پکت های ورودی به مقصد روتر.[/FONT][/SIZE]
[COLOR=#916c6a]/ip firewall filter add chain=input protocol=tcp dst-port=23 action=drop[/COLOR]
[SIZE=3][FONT=Tahoma]اکنون ما می خواهیم تنها 3 کامپیوتر به اینترنت دسترسی داشته باشند پس باید هر پکتی که قصد عبور از روتر را دارد و از این 3 کامپیوتر خاص صادر شده است اجازه عبور داده شده و بقیه پکت ها که قصد عبور از روتر را دارند [/FONT][FONT=Tahoma]drop [/FONT][FONT=Tahoma]شوند. پس اول باید رول های دسترسی سپس رول عدم دسترسی بقیه نوشته شود. در [/FONT][FONT=Tahoma]filtering[/FONT][FONT=Tahoma] ترتیب رول ها بسیار مهم است چون روتر به ترتیب از بالا به پائین رول ها را خوانده و عمل می کند.[/FONT][/SIZE]
[COLOR=#916c6a]/ip firewall filter add chain=forward src-address=172.16.0.2 action=accept[/COLOR][COLOR=#916c6a]/ip firewall filter add chain=forward src-address=172.16.0.3 action=accept[/COLOR][COLOR=#916c6a]/ip firewall filter add chain=forward src-address=172.16.0.4 action=accept[/COLOR][COLOR=#916c6a]/ip firewall filter add chain=forward src-address=172.16.0.0/16 action=drop[/COLOR]
[SIZE=3][FONT=Tahoma]ما با رول های بالا دسترسی سه [/FONT][FONT=Tahoma]IP[/FONT][FONT=Tahoma] را باز و دسترسی کلیه پکت های دیگر را محدود کرده ایم. [/FONT][/SIZE]
[SIZE=3][FONT=Tahoma]اکنون تنظیمات ما به پایان رسیده است. ما یه روتر داریم که میان شبکه داخلی و خارجی ما قرار دارد روی روتر ما یک [/FONT][FONT=Tahoma]IP[/FONT][FONT=Tahoma] ولید به یک رنج [/FONT][FONT=Tahoma]IP[/FONT][FONT=Tahoma] اینولید[/FONT][FONT=Tahoma] NAT[/FONT][FONT=Tahoma] شده است. ما روی روتر به وسیله [/FONT][FONT=Tahoma]packet filtering[/FONT][FONT=Tahoma] از شبکه داخلی خود و روتر حفاظت می کنیم. و این امکان را داریم که دسترسی کلاینت های را به اینترنت کنترل کنیم. [/FONT][/SIZE]
[FONT=Tahoma][SIZE=3]امیدوارم مطلب نوشته شده مفید واقع شود.[/SIZE][/FONT]
[SIZE=3][FONT=Tahoma]برای هر گونه سوال میتوانید با [/FONT][FONT=Tahoma][EMAIL="shahin@admins.ir"][U][COLOR=#0000ff]shahin@admins.ir[/COLOR][/U][/EMAIL] تماس خاصل فرموده یا همینجا سوال خود را مطرح نمائید.[/FONT][/SIZE]
[SIZE=4][URL="http://rapidshare.com/files/6932065/mikrotik-2.9.27-cracked.iso"]لینک دانلود میکروتیک[/URL][/SIZE]
[SIZE=4][URL="http://webgard3.parsaspace.com/files/download/mikrotik.iso"]لینک backup[/URL][/SIZE]