Cov txheej txheem:

Ruaj Ntseg Txhua Lub Wifi Nrog VPN - Nkag Mus Siv!: 5 Kauj Ruam
Ruaj Ntseg Txhua Lub Wifi Nrog VPN - Nkag Mus Siv!: 5 Kauj Ruam

Video: Ruaj Ntseg Txhua Lub Wifi Nrog VPN - Nkag Mus Siv!: 5 Kauj Ruam

Video: Ruaj Ntseg Txhua Lub Wifi Nrog VPN - Nkag Mus Siv!: 5 Kauj Ruam
Video: Finance with Python! Net Present Value (NPV) 2024, Hlis ntuj nqeg
Anonim
Ruaj Ntseg Txhua Lub Wifi Nrog VPN - Nkag Mus Rau Qhov Chaw!
Ruaj Ntseg Txhua Lub Wifi Nrog VPN - Nkag Mus Rau Qhov Chaw!

Raws li ntau thiab ntau ntawm peb lub neej raug xa mus rau huab loj hauv ntuj uas yog internet, nws nyuaj dua kom nyob nyab xeeb thiab tsis pub lwm tus paub hauv koj li kev lom zem hauv internet. Txawm hais tias koj tab tom nkag mus rau cov ntaub ntawv rhiab koj xav kom tsis pub lwm tus paub, sim hla kev txwv nyob rau qhov twg lossis yam twg koj tuaj yeem tshawb rau hauv koj lub network, lossis seb koj tsuas xav tau kev nyab xeeb dua kev tshawb nrhiav, cov lus qhia feem ntau kuv hnov kom nyob nyab xeeb hauv is taws nem yog siv Virtual Private Network (lossis VPN luv).

VPN's muab ob qhov kev pabcuam zoo hauv ib pob, hauv qhov uas lawv encrypt tag nrho cov pob ntawv ntawm cov ntaub ntawv uas tau xa los ntawm lawv, thiab lawv ua cov kev pabcuam nyob deb uas nyob ntawm tib lub network zoo li VPN hauv zos rau lub tshuab koj siv txuas. Yog tias kuv tus VPN server nyob hauv Tebchaws Yelemees thiab kuv txuas rau kuv VPN los ntawm lub khoos phis tawj hauv tebchaws Australia, tam sim no kuv lub khoos phis tawj yuav muaj IP chaw nyob los ntawm Lub Tebchaws Yelemees!

Lub ntsiab lus tseem ceeb tshaj nrog cov kev pabcuam VPN nrov tshaj plaws yog, yog tias ntau hom khoom siv nyob rau qhov xwm txheej uas lawv tsis tuaj yeem teeb tsa los siv VPN tus thov kev pabcuam, lossis tsis muaj VPN tus thov muaj rau siv. Yog li peb xav kom peb cov cuab yeej txuas nrog peb VPN, tab sis rau lwm lub tshuab uas tsis tuaj yeem txuas nrog cov neeg siv yooj yim VPN, peb xav kom lawv txuas nrog peb VPN yam tsis paub txawm tias lawv txuas nrog! Nkag mus rau VPN Access Point!

Kauj ruam 1: Cov ntaub ntawv

Khoom siv
Khoom siv

Cov ntaub ntawv rau txoj haujlwm no tsawg, tab sis txhua yam khoom xav tau.

Lwm yam tshaj li koj lub tsev router (uas kuv xav tias koj yuav tsum muaj), koj yuav xav tau

- 1 Raspberry Pi (nyiam dua Raspberry Pi 3 lossis zoo dua, tab sis tsuav nws tuaj yeem txhawb nqa kev sib txuas ethernet nws yuav tsum zoo!)

- 1 Ethernet qaum

- 1 wifi dongle (tshwj tsis yog tias koj siv Raspberry Pi 3, nyob rau hauv rooj plaub twg koj tuaj yeem siv ua hauv wifi)

- 1 5V 2amp fais fab mov rau Raspberry Pi

Kauj Ruam 2: Teeb Wifi Access Point Setup - Ntu 1 - Static IP Address rau Wifi

Teeb Wifi Access Point Teeb - Ntu 1 - IP Chaw Nyob rau Wifi
Teeb Wifi Access Point Teeb - Ntu 1 - IP Chaw Nyob rau Wifi

