Shorewall is an excellent free linux firewall which provides unparalleled level of fine grained control. Shorewall ممتازة الحرة لينكس جدار الحمايه التي تنص على دفع غرامة لا مثيل لها على مستوى الحبيبات. It not only acts as a firewall and Gateway, it also supports DMZ, IP Masquerading (NAT & SNAT), Proxy ARP and more. انه ليس فقط بمثابة جدار وبوابة ، كما انها تدعم المنطقة المجرده من السلاح ، والتنكر للملكيه الفكريه (طبيعي & snat) ، الوكيل Arp واكثر من ذلك. In short Shorewall is your one stop solution for complex networking routing needs, flexible & controllable internet connectivity options. وباختصار shorewall الخاص بك هو حل واحد لوقف اقامة الشبكات المعقده احتياجات التوجيه ، & مرنة يمكن التحكم خيارات الربط بشبكه الانترنت.

The Shoreline Firewall is a high-level tool for configuring Netfilter. الشاطئ هو جدار رفيع المستوى لتشكيل اداة netfilter. The firewall/gateway requirements are described in a set of configuration files. جدار الحمايه / بوابة الاحتياجات يرد وصفها في اعداد مجموعة من الملفات. Shorewall reads those configuration files and configures Netfilter to match your requirements. Shorewall تنص على تشكيل هذه الملفات وconfigures netfilter الى المباراة الاحتياجات الخاصة بك. Shorewall can be used on a dedicated firewall system, a multi-function gateway/router/server or on a standalone GNU/Linux system. Shorewall يمكن ان تستخدم على نظام جدار حمايه مخصص ، متعدد الوظيفة بوابة / مسار / خادم مستقل او على جنو / لينكس نظام. Shorewall takes advantage of Netfilter’s connection state tracking capabilities to create a stateful firewall. Shorewall مستغلة netfilter علاقة الدولة تتبع القدرات لخلق جدار جليل. In short it provides full power of iptables without the associated complexity. وباختصار فانه يوفر iptables السلطة الكاملة من دون ان يرتبط بها من التعقيد.

Today I will describe a rather common setup where you have two or more redundant ADSL / Cable / T1 connections which you want to use to provide reliable internet connectivity to your intranet machines. اليوم سأذكر بعض الشيء حيث الاعداد المشترك لديك دولتين او اكثر من لزوم خط المشترك الرقمي غير المتماثل / كبل / t1 الصلات التي تريد استخدامها لتوفير الاتصال بشبكه الانترنت يمكن الاعتماد على شبكة الانترانت الخاصة بك الآلات. You have set aside a machine which will act as the firewall and gateway. لديك تخصيص الآلة التي ستكون بمثابة بوابة وجدار الحمايه. It will also provide transparent connectivity to you intranet machines using NAT / SNAT using the dual connections you have most likely configured earlier with load balancing & fail-over (see below). كما أنها ستوفر لكم الربط شفافة الانترانت باستخدام آلات طبيعي / snat باستخدام وصلات مزدوجة لديك على الارجح تهيئتها في وقت سابق مع عدم تحميل موازنه & - أكثر من (أنظر أدناه).

Note: This is the second part of article on providing ملاحظه : هذا هو الجزء الثاني من المادة على تقديم load-balanced with fail-over internet connectivity using two or more DSL / Cable connections تحميل متوازنه مع الفشل - الاتصال بشبكه الانترنت باستخدام أكثر من اثنين أو أكثر من دي اس ال / وصلات الكابلات . You can read the first part يمكنك قراءة الجزء الأول here هنا .

Note: You can also use the concept from this article to configure a setup with single or more than two internet connection(s). ملاحظه : يمكنك ايضا استخدام هذا المفهوم من هذه المادة ا لتكوين الاعداد مع واحدة او اكثر من اثنين من الاتصال بشبكه الانترنت (ق).

Shorewall is configured using several configuration files. Shorewall بشكل التشكيل باستخدام عدد من الملفات. All configuration files are in /etc/shorewall directory. جميع الملفات في التشكيل / الخ / shorewall الدليل.

Shorewall views the network as being composed of zones. Shorewall الشبكه وجهات النظر على انها تتكون من المناطق. Shorewall recognizes the firewall system as its own zone. Shorewall تسلم جدار حمايه النظام الخاصة بها المنطقة. One or more interfaces can be defined as belonging to a single zone. بينية واحدة او اكثر يمكن ان تعرف بأنها تنتمي الى منطقة واحدة. However you can have multiple zones within a single interface too as well as nested and overlapped zones. ولكن يمكن ان يكون لديك مناطق متعددة داخل الدولة الواحدة واجهة للغاية فضلا عن مناطق متداخله وتتداخل.

