اعلانات تلقائية

تعديل

خخخخخخخخخخخخخخخخخخخخخخخخخخخخخخخخخخخخخخخخخخخخخخخخخخ

links

السبت، 22 أكتوبر 2011

سكربت دمج 4 خطوط على سرفر المايكروتك


السلام عليكم ورحمه الله وبركاته


دمج 4 خطوط بطريقه pcc

طبعا المعظم او الكل هيستغرب كلمه حصرى والمقصود بها هنا ليست الحصريه بمعنى اول مره لالالالا
المقصود بها الحصريه فى ان الاسكربت متجرب 200 مره وثبت فاعليته بعيدا عن المواضيع الناقصه والغير مفهومه

ولنبدأ معا

ايبهات الروترات " بامكانك تغيرها او تغير دخول الاسكربت ايهما اسهل لك"

الروتر الاول يكون 192.168.1.1

الروتر الثانى يكون 192.168.2.1
الروتر الثالث يكون 192.168.3.1
الروتر الرابع يكون 192.168.4.1

تفصيل ايبهات الاسكربت

اولا عندك 4 كروت دخول بايبهات:-

W1 192.168.1.2
W2 192.168.2.2
W3 192.168.3.2
W4 192.168.4.2


ثانيا الكارت الخامس "خروج" L
وايبهه 50.50.50.1


والان مع الاسكربت كوبى وبست فى نيوتيرمنال فى المايكروتك

كود PHP:
/interface  set ether1 name=W1
set ether2 name
=W2
set ether3 name
=W3
set ether4 name
=W4
set ether5 name
=L
ip address
add address
=50.50.50.1/24 interface=L comment=L
add address
=192.168.1.2/24 interface=W1 comment=1
add address
=192.168.2.2/24 interface=W2 comment=2
add address
=192.168.3.2/24 interface=W3 comment=3
add address
=192.168.4.2/24 interface=W4 comment=4
ip firewall mangle
add chain
=input in-interface=W1 action=mark-connection new-connection-mark=W1_conn
add chain
=input in-interface=W2 action=mark-connection new-connection-mark=W2_conn
add chain
=input in-interface=W3 action=mark-connection new-connection-mark=W3_conn
add chain
=input in-interface=W4 action=mark-connection new-connection-mark=W4_conn
add chain
=output connection-mark=W1_conn action=mark-routing new-routing-mark=W1
add chain
=output connection-mark=W2_conn action=mark-routing new-routing-mark=W2
add chain
=output connection-mark=W3_conn action=mark-routing new-routing-mark=W3
add chain
=output connection-mark=W4_conn action=mark-routing new-routing-mark=W4
add chain
=prerouting dst-address-type=!local in-interface=L per-connection-classifier=both-addresses-and-ports:4/0 action=mark-connection new-connection-mark=W1_conn passthrough=yes
add chain
=prerouting dst-address-type=!local in-interface=L per-connection-classifier=both-addresses-and-ports:4/1 action=mark-connection new-connection-mark=W2_conn passthrough=yes
add chain
=prerouting dst-address-type=!local in-interface=L per-connection-classifier=both-addresses-and-ports:4/2 action=mark-connection new-connection-mark=W3_conn passthrough=yes
add chain
=prerouting dst-address-type=!local in-interface=L per-connection-classifier=both-addresses-and-ports:4/3 action=mark-connection new-connection-mark=W4_conn passthrough=yes
add chain
=prerouting connection-mark=W1_conn in-interface=Local action=mark-routing new-routing-mark=W1
add chain
=prerouting connection-mark=W2_conn in-interface=Local action=mark-routing new-routing-mark=W2
add chain
=prerouting connection-mark=W3_conn in-interface=Local action=mark-routing new-routing-mark=W3
add chain
=prerouting connection-mark=W4_conn in-interface=Local action=mark-routing new-routing-mark=W4
ip route
add dst
-address=0.0.0.0/0 gateway=192.168.1.1 routing-mark=W1 check-gateway=ping
add dst
-address=0.0.0.0/0 gateway=192.168.2.1 routing-mark=W2 check-gateway=ping
add dst
-address=0.0.0.0/0 gateway=192.168.3.1 routing-mark=W3 check-gateway=ping
add dst
-address=0.0.0.0/0 gateway=192.168.4.1 routing-mark=W4 check-gateway=ping
add dst
-address=0.0.0.0/0 gateway=192.168.1.1 distance=1 check-gateway=ping
add dst
-address=0.0.0.0/0 gateway=192.168.2.1 distance=2 check-gateway=ping
add dst
-address=0.0.0.0/0 gateway=192.168.3.1 distance=3 check-gateway=ping
add dst
-address=0.0.0.0/0 gateway=192.168.4.1 distance=4 check-gateway=ping
ip firewall nat 
add chain
=srcnat out-interface=W1 action=masquerade
add chain
=srcnat out-interface=W2 action=masquerade
add chain
=srcnat out-interface=W3 action=masquerade
add chain
=srcnat out-interface=W4 action=masquerade
/ip dns
set allow
-remote-requests=no cache-max-ttl=1w cache-size=2048KiB max-udp-packet-size=512 servers=8.8.8.8,8.8.4.4
/ip pool
add name
=POOL ranges=50.50.50.2-50.50.50.254
/ip dhcp-server
add address
-pool=POOL authoritative=after-2sec-delay bootp-support=static disabled=no interface=Local lease-time=3d name=DHCP
/ip dhcp-server config
set store
-leases-disk=5m
/ip dhcp-server network
add address
=50.50.50.0/24 comment="" dns-server=8.8.8.8,8.8.4.4 gateway=50.50.50.1
/queue type
set 
default-small kind=pcq name=default-small pcq-classifier=
    
src-address,dst-address pcq-limit=50 pcq-rate=0 pcq-total-limit=2000 
قريبا جدا مواضيع
الدمج بالصور
باكب للدمج
باكب للدمج على روتر بورد المايكروتك





0 التعليقات:

إرسال تعليق

Twitter Delicious Facebook Digg Stumbleupon Favorites More