Ua ntej teeb tsa VPN txuas rau peb Raspberry Pi Access Point, peb yuav tsum teeb tsa Pi li qhov chaw nkag. Txhawm rau ua qhov no, peb yuav siv cov pob hostapd thiab dnsmasq rau Raspberry Pi. Hostapd yog tus neeg siv daemon chaw rau teeb tsa cov ntsiab lus nkag tau yooj yim thiab kev lees paub cov servers, thaum dnsmasq muab cov cuab yeej siv network (DNS, DHCP, network khau raj, thiab lwm yam) rau cov network me thiab routers network me.

Yog li ua ntej pib, nco ntsoov tias koj muaj cov duab huv ntawm Raspbian OS khiav ntawm Pi, nrog rau qhov hloov tshiab kawg tau thov. Koj kuj tseem xav kom paub tseeb tias koj Raspberry Pi txuas nrog koj lub router ntawm kev sib txuas ntawm Ethernet nyuaj, tsis yog wifi! Thaum kawg peb yuav lees txais kev thov txuas los ntawm lwm cov khoom siv los ntawm peb lub wifi module, yog li koj tsis xav txuas nrog koj lub router dhau ntawm tib lub qauv. Yog tias koj siv Raspberry Pi Zero lossis qhov qub ntxiv (uas tsis tau tsim hauv wifi), koj tseem tuaj yeem siv Raspberry Pi, koj tsuas xav tau USB wifi dongle.

Tom qab txuas rau koj li Raspberry Pi (ntawm SSH lossis nrog tus saib xyuas) xyuas tias nws yog qhov tshiab

sudo apt-tau hloov tshiab

sudo apt-tau hloov tshiab

Tom ntej no, koj yuav xav rub tawm thiab teeb tsa hostapd thiab dnsmasq

sudo apt-tau nruab hostapd dnsmasq

Thaum cov pob tau teeb tsa, ob qho haujlwm yuav pib ua haujlwm tau zoo, tab sis peb xav hloov pauv lawv cov teeb tsa ua ntej ua haujlwm. Yog li peb yuav ncav tes mus rau kev tswj hwm qhov system kom nres cov kev pabcuam cuam tshuam nrog cov haujlwm no

sudo systemctl nres hostapd

sudo systemctl nres dnsmasq

Nrog rau cov kev pabcuam tam sim no nres, peb yuav xav muab peb tus kheej tus IP chaw nyob, siv dhcpcd teeb tsa cov ntaub ntawv pom ntawm /etc/dhcpcd.conf

Ua ntej peb ua li ntawd txawm li cas los xij, peb xav kom ntseeg tau tias peb tau hais txog qhov cuam tshuam raug thaum muab IP chaw nyob zoo li qub. Yog tias siv Raspberry Pi 3b lossis Raspberry Pi Zero W, nws yuav tsum tau teev ua wlan0. Yog tias koj siv wifi dongle, Kuv ib txwm pom tias nws yooj yim dua los txuas lub wifi dongle rau lub router, rub tus IP chaw nyob tshiab thiab tom qab ntawd txheeb xyuas koj qhov kev sib txuas kom pom koj lub interface. Koj tuaj yeem tshawb xyuas koj lub interface los ntawm kev ua cov lus txib hauv qab no

ifconfig

Yog tias koj txheeb xyuas daim duab saum toj no txuas rau cov kauj ruam no, koj tuaj yeem pom (rho tawm qhov chaw nyob IP uas tau rov ua dua tshiab) qhov cuam tshuam cuam tshuam rau kuv li Raspberry Pi. Hauv kuv qhov xwm txheej, kuv siv wlan0, tab sis nws nyob ntawm koj teeb tsa. Raws li kuv tau hais ua ntej, yog tias koj siv wifi dongle, txuas rau koj lub network, khiav qhov ifconfig hais kom ua, thiab txawm tias muaj kev cuam tshuam los li cas uas muaj IP chaw nyob siv tau thiab tsis yog "eth0" lossis "lo" yuav yog lub interface koj xav tau siv.

Tam sim no kuv paub qhov kev sib txuas twg yog rau kuv lub wifi adapter, kuv tuaj yeem muab tus IP chaw nyob zoo li nws hauv dhcpcd teeb tsa cov ntaub ntawv! Nqa cov teeb tsa hauv koj tus kws kho mob nyiam (Kuv siv nano).

sudo nano /etc/dhcpcd.conf

