أحد الأشياء التى وجدت أن من الضروري تخصيص
تدوينه له والتحدث عنها في جونيبر هي
طريقة أعداد الـ NAT فجميعنا يعلم مدى أهميتها لأي مدير شبكة وطبعا للذي لايعرف ماهو الـ NAT
أقول لهم هي خاصية تسمح لنا بترجمة العناوين الخاصة Private إلى عناوين دولية Global
بهدف توفير الأيبيات الدولية وسوف يكون حديثنا عن إعداد الـ PAT
سوف أقوم أولا بأعطاء أيبيات للمنافذ وبعدها سوف ندخل بالأعدادات الخاصة بي الـ NAT
وسوف أقوم بأضافة Description لكل منفذ للتوضيح
Junos
networkset# edit interfaces ge-0/0/0
[edit interfaces ge-0/0/0]
networkset# set description “WAN”
networkset# set unit 0 family inet address 190.120.100.1/30
networkset# top
[edit]
networkset# edit interfaces ge-0/0/1
[edit interfaces ge-0/0/1]
networkset# set description “LAN”
networkset# set unit 0 family inet address 192.168.0.1/24
networkset# top
[edit]
networkset# set routing-options static route 0.0.0.0/0 next-hop 190.120.100.1
networkset# edit interfaces ge-0/0/0
[edit interfaces ge-0/0/0]
networkset# set description “WAN”
networkset# set unit 0 family inet address 190.120.100.1/30
networkset# top
[edit]
networkset# edit interfaces ge-0/0/1
[edit interfaces ge-0/0/1]
networkset# set description “LAN”
networkset# set unit 0 family inet address 192.168.0.1/24
networkset# top
[edit]
networkset# set routing-options static route 0.0.0.0/0 next-hop 190.120.100.1
الأوامر مفهومة لكل شخص تعامل مع جونيبر وأحب أن أوضح أن آخر أمر هو Static route
من اجل أرسال الباكيت إلى منفذ الـ WAN والذي يمثل مخدم الأنترنت أما الخطوة
الثانية فهي من أجل إعداد الـ NAT سوف أضع الأوامر أولا وبعدها أقوم بتفسيرها وهي
سوف تكون على خطوات
Junos
networkset# edit interfaces
[edit interfaces]
networkset# set sp-0/0/0 unit 0 family int
networkset# top
networkset# edit interfaces
[edit interfaces]
networkset# set sp-0/0/0 unit 0 family int
networkset# top
في خطوتنا الأولى قمنا بأضافة منفذ تستطيع ان تعده وهمي وهو كما ترى يسمى SP وهو
يعني service Port وهو هام من أجل تشغيل الـ NAT وهي تستخدم من أجل تمرير
الترافيك الخاص بي الـ NAT أما الخطوة الثانية فهي
Junos
networkset# edit service nat
[edit services nat]
networkset# set pool nat-pool address-range low 190.120.100.1 high 190.120.100.1
networkset# set pool nat-pool port automatic
networkset# edit service nat
[edit services nat]
networkset# set pool nat-pool address-range low 190.120.100.1 high 190.120.100.1
networkset# set pool nat-pool port automatic
في الخطوة الثانية بدأنا ندخل أكثر إلى إعداد الـ Nat وقد بدأت فيه بتحديد رانج الأيبيات وهما
كما تشاهدون عبارة عن ايبي واحد ويمكن كتابته بطريقة آخرى من خلال إزالة كلمة Range
وكتابة الأيبي مباشرة ومرة واحدة أما الأمر الذي بعده فهو من أجل أختيار بورت عشوائي كل
مرة لان كما ذكرت في بداية الموضوع أن الأعداد سوف يكون عن الـ Pat لانه الأكثر
إستخداما وعلى فكرة يمكن وضع رانج معين من البورتات لكي يتم إستخدامها لننتقل إلى
الخطوة التالية وهي من أجل وضع قوانين الـNAT أو الـ Rule
Junos
networkset# edit rule nat-outgoing
[edit services nat rule nat-outgoing]
networkset# set match-direction output
networkset# set term 1 then translated source-pool nat-pool
networkset# set term 1 then translated translation-type source dynamic
networkset# up
[edit services nat]
networkset# edit rule nat-incoming
[edit services nat rule nat-incoming]
networkset# set match-direction input
networkset# set term all then no-translation
networkset# edit rule nat-outgoing
[edit services nat rule nat-outgoing]
networkset# set match-direction output
networkset# set term 1 then translated source-pool nat-pool
networkset# set term 1 then translated translation-type source dynamic
networkset# up
[edit services nat]
networkset# edit rule nat-incoming
[edit services nat rule nat-incoming]
networkset# set match-direction input
networkset# set term all then no-translation
في هذه الخطوة والتى ذكرت بأنها وضع قواعد الـ Nat وحقيقة الأمكانيات الموجودة هنا
كثيرة جدا ومعقدة فنحن نستطيع أن نحدد بروتوكول معين لكي نقوم بترجمته أو نقوم بتحديد
خدمة معينة والكثير الكثير من الأعدادات لكن سوف نكتفي بكتابة الأعدادات الأساسية والتى
بدأناها بأختيار أسم للـRule الخاصة بي الـOutgoing وقد أخترت أسم لها nat-outgoing
وبعدها قمت بكتابة الـRule وهي من أجل ترجمة الترافيك الداخلي إلى
الأنترنت أما الـ Rule الثانية nat-incoming فأنا لم أضع فيها أي شيء لانني لا أريد
القيام بعمل Nat بين الأنترنت والـ Internal Network أما الخطوة قبل الآخيرة فهي
Junos
networkset# edit services service-set wan-service-set
[edit services service-set wan-service-set]
networkset# set nat-rules nat-outgoing
networkset# set nat-rules nat-incoming
networkset# set interface-service service-interface sp-0/0/0.0
networkset# edit services service-set wan-service-set
[edit services service-set wan-service-set]
networkset# set nat-rules nat-outgoing
networkset# set nat-rules nat-incoming
networkset# set interface-service service-interface sp-0/0/0.0
الخطوة الآخيرة هي من أجل إعداد الـService-Set والتى من خلالها سوف نضع الـRule
مع منفذ الـSP الذي قمنا به أول خطوة لكي يعمل الـ Nat وآخر خطوة هي من أجل ربط الـ Service-Set
التى أخترنا له إسم Wan-Service-Set مع المنفذ المربوط مع الأنترنت
والخطوات كالتالي
Junos
networkset# top
[edit]
networkset# edit interfaces ge-0/0/0 unit 0 family inet
[edit interfaces ge-0/0/0 unit 0 family inet]
networkset# set service input service-set wan-service-set
networkset# set service output service-set wan-service-set
networkset# top
[edit]
networkset# edit interfaces ge-0/0/0 unit 0 family inet
[edit interfaces ge-0/0/0 unit 0 family inet]
networkset# set service input service-set wan-service-set
networkset# set service output service-set wan-service-set
No comments:
Post a Comment