เชียงรายโฟกัสดอทคอม สังคมออนไลน์ของคนเชียงราย ยินดีต้อนรับคุณ, บุคคลทั่วไป กรุณา เข้าสู่ระบบ หรือ ลงทะเบียน
วันที่ 26 เมษายน 2024, 13:53:19
หน้าแรก ช่วยเหลือ เข้าสู่ระบบ สมัครสมาชิก



  • ข้อมูลหลักเว็บไซต์
  • เชียงรายวันนี้
  • ท่องเที่ยว-โพสรูป
  • ตลาดซื้อขายสินค้า
  • ธุรกิจบริการ
  • บอร์ดกลุ่มชมรม
  • อัพเดทกระทู้ล่าสุด
  • อื่นๆ

ประกาศ !! กรุณาอ่านเพื่อทำความเข้าใจ : https://forums.chiangraifocus.com/index.php?topic=1025412.0

+  เว็บบอร์ด เชียงรายโฟกัสดอทคอม สังคมออนไลน์ของคนเชียงราย
|-+  ศูนย์กลางข้อมูลเชียงราย
| |-+  คุยเรื่องไอที - เทคโนโลยี (ผู้ดูแล: K€nGja1, chiohoh, nuifish, NOtis)
| | |-+  แนะนำการใช้งาน Mikrotik RB450G ฟรีครับ limitbittorrent,hotspot,VPN,Section by ip
0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้
« หน้าที่แล้ว ต่อไป »
หน้า: [1] พิมพ์
ผู้เขียน แนะนำการใช้งาน Mikrotik RB450G ฟรีครับ limitbittorrent,hotspot,VPN,Section by ip  (อ่าน 12149 ครั้ง)
art20069
ชั้นประถม
*
ออฟไลน์ ออฟไลน์

กระทู้: 308


« เมื่อ: วันที่ 30 กรกฎาคม 2014, 14:10:14 »

สวัดดีครับเพื่อนชาวเชียงราย  วันนี้ขอแนะนำการใช้งานอุปกรณ์ firewall ตัวเล็กราคาถูกไว้ใช้งานในบ้านหรือหอพัก

ประโยชน์
1 ปรับปรุง Service ที่ใช้งานเองได้ตามความต้องการ
2 ไม่ต้องเสียเงินจ้างช่าง 3000 - 5000 บาท
3  การใช้งาน internet คุ้มค่าที่สุด ( โหลด bittorrent ตลอดเวลาพร้อมใช้งาน Web ปกติ )
4  ประโยชน์สำหรับเด็ก เล่น game ได้แบบไม่แล็ก
5  ดูกล้องวงจรปิดจากภายนอกได้ตามความเร็วที่กำหนดหรือแบ่งไว้ล่วงหน้า








ซึ่งตัวนี้ราคากลาง ๆ คุ้มสำหรับผู้ใช้งานแบบ 10 user  ถึง 50 user ซึ่งผมจะทยอยทำชุดสอนใช้งานจนถึงการ Qos ในระดับควบคุม Section ของการใช้งานของ user เพื่อที่จะควบคุมไปพร้อมกับทรัพยากรณ์ของตัวอุปกรณ์และกำหนด Service ต่างๆในระบบให้ทำงานตามความต้องการของตนเองครับ

ตัวอย่าง การเชื่อมต่อ internet 1 line
###########################
#### Internet  1  Line ####
###########################
# add ether1 for pppoe-out1 befor copy code to therminal
#|/ip address
/ip address add address=192.168.2.1/24 network=192.168.2.0 broadcast=192.168.2.255 interface=ether2 comment="default configuration"
#|/ip firewall mangle
/ip firewall mangle add chain=input in-interface=pppoe-out1 action=mark-connection new-connection-mark=ether1_conn
/ip firewall mangle add chain=output connection-mark=ether1_conn action=mark-routing new-routing-mark=to_ether1
#|/ip route
/ip route add dst-address=0.0.0.0/0 gateway=pppoe-out1 routing-mark=to_ether1 check-gateway=ping
/ip route add dst-address=0.0.0.0/0 gateway=pppoe-out1 distance=1 check-gateway=ping
#|/ip firewall nat
/ip firewall nat add chain=srcnat out-interface=pppoe-out1 action=masquerade
#| DHCP server is on switch, with address pool 192.168.2.10-192.168.2.200
/ip pool add name=default-dhcp ranges=192.168.2.10-192.168.2.200
/ip dhcp-server add name=default address-pool=default-dhcp interface=ether2 disabled=no
/ip dhcp-server network add address=192.168.2.0/24 gateway=192.168.2.1 dns-server=192.168.2.1 comment="default configuration"
#| DNS
/ip dns set allow-remote-requests=yes
/ip dns static add name=router address=192.168.2.1
/ip dns set allow-remote-requests=yes cache-max-ttl=1w cache-size=5000K max-udp-packet-size=512 servers=8.8.8.8,8.8.4.4

