FortinetFortinet NSE 4

آموزش تنظیمات Virtual Server برای تقسیم بار روی سرورها در فایروال FortiGate

Virtual Server

پیکر بندی Virtual Server برای تقسیم بار روی سرورها در فورتی گیت | در این پست قرار است از ویژگی مفید Virtual Server برای Load Balance سرورهای خودمان استفاده کنیم، در ادامه با ما همراه باشید.

Server Load Balancing
Server Load Balancing
Virtual Server
Virtual Server

این ویژگی چیزی شبیه سناریو بالا هست که ما دو سرور داریم و میخواهیم Virtual Server را برای این دو فعال کنیم، نکته مهمی که وجود دارد این است که شما فقط سرور هایی را باید با هم Virtual Server کنید که دقیقا یک کار را انجام می دهند، برای مثال هر دو سرور Web Server هست و سایت شما روی آن ها قرار دارد و هر دو یک دیتا دارند.

معمولا به صورت پیشفرض Virtual Server در فورتی گیت غیرفعال است و باید آن را فعال کنیم، برای این کار از قسمت System > Feature Visibility شده و Load Balance را فعال می کنیم.

آموزش تنظیمات Virtual Server برای تقسیم بار روی سرورها در فایروال FortiGate
آموزش تنظیمات Virtual Server برای تقسیم بار روی سرورها در فایروال FortiGate

حالا از قسمت Policy & Objects وارد Virtual Server می شویم و بر روی + کلیک میکنیم تا یک Virtual Server جدید ایجاد کنیم.

آموزش تنظیمات Virtual Server برای تقسیم بار روی سرورها در فایروال FortiGate
آموزش تنظیمات Virtual Server برای تقسیم بار روی سرورها در فایروال FortiGate

یک نام برای Virtual Server خودمان وارد می کنیم، در قسمت Type باید Virtual server types خودمان را انتخاب کنیم یعنی مشخص میکنیم سرور مورد نظر قرار است چه خدماتی بدهد تا ما بر اساس آن کانفیگ کنیم.

برای مثال چون فقط میخوایم تست داشته باشیم ما IP را انتخاب کردیم تا بتونیم به کمک ping در دسترس بودن سرور را چک کنیم

مواردی که شما میتوانید انتخاب کنید به صورت زیر می باشد که باید بر اساس نوع سرویس مورد نظر خود آن را انتخاب کنید:

HTTP Select HTTP to load balance only HTTP sessions with the destination port number that matches the Virtual Server Port setting. Change Virtual Server Port to match the destination port of the sessions to be load balanced (usually port 80 for HTTP sessions). You can enable HTTP Multiplexing. You can also set Persistence to HTTP Cookie to enable cookie-based persistence.
HTTPS Select HTTPS to load balance only HTTPS sessions with the destination port number that matches the Virtual Server Port setting. Change Virtual Server Port to match the destination port of the sessions to be load balanced (usually port 443 for HTTPS sessions). You can enable HTTP Multiplexing. You can also set Persistence to HTTP Cookie to enable cookie-based persistence, or you can set Persistence to SSL Session ID.
IMAPS Select IMAPS to load balance only IMAPS sessions with the destination port number that matches the Virtual Server Port setting. Change Virtual Server Port to match the destination port of the sessions to be load balanced (usually port 993 for IMAPS sessions). You can also set Persistence to SSL Session ID.
POP3S Select POP3S to load balance only POP3S sessions with the destination port number that matches the Virtual Server Port setting. Change Virtual Server Port to match the destination port of the sessions to be load balanced (usually port 995 for POP3S sessions). You can also set Persistence to SSL Session ID.
SMTPS Select SMTPS to load balance only SMTPS sessions with the destination port number that matches the Virtual Server Port setting. Change Virtual Server Port to match the destination port of the sessions to be load balanced (usually port 465 for SMTPS sessions). You can also set Persistence to SSL Session ID.
SSL Select SSL to load balance only SSL sessions with the destination port number that matches the Virtual Server Port setting. Change Virtual Server Port to match the destination port of the sessions to be load balanced. You can also set Persistence to SSL Session ID.
TCP Select TCP to load balance only TCP sessions with the destination port number that matches the Virtual Server Port setting. Change Virtual Server Port to match the destination port of the sessions to be load balanced.
UDP Select UDP to load balance only UDP sessions with the destination port number that matches the Virtual Server Port setting. Change Virtual Server Port to match the destination port of the sessions to be load balanced.
IP Select IP to load balance all sessions accepted by the security policy that contains this virtual server.

