VPN: IPsec & SSL Remote Access
Sophos Firewall Sophos VM (GUI + CLI)
مقصدObjectiveObjective
اس لیب میں آپ site-to-site IPsec VPN بنائیں گے اور موبائل یوزرز کے لیے SSL VPN remote رسائی سیٹ اپ کریں گے۔Is lab mein aap site-to-site IPsec VPN banayenge aur mobile users ke liye SSL VPN remote access setup kareinge.In this lab you will build a site-to-site IPsec VPN and set up SSL VPN remote access for mobile users.
آسان مثالSimple AnalogySimple Analogy
IPsec site-to-site tunnel دو دفتر کی عمارتوں کے درمیان خفیہ سرنگ جیسا ہے — ہمیشہ موجود، ہمیشہ محفوظ۔ SSL VPN سفر کرتے ملازم کو دیا ہوٹل key card جیسا ہے — وہ کہیں سے بھی کنیکٹ ہوتا ہے اور دن بھر کے لیے اندر آتا ہے۔ برانچز کے لیے سرنگ، گھومتے پھرتے یوزرز کے لیے key card۔IPsec site-to-site tunnel do office buildings ke darmiyan khufiya surang jaisa hai — hamesha maujood, hamesha mehfooz. SSL VPN safar karte employee ko diya hotel key card jaisa hai — wo kahin se bhi connect hota hai aur din bhar ke liye andar aata hai. Branches ke liye surang, ghoomte phirte users ke liye key card.An IPsec site-to-site tunnel is like a private underground tunnel between two office buildings — always there, always guarded. SSL VPN is like a hotel key card given to a traveling employee — they connect from anywhere and get in for the day. Use the tunnel for branches, the key card for roaming users.
سیٹ اپLab SetupLab Setup
sophos-05 سے جاری رکھیں۔ دوسری فائر وال simulate کریں یا برانچ روٹر استعمال کریں: Site A (Sophos, LAN 192.168.1.0/24), Site B (peer device, LAN 192.168.2.0/24)، 'WAN' لنک سے connected۔ SSL VPN کے لیے ایک remote ٹیسٹ لیپ ٹاپ اور ایک ٹیسٹ یوزر چاہیے۔sophos-05 se continue karein. Doosri firewall simulate karein ya branch router istemal karein: Site A (Sophos, LAN 192.168.1.0/24), Site B (peer device, LAN 192.168.2.0/24), 'WAN' link se connected. SSL VPN ke liye ek remote test laptop aur ek test user chahiye.Continue from sophos-05. Simulate a second firewall or use a branch router: Site A (Sophos, LAN 192.168.1.0/24), Site B (peer device, LAN 192.168.2.0/24), connected over a 'WAN' link. For SSL VPN you need one remote test laptop and a test user.
اقداماتStepsSteps
Step 1
IPsec کنیکشن بنائیں۔ اسے Branch-Tunnel نام دیں، کنیکشن ٹائپ site-to-site رکھیں، اور remote gateway (peer کا WAN IP) لکھیں۔IPsec connection banayein. Isay Branch-Tunnel naam dein, connection type site-to-site rakhein, aur remote gateway (peer ka WAN IP) likhein.Create the IPsec connection. Name it Branch-Tunnel, set connection type to site-to-site, and enter the remote gateway (the peer's WAN IP).
🖱️ VPN > IPsec connections — Add (Site-to-site)VPN > IPsec connections — Add (Site-to-site)VPN > IPsec connections — Add (Site-to-site)
Step 2
Authentication اور encryption سیٹ کریں۔ مضبوط pre-shared key استعمال کریں (دونوں طرف ایک جیسی)۔ Phase 1 (IKE) اور phase 2 (IPsec) سیٹنگز چنیں — دونوں طرف بالکل ایک جیسی رکھیں۔Authentication aur encryption set karein. Mazboot pre-shared key istemal karein (dono taraf ek jaisi). Phase 1 (IKE) aur phase 2 (IPsec) settings chunein — dono taraf bilkul ek jaisi rakhein.Set authentication and encryption. Use a strong pre-shared key (same on both sides). Choose phase 1 (IKE) and phase 2 (IPsec) settings — keep both sides identical.
🖱️ VPN > IPsec connections > Branch-Tunnel — Authentication اور EncryptionVPN > IPsec connections > Branch-Tunnel — Authentication aur EncryptionVPN > IPsec connections > Branch-Tunnel — Authentication and Encryption
Step 3
protected نیٹ ورکس طے کریں۔ Local subnet: 192.168.1.0/24, remote subnet: 192.168.2.0/24۔ صرف یہ سب نیٹس tunnel سے گزریں گی۔Protected networks tay karein. Local subnet: 192.168.1.0/24, remote subnet: 192.168.2.0/24. Sirf ye subnets tunnel se guzrengi.Define the protected networks. Local subnet: 192.168.1.0/24, remote subnet: 192.168.2.0/24. Only these subnets travel through the tunnel.
🖱️ VPN > IPsec connections > Branch-Tunnel — Local/Remote subnetsVPN > IPsec connections > Branch-Tunnel — Local/Remote subnetsVPN > IPsec connections > Branch-Tunnel — Local/Remote subnets
Step 4
Tunnel up کر کے ویریفائی کریں۔ کنیکشن activate کریں اور کنفرم کریں کہ دونوں phases connected نظر آئیں۔ Site A کے PC سے Site B کے ہوسٹ کو tunnel کے ذریعے پنگ کریں۔Tunnel up kar ke verify karein. Connection activate karein aur confirm karein ke dono phases connected nazar aayein. Site A ke PC se Site B ke host ko tunnel ke through ping karein.Bring up and verify the tunnel. Activate the connection and confirm both phases show connected. Ping a host at Site B from a Site A PC through the tunnel.
show vpn
🖱️ VPN > IPsec connections — tunnel اسٹیٹس چیک کریں (سبز)VPN > IPsec connections — tunnel status check karein (sabz)VPN > IPsec connections — check tunnel status (green)
Step 5
SSL VPN سیٹ اپ کریں۔ SSL VPN remote access enable کریں، پروٹوکول/پورٹ چنیں، اور ایسی پالیسی بنائیں جو ٹیسٹ یوزر کو ضروری LAN وسائل تک رسائی دے۔SSL VPN setup karein. SSL VPN remote access enable karein, protocol/port chunein, aur aisi policy banayein jo test user ko zaroori LAN resources tak access de.Set up SSL VPN. Enable SSL VPN remote access, choose the protocol/port, and create a policy that gives the test user access to the LAN resources they need.
🖱️ VPN > SSL VPN (remote access) — General settingsVPN > SSL VPN (remote access) — General settingsVPN > SSL VPN (remote access) — General settings
Step 6
remote یوزر کنیکٹ کریں۔ ٹیسٹ یوزر کے طور پر یوزر پورٹل میں لاگ اِن کریں، SSL VPN کلائنٹ config ڈاؤن لوڈ کریں، اور remote لیپ ٹاپ سے کنیکٹ کریں۔ LAN وسائل تک رسائی ویریفائی کریں۔Remote user connect karein. Test user ke tor par user portal mein login karein, SSL VPN client config download karein, aur remote laptop se connect karein. LAN resource tak access verify karein.Connect a remote user. Log in to the user portal as the test user, download the SSL VPN client config, and connect from the remote laptop. Verify access to a LAN resource.
🖱️ User portal (https://<WAN-IP>) — SSL VPN config ڈاؤن لوڈ کریںUser portal (https://<WAN-IP>) — SSL VPN config download kareinUser portal (https://<WAN-IP>) — download SSL VPN config
تصدیقVerifyVerify
IPsec tunnel دونوں phases پر connected نظر آئے، Site A، Site B کو tunnel سے پنگ کر سکے، اور SSL VPN یوزر LAN فائل شیئر یا ویب سرور تک پہنچے۔IPsec tunnel dono phases par connected nazar aaye, Site A, Site B ko tunnel se ping kar sake, aur SSL VPN user LAN file share ya web server tak pohche.The IPsec tunnel shows connected on both phases, Site A can ping Site B through it, and the SSL VPN user reaches a LAN file share or web server.
show vpn
خرابی دور کرناTroubleshootingTroubleshooting
⚠️ IPsec tunnel down ہی رہتا ہے (سرخ)۔IPsec tunnel down hi rehta hai (surkh).The IPsec tunnel stays down (red).
✅ پہلے phase 1 چیک کریں: غلط pre-shared key یا IKE سیٹنگز سب سے عام وجہ ہیں۔ پھر phase 2 (encryption/domain mismatch) دیکھیں۔ کنفرم کریں کہ دونوں peers کی سیٹنگز ایک جیسی ہیں اور WAN IPs reachable ہیں۔Pehle phase 1 check karein: ghalat pre-shared key ya IKE settings sab se aam wajah hain. Phir phase 2 (encryption/domain mismatch) dekhein. Confirm karein ke dono peers ki settings ek jaisi hain aur WAN IPs reachable hain.Check phase 1 first: mismatched pre-shared key or IKE settings are the most common cause. Then check phase 2 (encryption/domain mismatch). Confirm both peers use the same settings and the WAN IPs are reachable.
⚠️ SSL VPN کنیکٹ ہوتا ہے مگر یوزر LAN سرورز تک نہیں پہنچ پاتا۔SSL VPN connect hota hai magar user LAN servers tak nahi pohnch pata.SSL VPN connects but the user cannot reach LAN servers.
✅ SSL VPN پالیسی چیک کریں: user/group کو صحیح وسائل کی اجازت ہونی چاہیے۔ کنفرم کریں کہ فائر وال رول VPN زون → LAN ٹریفک allow کرتا ہے۔SSL VPN policy check karein: user/group ko sahi resources ki ijazat honi chahiye. Confirm karein ke firewall rule VPN zone → LAN traffic allow karta hai.Check the SSL VPN policy: the user/group must be allowed to the right resources. Also confirm a firewall rule permits VPN zone → LAN traffic.
انٹرویو سوالاتInterview Q&AInterview Q&A
❓ IPsec اور SSL VPN میں فرق کیا ہے؟IPsec aur SSL VPN mein farq kya hai?What is the difference between IPsec and SSL VPN?
IPsec VPN پوری سائٹس (برانچ آفسز) کو مستقل جوڑتا ہے؛ SSL VPN الگ الگ remote یوزرز کو براؤزر یا کلائنٹ سے کہیں سے بھی رسائی دیتا ہے۔ IPsec site-to-site ہے، SSL VPN user-to-site۔IPsec VPN poori sites (branch offices) ko mustaqil jorta hai; SSL VPN alag alag remote users ko browser ya client se kahin se bhi access deta hai. IPsec site-to-site hai, SSL VPN user-to-site.IPsec VPN connects whole sites (branch offices) permanently; SSL VPN gives individual remote users access from anywhere via a browser or client. IPsec is site-to-site, SSL VPN is user-to-site.
❓ IPsec tunnel up نہیں ہو رہا۔ سب سے پہلے کیا چیک کریں گے؟IPsec tunnel up nahi ho raha. Sab se pehle kya check kareinge?An IPsec tunnel will not come up. What do you check first?
لاگ ویوئر میں phase 1/phase 2 errors دیکھیں، ویریفائی کریں کہ pre-shared key دونوں طرف ایک جیسی ہے، اور کنفرم کریں کہ فائر وال رولز VPN ٹریفک اور remote سب نیٹس کو allow کرتے ہیں۔Log viewer mein phase 1/phase 2 errors dekhein, verify karein ke pre-shared key dono taraf ek jaisi hai, aur confirm karein ke firewall rules VPN traffic aur remote subnets ko allow karte hain.Check the log viewer for phase 1/phase 2 errors, verify the pre-shared key matches on both sides, and confirm the firewall rules allow the VPN traffic and the remote subnets.