###########################
#### Port Service      ####
###########################
/ip service
set telnet address="" disabled=no port=23
set ftp address="" disabled=no port=21
set www address="" disabled=no port=83
set cctv address="" disabled=no port=82
set ssh address="" disabled=no port=22
set www-ssl address="" certificate=none disabled=no port=443
set api address="" disabled=no port=8728
set winbox address="" disabled=no port=8291

############################
#### Noip / Service MK  ####
############################
/system scheduler
add disabled=no interval=5m2s name=No-ip2 on-event=\
    "/system script run No-ip2\r\
    \n" policy=\
    ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api \
    start-date=jan/02/1970 start-time=00:10:20
add disabled=no interval=1d name=reboot on-event=reboot policy=reboot \
    start-date=jan/01/2002 start-time=03:45:00

/system script
add name=reboot policy=reboot source="/system reboot"
add name=No-ip2 policy=\
    ftp,reboot,read,write,policy,test,winbox,password,sensitive,api source="# \
    No-IP automatic Dynamic DNS update\r\
    \n\r\
    \n#--------------- Change Values in this section to match your setup -----\
    -------------\r\
    \n\r\
    \n# No-IP User account info\r\
    \n:local noipuser \"art20069@hotmail.com\"\r\
    \n:local noippass \"xxxxxxxx\"\r\
    \n\r\
    \n# Set the hostname or label of network to be updated.\r\
    \n# Hostnames with spaces are unsupported. Replace the value in the quotat\
    ions below with your host names.\r\
    \n# To specify multiple hosts, separate them with commas.\r\
    \n:local noiphost \"xxxxxxx.no-ip.biz\"\r\
    \n\r\
    \n# Change to the name of interface that gets the dynamic IP address\r\
    \n:local inetinterface \"pppoe-out1\"\r\
    \n\r\
    \n#-----------------------------------------------------------------------\
    -------------\r\
    \n# No more changes need\r\
    \n\r\
    \n:global previousIP\r\
    \n\r\
    \n:if ([/interface get \$inetinterface value-name=running]) do={\r\
    \n# Get the current IP on the interface\r\
    \n   :local currentIP [/ip address get [find interface=\"\$inetinterface\"\
    \_disabled=no] address]\r\
    \n\r\
    \n# Strip the net mask off the IP address\r\
    \n   :for i from=( [:len \$currentIP] - 1) to=0 do={\r\
    \n       :if ( [:pick \$currentIP \$i] = \"/\") do={ \r\
    \n           :set currentIP [:pick \$currentIP 0 \$i]\r\
    \n       } \r\
    \n   }\r\
    \n\r\
    \n   :if (\$currentIP != \$previousIP) do={\r\
    \n       :log info \"No-IP: Current IP \$currentIP is not equal to previou\
    s IP, update needed\"\r\
    \n       :set previousIP \$currentIP\r\
    \n\r\
    \n# The update URL. Note the \"\\3F\" is hex for question mark (\?). Requi\
    red since \? is a special character in commands.\r\
    \n       :local url \"http://dynupdate.no-ip.com/nic/update\\3Fmyip=\$curr\
    entIP\"\r\
    \n       :local noiphostarray\r\
    \n       :set noiphostarray [:toarray \$noiphost]\r\
    \n       :foreach host in=\$noiphostarray do={\r\
    \n           :log info \"No-IP: Sending update for \$host\"\r\
    \n           /tool fetch url=(\$url . \"&hostname=\$host\") user=\$noipuse\
    r password=\$noippass mode=http dst-path=(\"no-ip_ddns_update-\" . \$host \
    . \".txt\")\r\
    \n           :log info \"No-IP: Host \$host updated on No-IP with IP \$cur\
    rentIP\"\r\
    \n       }\r\
    \n   }  else={\r\
    \n       :log info \"No-IP: Previous IP \$previousIP is equal to current I\
    P, no update needed\"\r\
    \n   }\r\
    \n} else={\r\
    \n   :log info \"No-IP: \$inetinterface is not currently running, so there\
    fore will not update.\"\r\
    \n}"
##########################
## NAT Forward Port CCTV Port 99 ####
##########################
add action=dst-nat chain=dstnat disabled=no dst-address-type=local dst-port=\
    99 in-interface=pppoe-out1 protocol=tcp to-addresses=192.168.2.99 \
    to-ports=99
add action=dst-nat chain=dstnat disabled=no dst-port=99 in-interface=ether2 \
    protocol=tcp to-addresses=192.168.2.99 to-ports=99

##########################
##   NTP TIME Clint SET                ####
##########################
/system ntp client set enabled=yes mode=unicast primary-ntp=158.108.212.149 secondary-ntp=202.28.18.72
/system clock set time-zone-name=Asia/Bangkok