Hauv qab ntawm kev teeb tsa, peb xav ntxiv cov kab hauv qab no, tab sis hloov "wlan0" nrog yam koj cuam tshuam yog:

interface wlan0 zoo li qub ip_address = 192.168.220.nohook wpa_supplicant

Qhov lus txib no tau ua yog tsim kom muaj tus ip zoo li qub ntawm 192.168.220.1 thiab tom qab ntawd qhia rau wlan0 interface kom tsis txuas mus rau wpa_supplicant tus tsav tsheb uas feem ntau yog siv rau lub interface txuas rau lwm lub network. Peb ua qhov no kom (thaum kawg) peb tuaj yeem tshaj tawm peb tus kheej lub teeb liab los ntawm wlan0 interface, es txuas mus rau lub network los ntawm kev sib tham no.

Yog tias koj siv nano los ua cov kev hloov pauv no, khaws cov kev hloov pauv los ntawm kev ntaus ctrl+x thiab tom qab ntawd Y thiab tom qab ntawd nkag mus khaws cov ntawv thiab tawm ntawm nano. (Nco ntsoov peb yuav nkag mus thiab tawm ntawm nano me ntsis hauv qhov kev qhia no).

Thaum kawg, rau cov kev hloov pauv no kom siv tau, koj yuav tsum rov pib dua koj Pi, lossis tsuas yog rov pib dua qhov kev pabcuam dhcpcd kom rov ua dua lub teeb tsa thiab siv cov kev hloov no

sudo systemctl rov pib dua dhcpcd

Tos ib pliag, thiab tom qab ntawd khiav ifconfig hais kom rov los tshuaj xyuas thiab pom tias koj qhov kev hloov pauv tau ua tiav. Kuv lees, qee zaum kuv tau sim qhov no thiab kuv lub router tseem muaj daim ntawv cog lus siv tau ntawm tus IP chaw nyob uas kuv tau siv, yog li nws yuav khaws qhov chaw nyob qub. Yog tias qhov no tshwm sim, rov txheeb xyuas txhua yam hauv koj qhov teeb tsa, thiab rov pib dua qhov kev pabcuam dhcpcd dua.

Peb lub adapter wifi (yuav tsum) tam sim no muaj tus IP zoo li qub!

Tom ntej no, hostapd thiab dnsmasq teeb tsa!

Kauj Ruam 3: Teeb Wifi Access Point Setup - Ntu 2 - Hostapd Configuration

Teeb Wifi Access Point Teeb - Tshooj 2 - Hostapd Configuration
Teeb Wifi Access Point Teeb - Tshooj 2 - Hostapd Configuration

Nrog dhcpcd.conf hloov pauv ntawm txoj kev, lub sijhawm kom pib nrog hostapd! Pib tawm los ntawm kev tsim cov ntaub ntawv hostapd.conf tshiab hauv koj cov ntawv nyeem uas kuv nyiam (ib zaug ntxiv hauv nano rau kuv!)

sudo nano /etc/hostapd/hostapd.conf

Thaum koj nqa cov ntaub ntawv teeb tsa, theej cov ntawv hauv qab no thiab muab tshuaj txhuam rau hauv qhov teeb tsa.

interface = wlan0driver = nl80211

hw_mode = g channel = 6 ieee80211n = 1 wmm_enabled = 0 macaddr_acl = 0 tsis quav ntsej_broadcast_ssid = 0

auth_algs = 1 wpa = 2 wpa_key_mgmt = WPA-PSK wpa_pairwise = TKIP rsn_pairwise = CCMP

# Wifi lub npe network thiab tus password koj yuav tsum hloov qhov no ssid = Pi-WifiFoLife # Lub network passphrase wpa_passphrase = Y0uSh0uldCh@ng3M3

Thaum koj tau muab qhov ntawd tso rau hauv nrhiav ntu kawg hauv qab uas muaj "ssid =" thiab "wpa_passphrase =". Nov yog qhov wifi network peb tab tom teeb tsa yuav raug hu thiab tus password yog txuas rau lub network wifi peb tab tom teeb tsa. Yog li SURE hloov qhov no mus rau lwm yam! Koj tau ceeb toom.