در قسمت Virtual Server IP شما یک آیپی مجازی مشخص میکنید بجای آدرس اصلی سرور ها یعنی از این پس شما این آدرس را به کلاینت های خود می دهید و همه به این آدرس باید وصل شوند.

در قسمت Load balancing methods نیز شما method مربوط به Load balancing را مشخص می کنید، برای مثال در حالت Static بار ترافیک به صورت نصف نصف بین سرور ها تقسیم می شود و یا در Round Robin هر درخواست را به سرور در دسترس دیگر منتقل می کند و یا در حالت Weighted سروری که شما وزن بیشتری برای در نظر گرفته باشید ترافیک بیشتری را دریافت می کند.

موادری که در Load balancing methods وجود داره به صورت زیر می باشد:

Static The traffic load is statically spread evenly across all real servers. Sessions are not assigned according to how busy individual real servers are. This load balancing method provides some persistence because all sessions from the same source address always go to the same real server. Because the distribution is stateless, so if a real server is added, removed, or goes up or down, the distribution is changed and persistence might be lost.
Round Robin Directs new requests to the next real server. This method treats all real servers as equals regardless of response time or the number of connections. This method does not direct requests to real servers that down or non responsive.
Weighted Real servers with a higher weight value receive a larger percentage of connections. Set the real server weight when adding a real server.
Least Session Directs requests to the real server that has the least number of current connections. This method works best in environments where the real servers or other equipment you are load balancing all have similar capabilities. This load balancing method uses the FortiGate session table to track the number of sessions being processed by each real server. The FortiGate unit cannot detect the number of sessions actually being processed by a real server.
Least RTT Directs sessions to the real server with the lowest round trip time. The round trip time is determined by a ping health check monitor. The default is 0 if no ping health check monitors are added to the virtual server.
First Alive Directs sessions to the first live real server. This load balancing schedule provides real server failover protection by sending all sessions to the first live real server. If a real server fails, all sessions are sent to the next live real server. Sessions are not distributed to all real servers so all sessions are processed by the first real server only.
HTTP Host Load balances HTTP host connections across multiple real servers using the host’s HTTP header to guide the connection to the correct real server.

آموزش تنظیمات Virtual Server برای تقسیم بار روی سرورها در فایروال FortiGate
آموزش تنظیمات Virtual Server برای تقسیم بار روی سرورها در فایروال FortiGate

در قسمت Health check شما میتوانید به کمک TCP, HTTP, و Ping و مشخص کنید تا سرور های شما را مانیتور کند و در صورت قطع یک سرور فورتی گیت واکنش مناسب را به آن انجام دهد

آموزش تنظیمات Virtual Server برای تقسیم بار روی سرورها در فایروال FortiGate
آموزش تنظیمات Virtual Server برای تقسیم بار روی سرورها در فایروال FortiGate
آموزش تنظیمات Virtual Server برای تقسیم بار روی سرورها در فایروال FortiGate
آموزش تنظیمات Virtual Server برای تقسیم بار روی سرورها در فایروال FortiGate
آموزش تنظیمات Virtual Server برای تقسیم بار روی سرورها در فایروال FortiGate
آموزش تنظیمات Virtual Server برای تقسیم بار روی سرورها در فایروال FortiGate

در آخر نیز در قسمت Real servers باید آدرس سرور های خود را مشخص کنید.

آموزش تنظیمات Virtual Server برای تقسیم بار روی سرورها در فایروال FortiGate
آموزش تنظیمات Virtual Server برای تقسیم بار روی سرورها در فایروال FortiGate
آموزش تنظیمات Virtual Server برای تقسیم بار روی سرورها در فایروال FortiGate
آموزش تنظیمات Virtual Server برای تقسیم بار روی سرورها در فایروال FortiGate
Shares:

1 Comment

  • بهروز امانی
    بهروز امانی
    2022-07-20 at 11:51

    مختصر و مفید بود

    ممنون

    Reply

دیدگاهتان را بنویسید

نشانی ایمیل شما منتشر نخواهد شد. بخش‌های موردنیاز علامت‌گذاری شده‌اند *