เดียวผมจะค่อยอธิบายการทำงานและการใช้งานในตัวอุปกรณ์ในการนำไปใช้งานร่วมถึงการกำหนดความเร็วในการ Download  bittorrent ไปพร้อม ๆ กับการใช้งาน Service ต่าง ๆ ให้ใช้งา้นในเวลาเดียวกันได้ โดยผลกระทบของการใช้ง้้าน Bittorrent น้อยที่สุดและการแยกเน็ตกับเกมส์ใน internet  1 Line  โดยการแบ่ง ท่อการใช้งานโดยกำหนดความเร็วของแต่ละท่อตาม internet line ที่ใช้รายเดือนให้เหมาะสมกับแต่ละบุคคลครับ วันนี้เริ่มประมาณนี้ก่อนนะครับ
« แก้ไขครั้งสุดท้าย: วันที่ 30 กรกฎาคม 2014, 14:16:47 โดย art20069 » IP : บันทึกการเข้า
art20069
ชั้นประถม
*
ออฟไลน์ ออฟไลน์

กระทู้: 308


« ตอบ #1 เมื่อ: วันที่ 31 กรกฎาคม 2014, 11:18:27 »

สวัดดีตอนเช้าครับ วันนี้เริ่มด้วยพื้นฐานการการทำงานของตัวอุปกรณ์ก่อนนะครับ

Mikrotik Router คืออะไร

คือ Router ที่ออกแบบมาให้ใช้งานได้สารพัดประโยชน์ทางด้าน network ครับ คนไทยเพิ่งจะรุ็จักได้ไม่กี่ปี มีราคาถุกและคุ้มค่าครับ สามารถเอามาแทน Router / Server แพงๆได้

function ที่นิยมกันคือ เอามาทำ Hotspot ทำหน้าจอ Login ทำระบบบัตรอินเทอร์เน็ต / VPN / รับ Radius นอก / Load Balance รวมเน็ต
ได้ใน ตัวเดียว!
Mikrotik แต่ละรหัส สามารถรองรับได้กี่ user ของจริง!(Peak)
Mikrotik 750 = ไม่เกิน 20 ถ้าใช้ userman (เหมาะกับโครงการ Hotspot SME)
Mikrotik 750GL = ไม่เกิน 20 ถ้าใช้ userman ถ้าไม่ใช้ได้ 30 (เหมาะกับโครงการ Hotspot SME)
Mikrotik 450 = ไม่เกิน 50 ถ้าใช้ userman ถ้าไม่ใช้ได้ 70 (เหมาะกับโครงการ Hotspot SME/หอพัก 50 ห้อง)
Mikrotik 1200 = ไม่เกิน 120 ทั้ง userman และไม่ใช้ (เหมาะกับโครงการ Hotspot ขนาดใหญ่ / หอพักอพาร์ทเม้น 100 ห้อง)
Mikrotik 1100AHx2 = ไม่เกิน 200 ทั้ง userman และไม่ใช้ (เหมาะกับโรงแรม คอนโด 200-300 ห้อง)

ควรเลือกให้เหมาะสมกับงานครับจะได้ไม่ต้องลงทุนบ่อย รุ่นที่นิยมคือ 450 ครับ เพราะเป็นรุ่นกลางๆ รองรับได้พอดี ถ้าทำ PPPoE Server ต้องลดไปประมาณ 10 user ครับ

1.  อันดับแรกเลย ให้ไป Download Tool ที่จะใช้ Setup อุปกรณ์ มันมีชื่อว่า WINBOX   ตาม LINK  ด้านล่าง ( แนะนำว่าพยายาม Download เปลี่ยน Version บ่อยๆ )



Winbox  http://www.mikrotik.com/download   หัวข้อ Useful tools and utilities นะครับ
       -   ส่วนวิธีการใช้งานเบื้องต้นของ winbox นั้นไม่ยากนะครับหาได้ทั่วไปผมขอข้ามขั้นตอนนี้ไปก่อนนะครับ
 
2. เรื่องวิธีการเชื่อมต่อ Internet แบบ Dhcp , statick , pppoe-out1  ผมจะเริ่มต้นในการจัดการผ่าน CODE นะครับซึ่งต้องทำผ่านโปรแกรม winbox นะครับ

2.1 แบบ Dhcp เป็น input และ output ผ่าน Mikrotik ไปก่อนนะครับ


« แก้ไขครั้งสุดท้าย: วันที่ 31 กรกฎาคม 2014, 13:56:02 โดย art20069 » IP : บันทึกการเข้า
mikeetc
ชั้นประถม
*
ออฟไลน์ ออฟไลน์

กระทู้: 283


MKfishing จำหน่ายอุปกรณ์ตกปลา ปลีกส่ง


« ตอบ #2 เมื่อ: วันที่ 05 สิงหาคม 2014, 16:56:55 »

จำกัด Upload และ Download ได้ ยิงฟันยิ้ม ยิ้มกว้างๆ
IP : บันทึกการเข้า
autchie
ระดับ ป.ตรี
***
ออฟไลน์ ออฟไลน์