Tsis tas li, yog tias koj tab tom siv wifi dongle hloov chaw siv wifi, koj yuav tsum hloov pauv ntu ntu ntu nyob rau sab saum toj ntawm qhov teeb tsa kom phim lub interface rau koj lub wifi dongle. Koj kuj tseem yuav tau hloov tus tsav tsheb, nyob ntawm tus qauv ntawm wifi dongle koj tab tom siv. Rau (feem ntau nthuav dav) cov npe ntawm wifi dongles sib xws, lawv cov tsav tsheb sib xws, thiab nplooj ntawv txhawb nqa, Kuv pom nplooj ntawv no muaj txiaj ntsig heev! Kuj txheeb xyuas nplooj ntawv txhawb nqa rau cov khoom koj siv yog tias koj raug daig. Nco ntsoov, yog tias koj tuaj yeem txuas rau koj lub network ua ntej hauv kev qhia nrog koj lub wifi dongle, nws txhais tau tias yuav tsum muaj tus tsav tsheb ua haujlwm rau lub dongle ntawm koj tus pi qhov chaw !!!

Tam sim no peb muaj peb cov ntaub ntawv teeb tsa tshiab, peb yuav tsum ua kom ntseeg tau tias peb qhia cov txheej txheem hostapd txhawm rau siv cov ntaub ntawv teeb tsa tshiab! pib nrog cov hauv qab no:

sudo nano/etc/default/hostapd

Nrhiav kab hauv kab ntawv peb nyuam qhuav qhib uas nyeem # DAEMON_CONF = "" thiab hloov qhov no los nyeem DAEMON_CONF = "/etc/hostapd/hostapd.conf" (nco ntsoov tias koj tab tom noj # kos npe tawm thaum pib tsis txaus siab rau teb!)

Muaj ib qho ntxiv cov ntaub ntawv teeb tsa rau hostapd uas peb xav tau hloov tshiab. Khiav cov lus txib hauv qab no:

sudo nano /etc/init.d/hostapd

Qhov kev hloov pauv no yuav luag zoo ib yam rau yav dhau los. Nrhiav ntu DAEMON_CONF = thiab hloov nws nrog DAEMON_CONF =/etc/hostapd/hostapd.conf

Tom qab ntawv txuag thiab tawm ntawm cov ntawv ntawd!

Hostapd tam sim no tau teeb tsa!

Kauj ruam 4: DNSMasq Configuration thiab IP Forwarding

DNSMasq Configuration thiab IP Forwarding
DNSMasq Configuration thiab IP Forwarding

Nrog hostapd tam sim no teeb tsa (txawm tias tseem tsis tau ua haujlwm), tam sim no peb tuaj yeem txav mus rau dnsmasq!

Ua ntej dhia nrog kho cov ntaub ntawv teeb tsa, peb tuaj yeem mus tom ntej thiab hloov pauv ib qho ntawm cov ntaub ntawv teeb tsa qub, vim tias peb yuav tsis siv txhua yam uas nyob hauv cov ntaub ntawv teeb tsa tshwj xeeb no.

Ua nrawm mv hais kom ua nrog lub npe tshiab yuav tsum ua qhov dag

sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.old

Tom qab ntawd tsim cov ntaub ntawv teeb tsa tshiab!

sudo nano /etc/dnsmasq.conf

Tsis tau nkag mus rau qhov no, Kuv tsuas yog luam cov hauv qab no thiab muab nws tso rau hauv cov ntawv tshiab

interface = wlan0 # Siv interface wlan0 (lossis xijpeem interface yog koj lub wireless) server = 1.1.1.1 # Cloudfare dhcp-range = 192.168.220.50, 192.168.220.150, 12h # IP ntau thiab sijhawm xauj

Cov kab saum toj kawg nkaus ntawm qhov kev teeb tsa no yog rau lub interface peb tab tom siv tshaj tawm peb lub teeb liab, kab nruab nrab yog rau peb Tus Pabcuam Lub Npe Lub Npe, thiab tom qab ntawv kab hauv qab yog kab IP chaw nyob Pi yuav muab rau cov neeg siv txuas rau pib Wifi. Mus tom ntej thiab khaws cov ntawv no thiab tom qab tawm ntawm nano (lossis vim, lossis xijpeem koj tab tom siv rau kev hloov pauv cov ntaub ntawv).

Tom ntej no, peb yuav tsum teeb tsa systctl.conf teeb tsa cov ntaub ntawv kom xa mus rau txhua qhov kev mus los uas los rau lub wireless txuas mus rau txoj kev los ntawm kev txuas ethernet

