شرح استخدام OpenVPN وإنشاء الشهادات لهواتف SIP

مقدمة الوحدة

نظرة عامة

الشبكة الخاصة الافتراضية VPN هي اتصال شبكي آمن يتم إنشاؤه داخل شبكة عامة. ويختلف هذا الاتصال عن الاتصال الشبكي العادي لأنه يستخدم بروتوكولات أنفاق مخصصة لتنفيذ تشفير البيانات والتحقق من سلامتها ومصادقة المستخدم. وبهذه الطريقة يمكن منع الاطلاع على المعلومات أثناء النقل أو تعديلها أو نسخها. ومن منظور أمان الاتصال الشبكي، يشبه ذلك إنشاء شبكة خط خاص داخل شبكة عامة، لكن هذا الخط الخاص يكون منطقياً وليس مادياً، لذلك يسمى شبكة خاصة افتراضية. يتكون نظام VPN من خادم VPN وعملاء VPN وأنفاق. وبما أن استخدام Internet للنقل أقل تكلفة بكثير من استئجار خط مخصص، فإن VPN يجعل من الممكن للشركات نقل المعلومات الخاصة والسرية عبر Internet بطريقة آمنة واقتصادية.
يقدم هذا الدليل إعداد VPN باستخدام OpenVPN. ويعد OpenVPN أداة خارجية مفتوحة المصدر لإعداد الشبكات الخاصة الافتراضية، ويمكن استخدامها مع الأجهزة الموجودة لبناء بوابة تطبيقات VPN.

تثبيت الخادم وإعداده

OpenVPN أداة خارجية مفتوحة المصدر لإعداد الشبكات الخاصة الافتراضية، ويمكن استخدامها مع الأجهزة الموجودة لبناء بوابة تطبيقات VPN. توضح الأقسام التالية نشر الخادم وإعداده على أنظمة Ubuntu وWindows.

بناء خادم OpenVPN على Ubuntu