กระทู้: 1,515



« ตอบ #3 เมื่อ: วันที่ 06 สิงหาคม 2014, 14:23:15 »

เจ๋งครับ ผมกำลังสนใจ ไอตัวนี้อยู่ครับ ทำ Hotspot ได้ จำกัด Bandwith ได้ และคุณสมบัติอีกเยอะแยะ จำหน่ายด้วยรึป่าวคับ ผมยังเซ็ตระบบไม่เป็นเลยครับ ถ้าเข้าใจระบบก็ไม่ยากอยู่แล้ว สำหรับผม  ยิงฟันยิ้ม ทำเป็นบทความเลยก็ดีครับ ผมติดตามตลอด ขอบคุณครับ  ยิ้มกว้างๆ
IP : บันทึกการเข้า
art20069
ชั้นประถม
*
ออฟไลน์ ออฟไลน์

กระทู้: 308


« ตอบ #4 เมื่อ: วันที่ 06 สิงหาคม 2014, 15:53:18 »

ครับเดียวผมจะทะยอยทำครับแต่ว่าจะย่อเกินก็กลัวมือใหม่ไม่เข้าใจนะครับ แต่พอนำไปใช้จะไปต่อไม่ได้นะครับ  ยินดีนะครับแบ่งปันกันครับผมไม่ได้ขายเป็นกิจหรอกครับแต่แนะนำได้ครับว่าซื้อจากแหล่งที่ถูกที่สุดที่คุณหาได้ทาง Internet นะครับแต่เรื่องเครื่องพังผมยังไม่เคยนะครับว่าที่ซ่อมไม่ได้นะครับอย่างมากโปรแกรมใน ROM เสียหายนะครับ flash ใหม่ก็ได้แล้วครับ อาการแบบเสียงดัง ปี๊ปเดียวประมาณนี้นะครับแล้วตัวกล่องไม่ทำงานต่อแล้วนะครับ  ก็แก้ไขได้ง่าย ๆ แต่มีขั้นตอนงานทำไม่ยากครับ  

ตัวอย่างการศึกษานะครับสำหรับร้านเกมซ์ หรือบ้านที่ต้องการให้ game มาเป็นอันดับที่ 1 รองการใช้งานทั่วไปนะครับ
internet speed 12M

In-INTERFACE = ether1
Out-Interface = wlan1

/ip firewall address-list
add address=192.168.1.0/24  disabled=no list=MikroTik comment=""

1. Marking all the connection out and in of the interface Mikrotik router, and create the connection packets that allow you to capture it to the queue tree rule as bandwidth totally. Look at the script below!

/ip firewall mangle
add action=mark-connection chain=prerouting dst-address=!MikroTik in-interface=ether1 new-connection-mark=All-Inconn disabled=no passthrough=yes comment="CONNECTION-IN"
add action=mark-packet chain=prerouting connection-mark=All-Inconn disabled=no new-packet-mark=All-inpkt passthrough=yes comment="UPSTEAM PACKETS"
add action=mark-connection chain=forward in-interface=wlan1 new-connection-mark=All-Outconn disabled=no passthrough=yes comment="CONNECTION-OUT"
add action=mark-packet chain=forward connection-mark=All-Outconn new-packet-mark=All-Outpkt disabled=no passthrough=yes comment="DOWNSTEAM-PACKETS"

/queue tree
add name=All-Bandwidth parent=global-out packet-mark=All-Outpkt queue=default priority=1 max-limit=12M

The connection that we will use is All-Outconn as the above scripts with the connection chain=forward out-interface=wlan1, which we subsequently differentiate into different connections to produce different connection packets.

2. Take the connections of All-Outconn then divide it into the connections to every client, and make connection packets every client that will captured by the queue tree per client.
Here are the following scripts :

/ip firewall mangle
add action=mark-connection chain=forward comment="Billing" disabled=no dst-address=192.168.1.11 new-connection-mark=Billing-conn passthrough=yes connection-mark=All-Outconn
add action=mark-connection chain=forward comment="Client1" disabled=no dst-address=192.168.1.17 new-connection-mark=Client1-conn passthrough=yes connection-mark=All-Outconn
add action=mark-connection chain=forward comment="Client2" disabled=no dst-address=192.168.1.16 new-connection-mark=Client2-conn passthrough=yes connection-mark=All-Outconn
add action=mark-connection chain=forward comment="Client3" disabled=no dst-address=192.168.1.15 new-connection-mark=Client3-conn passthrough=yes connection-mark=All-Outconn
add action=mark-connection chain=forward comment="Client4" disabled=no dst-address=192.168.1.14 new-connection-mark=Client4-conn passthrough=yes connection-mark=All-Outconn
add action=mark-connection chain=forward comment="Client5" disabled=no dst-address=192.168.1.20 new-connection-mark=Client5-conn passthrough=yes connection-mark=All-Outconn
add action=mark-connection chain=forward comment="Client6" disabled=no dst-address=192.168.1.21 new-connection-mark=Client6-conn passthrough=yes connection-mark=All-Outconn
add action=mark-connection chain=forward comment="Master" disabled=no dst-address=192.168.1.8 new-connection-mark=Master-conn passthrough=yes connection-mark=All-Outconn

