यह गाइड सिखाती है कि सरलीकृत इंस्टॉलेशन स्क्रिप्ट से VPS पर WireGuard VPN कैसे इंस्टॉल करें। WireGuard आधुनिक, तेज़ और सुरक्षित VPN है जिससे आप अपना निजी वर्चुअल नेटवर्क बना सकते हैं।
📋 पूर्वापेक्षाएँ
- root या sudo एक्सेस वाला VPS
- सक्रिय SSH कनेक्शन
- Ubuntu/Debian (स्क्रिप्ट इन वितरणों पर काम करती है)
- UFW इंस्टॉल और कॉन्फ़िगर (UFW इंस्टॉल गाइड देखें)
📥 WireGuard इंस्टॉलेशन
इंस्टॉलेशन स्क्रिप्ट डाउनलोड करें
कॉन्फ़िगरेशन को सरल बनाने वाली स्वचालित स्क्रिप्ट का उपयोग करें:
Bash# Download the installation script curl -O https://raw.githubusercontent.com/angristan/wireguard-install/master/wireguard-install.sh # Make the script executable chmod +x wireguard-install.sh
स्क्रिप्ट चलाएँ
Bashsudo ./wireguard-install.sh
इंटरैक्टिव कॉन्फ़िगरेशन
स्क्रिप्ट कुछ प्रश्न पूछेगी। अनुशंसित उत्तर:
- Interface:
eth0(डिफ़ॉल्ट) के लिएEnterदबाएँ - IPv4 Address: स्वचालित निजी पता (जैसे
10.7.0.1/24) के लिएEnter - WireGuard Port: पोर्ट
51820(डिफ़ॉल्ट) के लिएEnter - DNS: DNS चुनें:
1Cloudflare (1.1.1.1) — अनुशंसित2Google (8.8.8.8)3OpenDNS (208.67.222.222)4Quad9 (9.9.9.9)
- Client: पहले क्लाइंट का नाम (जैसे
my-pc,laptop,smartphone)
स्क्रिप्ट स्वचालित रूप से:
- WireGuard इंस्टॉल करेगी
- निजी और सार्वजनिक कुंजियाँ जनरेट करेगी
- सर्वर कॉन्फ़िगर करेगी
- पहला क्लाइंट बनाएगी
📱 क्लाइंट कॉन्फ़िगरेशन
कॉन्फ़िगरेशन फ़ाइल प्राप्त करें
इंस्टॉलेशन के बाद स्क्रिप्ट क्लाइंट कॉन्फ़िगरेशन फ़ाइल बनाती है:
Bash# Display the configuration file content cat /root/[client-name].conf # Example: if you named your client "my-pc" cat /root/my-pc.conf
कॉन्फ़िगरेशन फ़ाइल उदाहरण
फ़ाइल इस प्रकार दिखेगी:
[Interface]
PrivateKey = [your-private-key]
Address = 10.7.0.2/24
DNS = 1.1.1.1
[Peer]
PublicKey = [server-public-key]
Endpoint = [your-vps-ip]:51820
AllowedIPs = 0.0.0.0/0
PersistentKeepalive = 25
अपने डिवाइस पर क्लाइंट इंस्टॉल करें
Windows
- wireguard.com से WireGuard डाउनलोड करें
- एप्लिकेशन इंस्टॉल करें
- WireGuard खोलें और "Add Tunnel" > "Add empty tunnel" पर क्लिक करें
.confफ़ाइल की सामग्री कॉपी-पेस्ट करें- सहेजें और कनेक्शन सक्रिय करें
macOS
- App Store या wireguard.com से WireGuard डाउनलोड करें
- एप्लिकेशन इंस्टॉल करें
- WireGuard खोलें और "Add Tunnel" > "Create from file" या "Create from clipboard" चुनें
- कॉन्फ़िगरेशन फ़ाइल इмпोर्ट करें
- कनेक्शन सक्रिय करें
Linux (Ubuntu/Debian)
Bash# Install WireGuard sudo apt update sudo apt install wireguard -y # Copy the configuration file sudo cp /root/my-pc.conf /etc/wireguard/wg0.conf # Enable WireGuard sudo wg-quick up wg0 # Enable on boot sudo systemctl enable wg-quick@wg0
Android/iOS
- Google Play Store या App Store से WireGuard ऐप इंस्टॉल करें
- ऐप खोलें और "+" बटन पर क्लिक करें
- "Create from file" या "Create from QR code" चुनें
- कॉन्फ़िगरेशन फ़ाइल इмпोर्ट करें
- कनेक्शन सक्रिय करें
🔐 नया क्लाइंट जोड़ें
बाद में नया क्लाइंट (दूसरे डिवाइस के लिए) जोड़ने हेतु:
Bashsudo ./wireguard-install.sh
स्क्रिप्त पूछे तो add a new client विकल्प चुनें। नया नाम दें; स्क्रिप्ट /root/[client-name].conf में नई फ़ाइल बनाएगी।
🚀 उपयोगी WireGuard कमांड
सेवा प्रबंधन
Bash# Start WireGuard sudo systemctl start wg-quick@wg0 # Stop WireGuard sudo systemctl stop wg-quick@wg0 # Restart WireGuard sudo systemctl restart wg-quick@wg0 # Service status sudo systemctl status wg-quick@wg0 # Enable on boot sudo systemctl enable wg-quick@wg0 # Disable on boot sudo systemctl disable wg-quick@wg0
कनेक्शन जानकारी
Bash# View WireGuard information sudo wg show # View transfer statistics sudo wg show wg0 transfer # View current configuration sudo wg show wg0 dump
लॉग
Bash# View logs in real-time sudo journalctl -u wg-quick@wg0 -f # View last entries sudo journalctl -u wg-quick@wg0 -n 50
🔐 UFW में WireGuard अनुमति दें
महत्वपूर्ण: इंस्टॉलेशन के बाद UFW में WireGuard पोर्ट अनुमति देना न भूलें, अन्यथा VPN काम नहीं करेगा।
Bash# Allow WireGuard port (default 51820) sudo ufw allow 51820/udp # Reload UFW sudo ufw reload # Verify that the rule is active sudo ufw status | grep 51820
✅ सत्यापन
WireGuard कार्य कर रहा है या नहीं
Bash# Check service status sudo systemctl status wg-quick@wg0 # Check active connections sudo wg show # Verify that the port is open sudo netstat -ulnp | grep 51820
क्लाइंट से परीक्षण
क्लाइंट से कनेक्ट होने पर:
- सार्वजनिक IP जाँचें:
curl ifconfig.me(VPS IP दिखनी चाहिए) - कनेक्टिविटी:
ping 8.8.8.8 - नेटवर्क इंटरफ़ेस से VPN कनेक्शन सत्यापित करें
🆘 समस्या निवारण
WireGuard शुरू नहीं होता
Bash# Check logs sudo journalctl -u wg-quick@wg0 -n 50 # Check configuration sudo wg-quick down wg0 sudo wg-quick up wg0 # Verify that the port is available sudo netstat -ulnp | grep 51820
क्लाइंट से कनेक्ट नहीं हो पाता
-
UFW में पोर्ट खुला है:
Bashsudo ufw status | grep 51820 -
सर्वर पोर्ट पर सुन रहा है:
Bashsudo netstat -ulnp | grep 51820 -
क्लाइंट कॉन्फ़िगरेशन:
Endpointमें सर्वर IP सही है -
सर्वर लॉग:
Bashsudo journalctl -u wg-quick@wg0 -f
इंस्टॉलेशन स्क्रिप्ट विफल
- root या sudo अधिकार सत्यापित करें
- इंटरनेट कनेक्शन जाँचें
- सिस्टम अपडेट:
sudo apt update && sudo apt upgrade -y - स्क्रिप्ट पुनः डाउनलोड:
Bash
rm wireguard-install.sh curl -O https://raw.githubusercontent.com/angristan/wireguard-install/master/wireguard-install.sh chmod +x wireguard-install.sh
📚 अतिरिक्त संसाधन
❓ अक्सर पूछे जाने वाले प्रश्न
प्र: क्या एक साथ कई क्लाइंट उपयोग कर सकते हैं?
उ: हाँ, WireGuard एक साथ कई क्लाइंट सपोर्ट करता है। स्क्रिप्ट से नया क्लाइंट जोड़ें।
प्र: WireGuard की गति कितनी है?
उ: WireGuard सबसे तेज़ VPN में से एक है, मूल गति के करीब प्रदर्शन।
प्र: क्या WireGuard सुरक्षित है?
उ: हाँ, आधुनिक एन्क्रिप्शन और सुरक्षा ऑडिट।
प्र: इंस्टॉलेशन के बाद पोर्ट बदल सकते हैं?
उ: हाँ, लेकिन मैन्युअल कॉन्फ़िगरेशन आवश्यक। आवश्यकता हो तो स्क्रिप्ट से पुनः इंस्टॉल सरल है।
सफल कॉन्फ़िगरेशन! 🚀