2.1.1 تثبيت خادم OpenVPN
أدخل الأوامر التالية في Ubuntu:
sudo apt-get -y install openvpn libssl-dev openssl
sudo apt-get -y install easy-rsa
2.1.2 إنشاء الشهادات
نفّذ الأوامر التالية لإنشاء إعدادات تهيئة الشهادات المطلوبة لتشغيل OpenVPN بشكل طبيعي:
sudo mkdir /etc/openvpn/easy-rsa/
sudo cp -r /usr/share/easy-rsa/* /etc/openvpn/easy-rsa/
sudo su
sudo vi /etc/openvpn/easy-rsa/vars
----->يمكن تعديل إعدادات الشهادة حسب الحاجة كما يلي:
export KEY_COUNTRY=”CN”
export KEY_PROVINCE=”BJ”
export KEY_CITY=”BeiJing”
export KEY_ORG=”fanvil”
export KEY_EMAIL=”fanvil@fanvil.com”
export KEY_OU=”fanvil”
export KEY_NAME=”server”
تشغيل vars:    source vars
إذا كانت هذه هي المرة الأولى، امسح كل شيء:    ./clean-all
إنشاء شهادة CA:    ./build-ca
إنشاء شهادة الخادم:    ./build-key-server server
إنشاء شهادة العميل:    ./build-key client
إنشاء مكتبة المفاتيح الديناميكية.    ./build-dh

تشغيل الخادم

قم بإعداد بيئة الخادم وضع ملفات إعداد الشهادات المقابلة في الدليل المحدد:
cp keys/ca.crt /etc/openvpn/
cp keys/server.crt keys/server.key keys/dh2048.pem /etc/openvpn
mv /etc/openvpn/dh2048.pem /etc/openvpn/dh1024.pem
cp keys/client.key keys/client.crt   /etc/openvpn/
cp /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz /etc/openvpn/
cd /etc/openvpn
gzip -d server.conf.gz
cp /usr/share/doc/openvpn/examples/sample-config-files/client.conf /etc/openvpn/
تشغيل الخادم:
/etc/init.d/openvpn restart

بناء خادم OpenVPN على Windows

2.3.1 تثبيت خادم OpenVPN
ابحث عبر الإنترنت عن إصدار OpenVPN لنظام Windows وقم بتنزيله. يستخدم هذا المثال OpenVPN GUI. انقر نقراً مزدوجاً على البرنامج الذي تم تنزيله وثبته بالإعدادات الافتراضية. انتبه إلى تحديد مكون easy-rsa أثناء التثبيت. المسار الافتراضي هو C:\Program Files\OpenVPN.
2.3.2 إنشاء الشهادات
قبل تنفيذ العملية، يجب أولاً إجراء التهيئة:
عدّل الجزء التالي من C:\Program Files\OPENVPN\easy-rsa\vars.bat.sample وفقاً لحالتك:
set HOME=C:\Program Files\OPENVPN\easy-rsa
set KEY_COUNTRY=CN    #(الدولة)
set KEY_PROVINCE=BEIJING    #(المقاطعة)
set KEY_CITY= BEIJING    #(المدينة)
set KEY_ORG=WINLINE    #(المؤسسة)
set KEY_EMAIL=admin@winline.com.cn    #(عنوان البريد الإلكتروني)
المحتوى الذي يبدأ بعلامة # أعلاه هو تعليق. لا تكتبه داخل الملف.
افتح cmd بصلاحيات المدير، ثم ادخل إلى DOS ونفذ الأوامر التالية للدخول إلى دليل
openvpn\easy-rsa:
        init-config
        vars
        clean-all
إنشاء شهادة الجذر:    build-ca (اضغط Enter حتى النهاية لاستخدام الإعدادات الافتراضية)
إنشاء مكتبة المفاتيح الديناميكية:    build-dh
إنشاء شهادة الخادم:    build-key-server server (اضغط Enter حتى النهاية لاستخدام الإعدادات الافتراضية)
إنشاء شهادة العميل:    build-key client (اضغط Enter حتى النهاية لاستخدام الإعدادات الافتراضية)
2.3.3 تشغيل الخادم
يتم تخزين جميع المفاتيح التي تم إنشاؤها في دليل OpenVPN\easy-rsa\keys.
انسخ الشهادات التي تم إنشاؤها إلى دليل OpenVPN\config.
انسخ ملف إعداد الخادم الموجود ضمن OpenVPN\sample-config إلى دليل OpenVPN\config، ثم شغّل تطبيق OpenVPN.

إعدادات جهة الخادم

في دليل تثبيت OpenVPN، استخدم notepad++ لفتح ملف server.ovpn أو server.conf. فيما يلي مثال على ملف جهة الخادم:
port 1194 # هذا المنفذ هو المنفذ المخصص من IANA لـ OpenVPN ويمكن تعديله حسب الحاجة
proto udp # يمكن أيضاً اختيار tcp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh1024.pem
server 10.8.0.0 255.255.255.0 # إعداد مقطع LAN الافتراضي، عدّله حسب الحاجة
ifconfig-pool-persist ipp.txt
keepalive 10 120
client-to-client
comp-lzo
max-clients 100
persist-key
persist-tun
status openvpn-status.log
verb 3
لمزيد من التفاصيل، يمكن الرجوع إلى OpenVPN Wiki.

استخدام العميل وإعداده

إعداد العميل

يقصد بالعميل هنا الأجهزة التي تدعم OpenVPN. لكي يتمكن هاتف SIP من الاتصال بخادم OpenVPN، نحتاج إلى ملفات الشهادات.
أولاً، يجب تحرير ملف إعداد العميل client.ovpn أو client.conf. فيما يلي مثال على ملف إعداد العميل:
client
dev tun
proto udp
remote 192.168.1.135 1194 # نطاق/IP الخادم والمنفذ
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert client.crt
key client.key comp-lzo
verb 3
يمكن تعديل إعدادات العميل بما يتوافق مع إعدادات جهة الخادم.
بعد ذلك، صدّر ملفات العميل التي تم إنشاؤها سابقاً ca.crt وclient.crt وclient.key لاستخدامها عند ترقية هاتف SIP.

استخدام OpenVPN على الهاتف

سجّل الدخول إلى صفحة الويب الخاصة بالهاتف، ثم انقر بالتتابع على الشبكة->VPN. في حقل ملفات OpenVPN، قم بترقية client.ovpn وclient.key وclient.crt وca.crt واحداً تلو الآخر. بعد اكتمال الترقية، سيعرض حقل ملفات OpenVPN حجم ملفات الشهادات التي تم إدخالها، كما هو موضح أدناه:
رفع ملفات OpenVPNافتح صفحة إعداد VPN، واختر Open VPN في وضع VPN، وقم بتمكين VPN، ثم انقر على زر إرسال. بعد الاتصال بالخادم بنجاح، سيظهر عنوان IP الذي تم الحصول عليه في خانة حالة اتصال VPN على صفحة VPN. كما هو موضح أدناه، عنوان IP الذي تم الحصول عليه هو 10.8.0.10.
فتح واجهة إعداد VPN

تمكين VPN NAT

واجهة تمكين VPN NAT
طريقة الاستخدام:
قم باستيراد شهادات VPN إلى الهاتف، ثم فعّل Enable VPN وEnable NAT، وقم بتوصيل الكمبيوتر بمنفذ LAN في الهاتف. يجب ضبط بوابة الكمبيوتر على عنوان IP الخاص بالهاتف. عندها يستطيع الكمبيوتر الوصول إلى VPN الخاص بالهاتف.
يمكن لـ PC ping10.8.0.10 أن يعمل بنجاح، ويمكن أيضاً لـ ping www.baidu.com أن يعمل بنجاح. 10.8.0.10 هو عنوان IP الخاص بـ VPN.
ملاحظة: الطرازات المدعومة حالياً تشمل J3G/X3U/X3SG/J1P وكذلك X5S/X6/X7/X7C/X210/X210i. الهواتف X3S/X4/X7 غير مدعومة حالياً.

كتالوج
خدمة العملاء الهاتف
We use cookie to improve your online experience. By continuing to browse this website, you agree to our use of cookie.

Cookies

This Cookie Policy explains how we use cookies and similar technologies when you access or use our website and related services. Please read this Policy together with our Terms and Conditions and Privacy Policy so that you understand how we collect, use, and protect information.

By continuing to access or use our Services, you acknowledge that cookies and similar technologies may be used as described in this Policy, subject to applicable law and your available choices.

Updates to This Cookie Policy

We may revise this Cookie Policy from time to time to reflect changes in legal requirements, technology, or our business practices. When we make updates, the revised version will be posted on this page and will become effective from the date of publication unless otherwise required by law.

Where required, we will provide additional notice or request your consent before applying material changes that affect your rights or choices.

What Are Cookies?

Cookies are small text files placed on your device when you visit a website or interact with certain online content. They help websites recognize your browser or device, remember your preferences, support essential functionality, and improve the overall user experience.

In this Cookie Policy, the term “cookies” also includes similar technologies such as pixels, tags, web beacons, and other tracking tools that perform comparable functions.

Why We Use Cookies

We use cookies to help our website function properly, remember user preferences, enhance website performance, understand how visitors interact with our pages, and support security, analytics, and marketing activities where permitted by law.

We use cookies to keep our website functional, secure, efficient, and more relevant to your browsing experience.

Categories of Cookies We Use

Strictly Necessary Cookies

These cookies are essential for the operation of the website and cannot be disabled in our systems where they are required to provide the service you request. They are typically set in response to actions such as setting privacy preferences, signing in, or submitting forms.

Without these cookies, certain parts of the website may not function correctly.

Functional Cookies

Functional cookies enable enhanced features and personalization, such as remembering your preferences, language settings, or previously selected options. These cookies may be set by us or by third-party providers whose services are integrated into our website.

If you disable these cookies, some services or features may not work as intended.

Performance and Analytics Cookies

These cookies help us understand how visitors use our website by collecting information such as traffic sources, page visits, navigation behavior, and general interaction patterns. In many cases, this information is aggregated and does not directly identify individual users.

We use this information to improve website performance, usability, and content relevance.

Targeting and Advertising Cookies

These cookies may be placed by our advertising or marketing partners to help deliver more relevant ads and measure the effectiveness of campaigns. They may use information about your browsing activity across different websites and services to build a profile of your interests.

These cookies generally do not store directly identifying personal information, but they may identify your browser or device.

First-Party and Third-Party Cookies

Some cookies are set directly by our website and are referred to as first-party cookies. Other cookies are set by third-party services, such as analytics providers, embedded content providers, or advertising partners, and are referred to as third-party cookies.

Third-party providers may use their own cookies in accordance with their own privacy and cookie policies.

Information Collected Through Cookies

Depending on the type of cookie used, the information collected may include browser type, device type, IP address, referring website, pages viewed, time spent on pages, clickstream behavior, and general usage patterns.

This information helps us maintain the website, improve performance, enhance security, and provide a better user experience.

Your Cookie Choices

You can control or disable cookies through your browser settings and, where available, through our cookie consent or preference management tools. Depending on your location, you may also have the right to accept or reject certain categories of cookies, especially those used for analytics, personalization, or advertising purposes.

Please note that blocking or deleting certain cookies may affect the availability, functionality, or performance of some parts of the website.

Restricting cookies may limit certain features and reduce the quality of your experience on the website.

Cookies in Mobile Applications

Where our mobile applications use cookie-like technologies, they are generally limited to those required for core functionality, security, and service delivery. Disabling these essential technologies may affect the normal operation of the application.

We do not use essential mobile application cookies to store unnecessary personal information.

How to Manage Cookies

Most web browsers allow you to manage cookies through browser settings. You can usually choose to block, delete, or receive alerts before cookies are stored. Because browser controls vary, please refer to your browser provider’s support documentation for details on how to manage cookie settings.

Contact Us

If you have any questions about this Cookie Policy or our use of cookies and similar technologies, please contact us at support@becke.cc .