/ip firewall mangle
add action=mark-packet chain=forward new-packet-mark=Billing-pkt passthrough=yes connection-mark=Billing-conn comment="BILLING DOWNSTEAM"
add action=mark-packet chain=forward new-packet-mark=Client1-pkt passthrough=yes connection-mark=Client1-conn comment="CLIENT1 DOWNSTEAM"
add action=mark-packet chain=forward new-packet-mark=Client2-pkt passthrough=yes connection-mark=Client2-conn comment="CLIENT2 DOWNSTEAM"
add action=mark-packet chain=forward new-packet-mark=Client3-pkt passthrough=yes connection-mark=Client3-conn comment="CLIENT3 DOWNSTEAM"
add action=mark-packet chain=forward new-packet-mark=Client4-pkt passthrough=yes connection-mark=Client4-conn comment="CLIENT4 DOWNSTEAM"
add action=mark-packet chain=forward new-packet-mark=Client5-pkt passthrough=yes connection-mark=Client5-conn comment="CLIENT5 DOWNSTEAM"
add action=mark-packet chain=forward new-packet-mark=Client6-pkt passthrough=yes connection-mark=Client6-conn comment="CLIENT6 DOWNSTEAM"
add action=mark-packet chain=forward new-packet-mark=Master-pkt passthrough=yes connection-mark=Master-conn comment="MASTER DOWNSTEAM"
« แก้ไขครั้งสุดท้าย: วันที่ 06 สิงหาคม 2014, 16:02:27 โดย art20069 » IP : บันทึกการเข้า
art20069
ชั้นประถม
*
ออฟไลน์ ออฟไลน์

กระทู้: 308


« ตอบ #5 เมื่อ: วันที่ 06 สิงหาคม 2014, 16:02:55 »

/queue tree
add name=Billing parent=All-Bandwidth packet-mark=Billing-pkt queue=default priority=8 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
add name=Client1 parent=All-Bandwidth packet-mark=Client1-pkt queue=default priority=8 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
add name=Client2 parent=All-Bandwidth packet-mark=Client2-pkt queue=default priority=8 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
add name=Client3 parent=All-Bandwidth packet-mark=Client3-pkt queue=default priority=8 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
add name=Client4 parent=All-Bandwidth packet-mark=Client4-pkt queue=default priority=8 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
add name=Client5 parent=All-Bandwidth packet-mark=Client5-pkt queue=default priority=8 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
add name=Client6 parent=All-Bandwidth packet-mark=Client6-pkt queue=default priority=8 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
add name=Master parent=All-Bandwidth packet-mark=Master-pkt queue=default priority=8 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s

The scripts above consists with mangle and queue tree rule. From here we are already making the connections per ip address of clients, such as
Connections Per Client : Billing-conn, Client1-conn, Client2-conn, Client3-conn, Client4-conn, Client5-conn, Client6-conn, Master-conn
Connection Packets Per Client : Billing-pkt, Client1-pkt, Client1-pkt, Client2-pkt, Client3-pkt, Client4-pkt, Client5-pkt, Client6-pkt, Master-pkt

3. The Connections per client that we have divided will separated into four packets connection such as browsing, online GAMES, download, streaming video per client. Here are the forth part of four different packets connection. If there are any packets that have not been defined I asked for suggestions from those of you that had EXPERIENCE.

Part I : Making the packets per client for download and the queue tree with priority as you wish, here the following scripts:

/ip firewall layer7-protocol
add comment="" name=download regexp="^.*get.+\\.(exe|rar|iso|zip|7zip|flv|mkv|avi|mp4|3gp|rmvb|mp3|img|dat|mov).*\$"

/ip firewall mangle
add chain=forward layer7-protocol=download action=mark-packet new-packet-mark=billing-dpkt passthrough=no packet-mark=Billing-pkt comment=Billing-Down
add chain=forward layer7-protocol=download action=mark-packet new-packet-mark=client1-dpkt passthrough=no packet-mark=Client1-pkt comment=Client1-Down
add chain=forward layer7-protocol=download action=mark-packet new-packet-mark=client2-dpkt passthrough=no packet-mark=Client2-pkt comment=Client2-Down
add chain=forward layer7-protocol=download action=mark-packet new-packet-mark=client3-dpkt passthrough=no packet-mark=Client3-pkt comment=Client3-Down
add chain=forward layer7-protocol=download action=mark-packet new-packet-mark=client4-dpkt passthrough=no packet-mark=Client4-pkt comment=Client4-Down
add chain=forward layer7-protocol=download action=mark-packet new-packet-mark=client5-dpkt passthrough=no packet-mark=Client5-pkt comment=Client5-Down
add chain=forward layer7-protocol=download action=mark-packet new-packet-mark=client6-dpkt passthrough=no packet-mark=Client6-pkt comment=Client6-Down
add chain=forward layer7-protocol=download action=mark-packet new-packet-mark=master-dpkt passthrough=no packet-mark=Master-pkt comment=Master-Down
 