sudo nano /etc/sysctl.conf

Sab hauv cov ntaub ntawv teeb tsa no, txhua yam koj yuav tsum ua yog tsis pom zoo kab uas yog #net.ipv4.ip_forward = 1 thiab txuag/tawm ntawm daim ntawv teeb tsa no.

Tam sim no uas peb tau xa mus tom ntej, peb xav teeb tsa NAT (Network Chaw Txhais Lus Txhais) ntawm lub wireless interface (wlan0) thiab ethernet interface (eth0). Qhov no pab txhawm rau xa tag nrho cov tsheb los ntawm wifi hla mus rau ethernet (thiab thaum kawg VPN!) Kev txuas.

Ntxiv txoj cai tshiab rau iptable rau NAT xa mus

sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Txoj cai tam sim no tau teeb tsa, tab sis iptable tau yaug txhua lub sijhawm Raspberry Pi tau rov pib dua, yog li peb yuav tsum khaws txoj cai no kom nws tuaj yeem rov ua dua tshiab txhua lub sijhawm peb Pi rov pib dua.

sudo sh -c "iptables -save> /etc/iptables.ipv4.nat"

Txoj cai tam sim no tau txais kev cawmdim, tabsis peb yuav tsum hloov kho Pi lub zos rc.local teeb tsa cov ntaub ntawv kom ntseeg tau tias nws tau thauj khoom txhua lub sijhawm!

Qhib rc.local cov ntaub ntawv hauv koj tus neeg nyiam tshaj tawm

sudo nano /etc/rc.local

thiab nrhiav ntu uas hais tias tawm 0

Txoj cai saum toj no kab (tsis txhob tshem nws!) Ntxiv cov lus txib hauv qab no uas yuav rov ua dua txoj cai NAT uas peb teeb tsa. Tam sim no nws yuav tsum zoo li no

iptables-restore </etc/iptables.ipv4.nat exit0

Txuag thiab tawm ntawm cov ntaub ntawv no, thiab tam sim no txhua yam ntawm peb cov kev teeb tsa yuav tsum ua tiav rau qhov nkag mus!

Txhua yam peb yuav tsum tau ua yog pib hostapd thiab dnsmasq cov kev pabcuam, thiab rov pib dua peb Raspberry Pi!

sudo kev pabcuam hostapd pib

sudo kev pabcuam dnsmasq pib

Kuaj xyuas kom paub tseeb tias koj tuaj yeem pom koj li AP tshiab. Yog tias txhua yam tau teeb tsa kom raug, tam sim no koj yuav tsum muaj wifi nkag mus tau ntawm koj li Raspberry Pi! Tam sim no rov pib dua pi

sudo rov pib dua

Tom ntej no, teeb tsa kev sib txuas OpenVPN!

Kauj Ruam 5: Qhib VPN thiab teeb tsa VPN Service Provider Configuration

Qhib VPN thiab teeb tsa VPN Service Provider Configuration
Qhib VPN thiab teeb tsa VPN Service Provider Configuration

Tam sim no tias peb Pi tau tshaj tawm wifi, lub sijhawm kom tau qhib openvpn teeb tsa! Peb yuav pib los ntawm kev txhim kho openvpn los ntawm apt-tau nruab

sudo apt -tau nruab openvpn -y

Tom qab openvpn ua tiav kev teeb tsa, peb yuav tsum mus rau qhov chaw uas peb yuav khaws cia peb cov ntaub ntawv pov thawj kev lees paub thiab qhib cov ntaub ntawv openvpn.

cd /thiab /openvpn

Thawj qhov uas peb yuav ua ntawm no (hauv /yam /openvpn) tau teeb tsa cov ntawv sau uas peb yuav khaws peb tus username thiab password rau VPN kev pabcuam uas peb siv.

sudo nano auth.txt cov

Txhua yam peb xav tau yog khaws tus username thiab password rau hauv daim ntawv no, tsis muaj dab tsi ntxiv.

lub npe siv

lo lus zais

