نصب کلاینت v2ray و اتصال به v2ray روی لینوکس – ترمینال

آموزش لینوکس

آموزش v2ray در لینوکس
آموزش v2ray در لینوکس

خب در این آموزش قصد داریم کلاینت v2ray رو روی یه ماشین لینوکسی نصب کنیم و به یه سرور vmess متصل بشیم (از طریق ترمینال)

ابتدا اقدام به نصب v2ray روی لینوکس می کنیم:

برای دانلود اسکریپت نصب v2ray برای لینوکس از دستور زیر استفاده کنید:

wget --no-check-certificate https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh

پس از دانلود اسکریپت، نوبت به نصب میرسه، برای نصب از دستور زیر استفاده کنید:

bash install-release.sh

در انتهای نصب هم پیام زیر رو بهتون میده که کاری بهش فعلا نداشته باشید:

Please execute the command: systemctl enable v2ray; systemctl start v2ray

کانفیگ کلاینت v2ray در لینوکس

برای کانفیگ کافیه دستور زیر رو اجرا کنید:

nano /usr/local/etc/v2ray/config.json

و به صورت زیر فایل کانفیگ رو آماده کنید:

{
  "log": {
    "loglevel": "warning",
    "access": "/var/log/v2ray/access.log", 
    "error": "/var/log/v2ray/error.log"
  },

  "inbounds": [
    {
      "port": 1080, // Listening port
      "protocol": "socks", // Incoming protocol is SOCKS 5
      "sniffing": {
        "enabled": true,
        "destOverride": ["http", "tls"]
      },
      "settings": {
        "auth": "noauth"  // Authorisation setting of socks protocol. Here, noauth means no authorisati>
      }
    }
  ],
  
  
"outbounds": [
    {
      "protocol": "vmess", // Outcoming protocol
      "settings": {
        "vnext": [
          {
            "address": "111.22.33.44", // Server address, yoou need to edit this to your own IP addre> (change it - sadegh-khan)
            "port": 443,  // Server listenning port.(change it - sadegh-khan)
            "users": [
              {
                "id": "8548we2d4-27e8-48fc-8ca6-saf321535123",  // UUID, must be as same as server side (change it - sadegh-khan)
                "alterId": 64 // AlterID should be as same as server side
              }
            ]
          }
        ]
      }
    }
  ]
}

در قسمت outbound سه مقدار address ، port و id رو باید با توجه به مشخصات کلاینت خودتون پر کنید.

در انتها فایل را با ctl+x ذخیره کنید و حال وقتشه سرویس را فعال و استارت کنیم برای این کار از دستورات زیر استفاده کنید:

systemctl enable v2ray
systemctl start v2ray
systemctl status v2ray
systemctl reset v2ray
systemctl stop v2ray

و تمام 🙂 امیدوارم آموزش مفید بوده باشه، از اینجا میتونید به باقی مطالب آموزش های مرتبط با سیستم عامل و لینوکس دسترسی داشته باشید.