/queue tree
add name=Billing-Down parent=Billing packet-mark=billing-dpkt queue=default priority=6 limit-at=180k max-limit=180k burst-limit=256k burst-threshold=135k burst-time=2s
add name=Client1-Down parent=Client1 packet-mark=client1-dpkt queue=default priority=6 limit-at=180k max-limit=180k burst-limit=256k burst-threshold=135k burst-time=2s
add name=Client2-Down parent=Client2 packet-mark=client2-dpkt queue=default priority=6 limit-at=180k max-limit=180k burst-limit=256k burst-threshold=135k burst-time=2s
add name=Client3-Down parent=Client3 packet-mark=client3-dpkt queue=default priority=6 limit-at=180k max-limit=180k burst-limit=256k burst-threshold=135k burst-time=2s
add name=Client4-Down parent=Client4 packet-mark=client4-dpkt queue=default priority=6 limit-at=180k max-limit=180k burst-limit=256k burst-threshold=135k burst-time=2s
add name=Client5-Down parent=Client5 packet-mark=client5-dpkt queue=default priority=6 limit-at=180k max-limit=180k burst-limit=256k burst-threshold=135k burst-time=2s
add name=Client6-Down parent=Client6 packet-mark=client6-dpkt queue=default priority=6 limit-at=180k max-limit=180k burst-limit=256k burst-threshold=135k burst-time=2s
add name=Master-Down parent=Master packet-mark=master-dpkt queue=default priority=6 limit-at=180k max-limit=180k burst-limit=256k burst-threshold=135k burst-time=2s

Here we take and use the connections per client and differentiate into connection packets of downloaded by the extension files, so if there are any the extension files that you think is important, just add the the extension files that you want to the layer 7 protocols from the above scripts.

Part II. Making the video packet connection per client complete with the queue tree and priority as you please. Here the following scripts

/ip firewall layer7-protocol
add comment="" name=streaming regexp="^.*get.+\\.(c.youtube.com|cdn.dailymotion.com|metacafe.com|mccont.com).*\$"

If the above script doesn't works, try the second regexp on the script below!

/ip firewall layer7-protocol
add comment="" name=streaming regexp="videoplayback|video"

/ip firewall mangle
add comment=Billing-Streams chain=forward layer7-protocol=streaming action=mark-packet new-packet-mark=billing-spkt passthrough=no packet-mark=Billing-pkt
add comment=Client1-Streams chain=forward layer7-protocol=streaming action=mark-packet new-packet-mark=client1-spkt passthrough=no packet-mark=Client1-pkt
add comment=Client2-Streams chain=forward layer7-protocol=streaming action=mark-packet new-packet-mark=client2-spkt passthrough=no packet-mark=Client2-pkt
add comment=Client3-Streams chain=forward layer7-protocol=streaming action=mark-packet new-packet-mark=client3-spkt passthrough=no packet-mark=Client3-pkt
add comment=Client4-Streams chain=forward layer7-protocol=streaming action=mark-packet new-packet-mark=client4-spkt passthrough=no packet-mark=Client4-pkt
add comment=Client5-Streams chain=forward layer7-protocol=streaming action=mark-packet new-packet-mark=client5-spkt passthrough=no packet-mark=Client5-pkt
add comment=Client6-Streams chain=forward layer7-protocol=streaming action=mark-packet new-packet-mark=client6-spkt passthrough=no packet-mark=Client6-pkt
add comment=Master-Streams chain=forward layer7-protocol=streaming action=mark-packet new-packet-mark=master-spkt passthrough=no packet-mark=Master-pkt
 
/queue tree
add name=Billing-Streams parent=Billing packet-mark=billing-spkt queue=default priority=8 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
add name=Client1-Streams parent=Client1 packet-mark=client1-spkt queue=default priority=8 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
add name=Client2-Streams parent=Client2 packet-mark=client2-spkt queue=default priority=8 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
add name=Client3-Streams parent=Client3 packet-mark=client3-spkt queue=default priority=8 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
add name=Client4-Streams parent=Client4 packet-mark=client4-spkt queue=default priority=8 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
add name=Client5-Streams parent=Client5 packet-mark=client5-spkt queue=default priority=8 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
add name=Client6-Streams parent=Client6 packet-mark=client6-spkt queue=default priority=8 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
add name=Master-Streams parent=Master packet-mark=master-spkt queue=default priority=8 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s

This is the similar method in making the connection packets like download packets is by using a layer 7 protocols, the content of streaming video other sites that have not been defined, please you add on the layer 7 protocols if you think that is important, and adjust the priority and limit speed on the queue tree as you please.