Kuv yuav tsum ntxiv qhov ntawd ntawm no, koj yuav tsum muaj lub tswv yim ntawm leej twg koj xav siv los ua VPN kev pabcuam rau koj kev sib txuas. Muaj kev sib cav dav dav txog qhov kev pabcuam twg yog qhov zoo tshaj plaws lossis muaj kev nyab xeeb tshaj plaws, yog li mus ncig ib ncig thiab tshuaj xyuas lawv ib yam nkaus! Txog lub hom phiaj ntawm qhov kev qhia no, Kuv siv Kev Siv Internet ntiag tug (PIA). Lawv pheej yig heev, thiab tau lees paub ib puag ncig kom ntseeg tau zoo! Koj tseem tuaj yeem teeb tsa koj li VPN kom xaus rau hauv thaj tsam loj hauv ntiaj teb! Canada? Russia? Nyiv? Tsis muaj teeb meem!

Yog tias koj siv Internet Is Taws Nem Ntiag Tug, lawv kuj tseem muaj qhov yooj yim ntawm lawv qhov chaw, qhov twg koj tuaj yeem tso ua ke hom openvpn teeb tsa cov ntaub ntawv uas koj tuaj yeem siv hauv kev teeb tsa no! Muaj lwm hom openvpn teeb tsa koj tuaj yeem siv nrog lwm tus muab kev pabcuam, tab sis kuv txiav txim siab xaiv qhov no.

Qhov kev pabcuam twg los xij uas koj xaiv tuaj tos, koj xav tau cov ntaub ntawv qhib openvpn (yuav tsum xaus rau.ovpn rau hom ntawv) los ntawm cov chaw muab kev pabcuam ntawd thiaj li txuas tau. Txhawm rau kom yooj yim, Kuv tau hloov kuv li "connectionprofile.ovpn" ua ntej thauj nws mus rau kuv li Raspberry Pi. Thaum koj rub tawm.ovpn cov ntaub ntawv ntawm Pi, lossis hloov nws mus rau Pi, xyuas kom cov ntaub ntawv nyob hauv /etc /openvpn ntawm koj Pi.

Tom qab txav qhib vpn cov ntaub ntawv mus rau qhov tseeb nplaub tshev, peb tom qab ntawd yuav tsum hloov pauv cov ntaub ntawv vim tias openvpn cia siab tias yuav teeb tsa cov ntawv uas xaus rau hauv.conf hloov ntawm.ovpn. Thaum kuv tau ua qhov no, kuv tseem xav khaws cov ntawv qub kom zoo, tsuas yog muaj ib yam dab tsi lom zem tshwm sim, yog li kuv tsuas yog siv cov lus txib cp (txij li koj nyob hauv /etc /openvpn, koj yuav tsum tau siv sudo tso cai los khiav. cov lus txib no)

sudo cp /etc/openvpn/connectionprofile.ovpn /etc/openvpn/connectionprofile.conf

Nrog rau openvpn profile teeb tsa tsim, peb yuav tsum hloov pauv sai los muab peb cov ntaub ntawv pov thawj, yog li lub sijhawm kom tawg tawm nano dua!

sudo nano /etc/openvpn/connectionprofile.conf

Koj yuav xav nrhiav kab auth-user-pass thiab hloov qhov ntawd nrog auth-user-pass auth.txt

Qhov no qhia openvpn txhawm rau khaws cov ntaub ntawv pov thawj uas peb tau siv ua ntej los siv thaum txheeb xyuas qhov profile uas peb muab.

Txuag thiab tawm ntawm cov ntaub ntawv teeb tsa profile!

Qhov ntawd yuav tsum yog txhua yam rau VPN teeb tsa, tab sis peb yuav xav sim tias txhua yam ntawm peb kev teeb tsa tau teeb tsa kom raug ua ntej teeb tsa VPN cov kev pabcuam kom pib ua haujlwm. Khiav cov lus txib hauv qab no txhawm rau sim VPN txuas

sudo openvpn --config "/etc/openvpn/connectionprofile.conf"

Koj yuav tsum pom ib pawg ntawm cov ntawv nqes mus raws li Pi ua rau kev sib txuas mus rau VPN Tus Muab Kev Pabcuam (vam tias tsis muaj lus yuam kev!) Yog tias koj pom qhov ntawd, nws txhais tau tias koj Pi txuas nrog koj li VPN Tus Muab Kev Pabcuam! Koj tuaj yeem mus tom ntej thiab tua tus txheej txheem los ntawm kev ntaus ctrl + c hauv lub qhov rai qhov rai.

Tam sim no tias VPN ua haujlwm, peb yuav tsum tshem tawm cov iptables tam sim no. Peb tuaj yeem ua tiav qhov ntawd nrog peb cov lus txib hauv qab no