In addition to the default zones I created two new zones - net & loc. وبالاضافة الى التقصير المناطق خلقته اثنين مناطق جديدة -- صافي & الموضع. I added the following lines to zones file: واضاف لى ان الخطوط التالية الى مناطق الملف :

net ipv4 صافي ipv4
loc ipv4 لوك ipv4

The net zone represents the machines interfaces which provide internet connectivity. صافي المنطقة يمثل آلات الوصلات التي توفر الاتصال بشبكه الانترنت. I then define associate these zones with the interfaces in the interfaces file by adding the following lines: وبعد ذلك تحديد المنتسبين لهذه المناطق مع الوصلات البينيه في الملف عن طريق اضافة الخطوط التالية :

net eth1 detect الكشف عن شبكة eth1
net eth2 detect الكشف عن شبكة eth2
loc eth0 detect كشف لوك eth0

The main functionality of the firewall is configured in the policy file. الرئيسية الوظيفيه للجدار هو عليه في ملف السياسة. Here I specify how the traffic is restricted across various zones. وهنا اود تحدد كيفية تقييد حركة المرور عبر مختلف المناطق. I added the following lines in policy file: واضاف لى ان الخطوط التالية في ملف السياسة :

loc net ACCEPT في الموضع تقبل صافي
net all DROP info انخفاض صافي جميع المعلومات
$FW net ACCEPT مهاجم دولار صافي قبول
$FW loc ACCEPT دولار مهاجم لوك قبول
loc $FW ACCEPT لوك دولار مهاجم قبول
all all REJECT info جميع رفض جميع المعلومات

Explanation التفسير
———— ----
loc net ACCEPT -&rt; Accept all connections from local network to internet تقبل صافي لوك -- &rt؛ قبول كل من وصلات شبكة محلية الى شبكة الانترنت
net all DROP info -&rt; Drop all incoming connection requests from network interfaces انخفاض صافي جميع المعلومات -- &rt؛ اسقاط جميع الوافدين الصدد تطلب من وصلات الشبكه
$FW net ACCEPT -&rt; Accept connections from firewall to the internet interfaces مهاجم دولار صافي تقبل -- &rt؛ قبول بالانترنت من جدار الى شبكة الانترنت الوصلات
$FW loc ACCEPT -&rt; Accept connections from firewall to the local network. مهاجم دولار في الموضع يقبل -- &rt؛ قبول بالانترنت من جدار الى الشبكه المحلية. You may want to omit this line for added security. قد ترغب في حذف هذا الخط لواضاف الأمن الدوليين.
loc $FW ACCEPT -&rt; Accept all connection from local network to firewall machine لوك دولار مهاجم قبول -- &rt؛ الصدد قبول كل من الشبكه المحلية الى جدار حمايه الآلة
all all REJECT info -&rt; Reject everything else جميع رفض جميع المعلومات -- &rt؛ رفض كل شيء آخر

To enable IP Masquerading I need to specify the interfaces between which IP Masq needs to be enabled. الملكيه الفكريه لتمكين التنكر انا بحاجة الى تحديد اوجه الترابط بين الملكيه الفكريه التي تحتاج الى masq مكن. I made the following additions to masq files to accomplish this: ادليت به الاضافات التالية لmasq لانجاز هذه الملفات :

eth1 172.16.0.0/24 192.168.1.10 eth1 172.16.0.0/24 192.168.1.10
eth2 172.16.0.0/24 192.168.0.10 eth2 172.16.0.0/24 192.168.0.10

The above lines instructs that IP Masquerading should be enabled from intranet to either eth1 or eth2 interfaces. الخطوط المذكورة اعلاه يوعز الى ان يتنكر في صورة الملكيه الفكريه ينبغى ان تمكن من الشبكه الداخلية لاما eth1 او eth2 الوصلات.

This completes the core configuration changes. ينتهي هذا التكوين التغيرات الاساسية. Finally the shorewall.conf needs to be modified to enable shorewall, add the SNAT aliases and you can also do a minor optimization of the firewall while you are at it. واخيرا فان shorewall.conf تحتاج الى تعديل لتمكين shorewall ، تضاف snat الاسماء المستعاره ويمكنك ايضا القيام قاصر الامثل للجدار ناري بينما انت فيه. The changes to shorewall.conf are as follows: التغييرات التي ادخلت على shorewall.conf هي كما يلي :

STARTUP_ENABLED=Yes = نعم startup_enabled
ADD_SNAT_ALIASES=Yes = نعم add_snat_aliases
FASTACCEPT=Yes = نعم fastaccept

Now you are ready to go. الان انت على استعداد للعودة. You should set shorewall to start as a service on rebooting with: يجب عليك ان تبدأ مجموعة shorewall ويهدف الى خدمة على اعادة تشغيل مع :
chkconfig shorewall on shorewall على chkconfig

You can start it now with: يمكنك أن تبدأ الآن مع :
service shorewall start بدء الخدمة shorewall