c. Membuat packets Online game per client lengkap dengan queue treenya, berikut ini adalah scriptsnya :

Part III : Making the Online games packet connection per client complete with the queue tree and priority, here the following scripts:

/ip firewall mangle
add action=mark-packet chain=forward packet-mark=All-Outpkt new-packet-mark=gpkt passthrough=yes protocol=tcp dst-port=5340-5352,6000-6152,10001-10011,14009-14030,18901-18909 comment="Online Game Portal"
add action=mark-packet chain=forward packet-mark=All-Outpkt new-packet-mark=gpkt passthrough=yes protocol=tcp dst-port=39190,27780,29000,22100,10009,4300,15001,15002,7341,7451
add action=mark-packet chain=forward packet-mark=All-Outpkt new-packet-mark=gpkt passthrough=yes protocol=tcp dst-port=40000,9300,9400,9700,7342,8005-8010,37466,36567,8822
add action=mark-packet chain=forward packet-mark=All-Outpkt new-packet-mark=gpkt passthrough=yes protocol=tcp dst-port=47611,16666,20000,5105,29000,18901-18909,9015
add action=mark-packet chain=forward packet-mark=All-Outpkt new-packet-mark=gpkt passthrough=yes protocol=udp dst-port=27005,27015
add action=mark-packet chain=forward packet-mark=All-Outpkt new-packet-mark=gpkt passthrough=yes protocol=udp dst-port=27005-27020,13055,7800-7900,12060-12070
add action=mark-packet chain=forward packet-mark=All-Outpkt new-packet-mark=gpkt passthrough=yes protocol=udp dst-port=8005-8010,9068,1293,1479,9401,9600,30000
add action=mark-packet chain=forward packet-mark=All-Outpkt new-packet-mark=gpkt passthrough=yes protocol=udp dst-port=14009-14030,42051-42052,40000-40050,13000-13080

/ip firewall mangle
add action=mark-packet chain=forward new-packet-mark=billing-gpkt passthrough=no dst-address=192.168.1.11 packet-mark=gpkt comment=Billing-Game
add action=mark-packet chain=forward new-packet-mark=client1-gpkt passthrough=no dst-address=192.168.1.17 packet-mark=gpkt comment=Client1-Game
add action=mark-packet chain=forward new-packet-mark=client2-gpkt passthrough=no dst-address=192.168.1.16 packet-mark=gpkt comment=Client2-Game
add action=mark-packet chain=forward new-packet-mark=client3-gpkt passthrough=no dst-address=192.168.1.15 packet-mark=gpkt comment=Client3-Game
add action=mark-packet chain=forward new-packet-mark=client4-gpkt passthrough=no dst-address=192.168.1.14 packet-mark=gpkt comment=Client4-Game
add action=mark-packet chain=forward new-packet-mark=client5-gpkt passthrough=no dst-address=192.168.1.20 packet-mark=gpkt comment=Client5-Game
add action=mark-packet chain=forward new-packet-mark=client6-gpkt passthrough=no dst-address=192.168.1.21 packet-mark=gpkt comment=Client6-Game
add action=mark-packet chain=forward new-packet-mark=master-gpkt passthrough=no dst-address=192.168.1.8 packet-mark=gpkt comment=Master-Game

/queue tree
add name=Billing-Game parent=Billing packet-mark=billing-gpkt queue=default priority=1 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
add name=Client1-Game parent=Client1 packet-mark=client1-gpkt queue=default priority=1 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
add name=Client2-Game parent=Client2 packet-mark=client2-gpkt queue=default priority=1 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
add name=Client3-Game parent=Client3 packet-mark=client3-gpkt queue=default priority=1 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
add name=Client4-Game parent=Client4 packet-mark=client4-gpkt queue=default priority=1 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
add name=Client5-Game parent=Client5 packet-mark=client5-gpkt queue=default priority=1 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
add name=Client6-Game parent=Client6 packet-mark=client6-gpkt queue=default priority=1 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
add name=Master-Game parent=Master packet-mark=master-gpkt queue=default priority=1 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s

In this case we make the online-games connection at first, based on out-interface=wlan1 and tcp and udp of many ports that used by the online games. Then make the online games connection packets per ip address client from that, finally we capture the packets online games on queue tree and the priority as you wish.

Part IV. Make browsing connection packets per client complete with tree queue and give the priority, here the following script :