sudo iptables -Fsudo iptables -t nat -F sudo iptables -X

Txij li thaum peb yaug tawm cov iptables txawm li cas los xij, peb yuav tsum rov pib dua txoj cai nat peb tau tsim ua ntej hauv qhov kev qhia no los ntawm kev ua cov lus txib hauv qab no (cov lus txib no yuav tsum zoo li paub!)

sudo iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE

Tam sim no peb tuaj yeem txuag qhov teeb tsa no dhau ntawm kev teeb tsa yav dhau los uas peb muab tso ua ke rov qab rau hauv cov kauj ruam dhau los. (cov lus txib no yuav tsum zoo li paub!)

sudo sh -c "iptables -save> /etc/iptables.ipv4.nat"

Tam sim no uas peb muaj NAT cov cai tau teeb tsa rov qab, peb yuav tsum hloov kho lub neej ntawd rau openvpn kom siv cov ntaub ntawv uas peb teeb tsa. Peb ua qhov no los ntawm kev kho cov ntawv teeb tsa hauv/etc/default/openvpn

sudo nano/etc/default/openvpn

Nrhiav kab ntawv uas hais tias #autostart = "tag nrho", tsis pom zoo rau kab no, thiab hloov nws mus rau lub npe ntawm koj openvpn teeb tsa cov ntaub ntawv (rho tawm qhov.conf tau kawg!) Yog li hauv kuv qhov xwm txheej, kuv hloov kab rau autostart = " profile kev twb kev txuas"

thiab tom qab ntawd txuag thiab tawm ntawm cov ntaub ntawv teeb tsa no!

Qhov ntawd yuav tsum yog txhua yam rau VPN teeb tsa! Tsuas yog rov pib Pi, thiab txheeb xyuas tias txhua yam ua haujlwm los ntawm kev txuas mus rau lub hotspot thiab txheeb xyuas koj tus IPaddress los ntawm lub xaib xws li whatismyip.com.

Nrog rau kev teeb tsa no, muaj qhov ua tau tias koj lub router IP chaw nyob tuaj yeem xau dhau los ntawm DNS xau. Peb tuaj yeem kho qhov no los ntawm kev hloov DNS peb siv hauv dhcpcd.conf cov ntaub ntawv txhawm rau taw tes ntawm qhov kev pabcuam DNS sab nraud, xws li Cloudflare!

Qhib cov ntaub ntawv dhcpcd.conf hauv qhov koj nyiam tshaj:

sudo nano /etc/dhcpcd.conf

Nrhiav kab hauv kab teeb tsa #static domain_name_servers = 192.168.0.1, tsis suav nrog kab, thiab hloov nws mus rau hauv qab no: zoo li qub domain_name_servers = 1.1.1.1 thiab txuag/tawm ntawm cov ntaub ntawv teeb tsa. Pib dua Pi ib zaug ntxiv, thiab tam sim no koj tuaj yeem tshawb xyuas ob zaug tias koj lub router IP chaw nyob tsis tau xau los ntawm ipleak.net.

Lwm qhov yuav tsum paub txog yog koj tus router IP chaw nyob tej zaum yuav raug xau los ntawm WebRTC. WebRTC yog lub platform uas siv los ntawm txhua tus browser niaj hnub no kom ua tau zoo dua kev sib txuas lus suav nrog kev xa xov tam sim, kev sib tham hauv video, thiab tshaj tawm suab thiab yees duab. Ib qho khoom lag luam ntawm lub platform no yog tias yog tsis tso tseg, nws tuaj yeem xau koj lub router tus IP chaw nyob yog tias koj txuas nrog VPN. Txoj hauv kev yooj yim tshaj plaws uas koj tuaj yeem tiv thaiv qhov no los ntawm kev siv browser txuas ntxiv lossis plugins, xws li webrtc-xau-tiv thaiv.

Nrog txhua yam teeb tsa ntawm koj tus pi tam sim no, yog tias koj xav kom ntseeg tau tias tag nrho koj cov kev lag luam hauv is taws nem, koj tuaj yeem txuas rau qhov hotspot no, thiab tag nrho koj cov kev mus los yuav raug encrypted los ntawm VPN!

Vam tias koj txaus siab rau kuv Cov Lus Qhia, tam sim no muaj kev nyab xeeb txhua lub wifi !!

Pom zoo: