نظرا لطلبات الكثر من الاعضاء على كيفية عمل لود بلنس لـ 3 خطوط انترنت واخراج واحد هذا الشرح مجرب من قبلي على سيرفر مايكروتك اصدار 2.9.20 .. ارجوا من الرغبين في تطبيق الشرح بان ينتبهوا للقيم والايبيات الموجودة .. يجب تغير وتعديل الكودات حسب ايبيات شبكتك .. عدم لصق الكود من دون معرفة .
طريقة العمل مكونة من اربع كروت شبكة .. ثلاث للدخول والرابع للخروج
كارت الشبكة الاول الـ WAN1 والمسمى في الشرح con1 يحمل ايبي : 10.111.0.2/24
كارت الشبكة الثاني الـ WAN2 والمسمى في الشرح con2 يحمل ايبي : 10.112.0.2/24
كارت الشبكة الثالث الـ WAN2 والمسمى في الشرح con2 يحمل ايبي : 10.113.0.2/24
كارت الشبكة الرابع الـ LAN والمسمى في الشرح local يحمل ايبي : 192.168.0.1/24
كارت الشبكة الثاني الـ WAN2 والمسمى في الشرح con2 يحمل ايبي : 10.112.0.2/24
كارت الشبكة الثالث الـ WAN2 والمسمى في الشرح con2 يحمل ايبي : 10.113.0.2/24
كارت الشبكة الرابع الـ LAN والمسمى في الشرح local يحمل ايبي : 192.168.0.1/24
يجيب تسمة الكروت بهذه الاسماء اولا.
كود عمل هذه الايبايت المذكورة
كود PHP:
ip address
add address=192.168.0.1/24 network=192.168.0.0 broadcast=192.168.0.255 interface=local comment="" disabled=no
add address=10.111.0.2/24 network=10.111.0.0 broadcast=10.111.0.255 interface=con1 comment="" disabled=no
add address=10.112.0.2/24 network=10.112.0.0 broadcast=10.112.0.255 interface=con2 comment="" disabled=no
add address=10.113.0.2/24 network=10.113.0.0 broadcast=10.113.0.255 interface=con3 comment="" disabled=no
كود PHP:
ip route
add dst-address=0.0.0.0/0 gateway=10.111.0.1 scope=255 target-scope=10 routing-mark=mark1 comment="" disabled=no
add dst-address=0.0.0.0/0 gateway=10.112.0.1 scope=255 target-scope=10 routing-mark=mark2 comment="" disabled=no
add dst-address=0.0.0.0/0 gateway=10.113.0.1 scope=255 target-scope=10 routing-mark=mark3 comment="" disabled=no
add dst-address=0.0.0.0/0 gateway=10.113.0.1 scope=255 target-scope=10 comment="" disabled=no
add dst-address=0.0.0.0/0 gateway=10.111.0.1 scope=255 target-scope=10 comment="" disabled=no
كود PHP:
ip dns
set primary-dns=192.168.1.1 secondary-dns=192.168.0.1 allow-remote-requests=no cache-size=2048KiB cache-max-ttl=1w
كود PHP:
ip firewall nat
add chain=srcnat connection-mark=mark1 action=src-nat to-addresses=10.111.0.2 to-ports=0-65535 comment="" disabled=no
add chain=srcnat connection-mark=mark2 action=src-nat to-addresses=10.112.0.2 to-ports=0-65535 comment="" disabled=no
add chain=srcnat connection-mark=mark2 action=src-nat to-addresses=10.113.0.2 to-ports=0-65535 comment="" disabled=no
كود PHP:
ip firewall mangle
add chain=prerouting in-interface=local src-address-list=mark1 action=mark-connection new-connection-mark=mark1 passthrough=yes
comment="" disabled=no
add chain=prerouting in-interface=local src-address-list=mark1 action=mark-routing new-routing-mark=mark1 passthrough=no comment=""
disabled=no
add chain=prerouting in-interface=local src-address-list=mark2 action=mark-connection new-connection-mark=mark2 passthrough=yes
comment="" disabled=no
add chain=prerouting in-interface=local src-address-list=mark2 action=mark-routing new-routing-mark=mark2 passthrough=no comment=""
disabled=no
add chain=prerouting in-interface=local src-address-list=mark3 action=mark-connection new-connection-mark=mark3 passthrough=yes
comment="" disabled=no
add chain=prerouting in-interface=local src-address-list=mark3 action=mark-routing new-routing-mark=mark3 passthrough=no comment=""
disabled=no
add chain=prerouting in-interface=local connection-state=new nth=1,1,0 action=mark-connection new-connection-mark=mark1
passthrough=yes comment="" disabled=no
add chain=prerouting in-interface=local connection-mark=mark1 action=add-src-to-address-list address-list=mark1
address-list-timeout=1d comment="" disabled=no
add chain=prerouting in-interface=local connection-mark=mark1 action=mark-routing new-routing-mark=mark1 passthrough=no comment=""
disabled=no
add chain=prerouting in-interface=local connection-state=new nth=1,1,1 action=mark-connection new-connection-mark=mark2
passthrough=yes comment="" disabled=no
add chain=prerouting in-interface=local connection-mark=mark2 action=add-src-to-address-list address-list=mark2
address-list-timeout=1d comment="" disabled=no
add chain=prerouting in-interface=local connection-mark=mark2 action=mark-routing new-routing-mark=mark2 passthrough=no comment=""
disabled=no
add chain=prerouting in-interface=local connection-state=new nth=1,1,1 action=mark-connection new-connection-mark=mark3
passthrough=yes comment="" disabled=no
add chain=prerouting in-interface=local connection-mark=mark3 action=add-src-to-address-list address-list=mark3
address-list-timeout=1d comment="" disabled=no
add chain=prerouting in-interface=local connection-mark=mark3 action=mark-routing new-routing-mark=mark3 passthrough=no comment=""
disabled=no
No comments:
Post a Comment