/ip firewall mangle
add action=mark-packet chain=forward connection-bytes=0-1000000 src-port=80,443 passthrough=no packet-mark=Billing-pkt new-packet-mark=billing-bpkt protocol=tcp comment="BILLING BROWSING"
add action=mark-packet chain=forward connection-bytes=0-1000000 src-port=80,443 passthrough=no packet-mark=Client1-pkt new-packet-mark=client1-bpkt protocol=tcp comment="CLIENT1 BROWSING"
add action=mark-packet chain=forward connection-bytes=0-1000000 src-port=80,443 passthrough=no packet-mark=Client2-pkt new-packet-mark=client2-bpkt protocol=tcp comment="CLIENT2 BROWSING"
add action=mark-packet chain=forward connection-bytes=0-1000000 src-port=80,443 passthrough=no packet-mark=Client3-pkt new-packet-mark=client3-bpkt protocol=tcp comment="CLIENT3 BROWSING"
add action=mark-packet chain=forward connection-bytes=0-1000000 src-port=80,443 passthrough=no packet-mark=Client4-pkt new-packet-mark=client4-bpkt protocol=tcp comment="CLIENT4 BROWSING"
add action=mark-packet chain=forward connection-bytes=0-1000000 src-port=80,443 passthrough=no packet-mark=Client5-pkt new-packet-mark=client5-bpkt protocol=tcp comment="CLIENT5 BROWSING"
add action=mark-packet chain=forward connection-bytes=0-1000000 src-port=80,443 passthrough=no packet-mark=Client6-pkt new-packet-mark=client6-bpkt protocol=tcp comment="CLIENT6 BROWSING"
add action=mark-packet chain=forward connection-bytes=0-1000000 src-port=80,443 passthrough=no packet-mark=Master-pkt new-packet-mark=master-bpkt protocol=tcp comment="MASTER BROWSING"

/queue tree
add name="Billing-Browsing" parent=Billing packet-mark=billing-bpkt queue=default priority=2 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
add name="Client1-Browsing" parent=Client1 packet-mark=client1-bpkt queue=default priority=2 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
add name="Client2-Browsing" parent=Client2 packet-mark=client2-bpkt queue=default priority=2 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
add name="Client3-Browsing" parent=Client3 packet-mark=client3-bpkt queue=default priority=2 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
add name="Client4-Browsing" parent=Client4 packet-mark=client4-bpkt queue=default priority=2 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
add name="Client5-Browsing" parent=Client5 packet-mark=client5-bpkt queue=default priority=2 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
add name="Client6-Browsing" parent=Client6 packet-mark=client6-bpkt queue=default priority=2 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
add name="Master-Browsing" parent=Master packet-mark=master-bpkt queue=default priority=2 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s

เดียวผมมาอธิบายเพิ่มนะครับ เป็นภาษาง่าย ๆ

IP : บันทึกการเข้า
autchie
ระดับ ป.ตรี
***
ออฟไลน์ ออฟไลน์

กระทู้: 1,515



« ตอบ #6 เมื่อ: วันที่ 06 สิงหาคม 2014, 16:22:55 »

ภาษานี้ต้องแอ้ดในwinbox เองหรอคับ หรือว่ามีอยู่แล้ว ฮืม
IP : บันทึกการเข้า
art20069
ชั้นประถม
*
ออฟไลน์ ออฟไลน์

กระทู้: 308


« ตอบ #7 เมื่อ: วันที่ 07 สิงหาคม 2014, 22:11:13 »

ต้อง Add ใน theminal ของ winbox ครับแต่เดียวผมขอทำคู่มือสัก  1 อาทิตย์ก่อนนะครับแล้วนะลงแบบอ่านเป็นบทความนะครับ ให้ได้ใช้งานจริงและปรับได้ตามความต้องการของผู้ใช้ครับ แต่เรื่อง CPU นั้นควบคุมไม่ได้จริงๆ  ครับบางครั้งคาดหวังไว้มากตาม code ทำได้จริงแต่พอนำใช้งานใน box แล้ว hardware ไม่ไหวจริง ๆ ครับ
IP : บันทึกการเข้า
หน้า: [1] พิมพ์ 
« หน้าที่แล้ว ต่อไป »
กระโดดไป:  


เข้าสู่ระบบด้วยชื่อผู้ใช้ รหัสผ่าน และระยะเวลาในเซสชั่น

 
เรื่องที่น่าสนใจ
 

ข้อความที่ท่านได้อ่านบนกระดานข่าวแห่งนี้ เกิดขึ้นจากการเขียนโดยสาธารณชน และตีพิมพ์แบบอัตโนมัติ ผู้ดูแลเว็บไซต์แห่งนี้ไม่จำเป็นต้องเห็นด้วย
และไม่รับผิดชอบต่อข้อความใดๆ ผู้อ่านจึงต้องใช้วิจารณญาณในการกลั่นกรองด้วยตัวเอง และถ้าท่านพบเห็นข้อความใดๆ ที่ขัดต่อกฎหมาย และศีลธรรม พาดพิง ละเมิดสิทธิบุคคอื่น ต้องการแจ้งลบ
กรุณาส่งลิงค์มาที่
เพื่อทีมงานจะได้ดำเนินการลบออกให้ทันที..."

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2013, Simple Machines
www.chiangraifocus.com

Valid XHTML 1.0! Valid CSS!