Tụgharịa gị Pi Pi n'ime ebe ohere ikuku

Wi-Fi-ohere-isi-na-RaspberryPy

En isiokwu gara aga na-ekwu maka DietPi usoro maka Raspberry Pi anyị na mgbakwunye na inwe nnukwu obodo nwere usoro na ọrụ dị iche iche.

Otu n'ime nke ị nwere ike ịtụgharị Raspberry Pi gị n'ime ebe mgbasa ozi, ihe egwuregwu egwuregwu, ihe nkesa NAS na ihe ndị ọzọ.

Ugbu a, anyị ga - ahụ otu esi eji Raspberry Pi anyị dị ka ebe nweta ikuku.

Na-atụgharị Raspberry Pi ka ọ bụrụ ebe nnweta ikuku

Iji mezuo nke a, ọ dị mkpa ịnwe sistemụ arụmọrụ na Rasberi anyị, yabụ sistemụ gọọmentị zuru oke maka ya.

Ihe mbụ anyị ga - eme bụ imelite sistemụ anyị, maka nke a na ọdụ anyị ga - abanye iwu ndị a:

sudo apt-get update
sudo apt-get upgrade

Ozugbo emere nke a, anyị ga - amalitegharịa ngwaọrụ anyị, nke mere na a ga - echekwa mgbanwe ọ bụla emere.

Laghachi na usoro, ka anyị gaba n'ihu wụnye hostapd, dnsmasq na akwa-utils, Ndị a bụ mmemme abụọ anyị ga - eji tụgharịa Raspberry Pi n’ime ebe nnweta ikuku.

Ya mere, ịwụnye ya, mepee ọnụ na ya ka anyị pịnyere iwu ndị a.

sudo apt-get install hostapd
sudo apt-get install dnsmasq
sudo apt-get install bridge-utils

Nhazi

Ozugbo etinyere ihe ndị a, anyị ga-edezi faịlụ nhazi nke mmemme ahụ ka anyị wee kwụsị ọrụ ha na:

sudo systemctl stop hostapd
sudo systemctl stop dnsmasq

Ugbu a, anyị ga-edezi faịlụ na-esonụ:

sudo nano /etc/dhcpcd.conf

Ugbu a ọ dị na faịlụ ahụ, gbakwunye usoro ndị a na njedebe:

interfaz wlan0
static ip_address = 192.168.0.10/24
denyinterfaces eth0
denyinterfaces wlan0

N'ebe a na nke a anyị na-etinye, anyị na-eche na anyị nwere adreesị IP mpagharaE wezụga nke ahụ, ntanetị ntanetị anyị nwere aha nkịtị na ọ nweghị ndị ọzọ.

Mgbe nke ahụ gasịrị, pịa Ctrl + O, wee pịa Ctrl + X iji chekwaa faịlụ ahụ ma pụọ ​​na nchịkọta akụkọ.

Hazi nkesa DHCP (dnsmasq)

Anyị ga-eji dnsmasq dịka sava anyị DHCP. Ebumnuche nke ihe nkesa DHCP bụ iji kesaa nghazi nghazi netwọk n'ụzọ doro anya, dịka adreesị IP, na ihu na ọrụ.

Ka anyị nyegharịa faịlụ nhazi ndabara wee dee nke ọhụrụ:

sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.back
sudo nano /etc/dnsmasq.conf

Na faịlụ ọhụrụ anyị ga - ede ahịrị nhazi ndị a:

interface=wlan0
dhcp-range=192.168.0.11,192.168.0.30,255.255.255.0,24h

Ihe ndị anyị gbakwunyere na-egosi na anyị ga-enye adreesị IP n'etiti 192.168.0.11 na 192.168.0.30 maka interface wlan0. Anyị na-emechi ma chekwaa faịlụ ahụ.

Y ugbu a, anyị ga-emepụta faịlụ nhazi ọhụụ ọzọ, anyị na-eme nke a site na iji kọmputa ede iwu na-esonụ:

sudo nano /etc/hostapd/hostapd.conf

N'ime ya anyị ga-edebe ihe ndị a:

interface=wlan0
bridge=br0
hw_mode=g
channel=5
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
ssid=”Nombre-que-le-daras-a-tu-punto-de-acceso”
wpa_passphrase=”La-contraseña”

Ebe ha ga - edezi ahịrị abụọ gara aga, n'ihi na ebe a ha ga - edebe aha ha ga - enye ha ohere ịbanye yana okwuntughe ha, na - enweghị "".

Ozugbo edited anyị ga-azọpụta na-emechi mgbanwe. Ma ugbu a ka mepee faịlụ na-esonụ:

sudo nano /etc/default/hostapd

Na faịlụ a, chọọ akara na-ekwu # DAEMON_CONF = ”” - wepu nke ahụ # ma tinye ụzọ na faịlụ nhazi anyị na ntinye, yabụ ọ dị ka nke a:

DAEMON_CONF = "/etc/hostapd/hostapd.conf"

Hazie ebugharị okporo ụzọ

Ebumnuche ebe a bụ na mgbe ha jikọtara, a ga-ebufe okporo ụzọ na eriri Ethernet ha. Yabụ, anyị ga-eziga WLAN site na eriri Ethernet na modem gị. Nke a gụnyere idezi faịlụ nhazi ọzọ:

sudo nano /etc/sysctl.conf

Ugbu a chọta akara a:

# net.ipv4.ip_forward = 1

Ma wepu "#", chekwaa na nso file.

Nzọụkwụ ọzọ bụ ịgbakwunye ọchịchị iptables ọhụrụ, wee jiri:

sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"
iptables-restore < /etc/iptables.ipv4.nat

Kwado njikọ ịntanetị

Ugbu a Pip Pi na-eme dị ka ụzọ nnweta na ngwaọrụ ndị ọzọ nwere ike ijikọ. Agbanyeghị, ngwaọrụ ndị ahụ enweghị ike iji Pi iji nweta ịntanetị. Iji mee ka o kwe omume, anyị kwesịrị iwu akwa nke gafere okporo ụzọ niile n’etiti ihu wlan0 na eth0.

Anyị dị njikere ịgbakwunye akwa ọhụrụ (akpọ br0):

sudo brctl addbr br0

Ọzọ, anyị ga-ejikọta interface eth0 na akwa anyị:

sudo brctl addif br0 eth0

N'ikpeazụ, ka anyị dezie ihu faịlụ ahụ ma gbakwunye usoro ndị a na njedebe faịlụ ahụ:

sudo nano /etc/network/interfaces
auto br0
iface br0 inet manual
bridge_ports eth0 wlan0

Anyị reboot anyị Ras Pi na ọ bụ ya.


Ọdịnaya nke isiokwu agbaso ụkpụrụ anyị nke ụkpụrụ nduzi. Kpesa mmejọ pịa ebe a.

Nkwupụta, hapụ nke gị

Hapu okwu gi

Adreesị email gị agaghị bipụtara. Chọrọ ubi na-akara na *

*

*

  1. Rụ ọrụ maka data: Miguel Ángel Gatón
  2. Nzube nke data: Nchịkwa SPAM, njikwa okwu.
  3. Ikike: Nkwenye gị
  4. Nkwurịta okwu nke data: Agaghị agwa ndị ọzọ data ahụ ma ọ bụghị site na iwu.
  5. Nchekwa data: Ebe nchekwa data nke Occentus Networks (EU) kwadoro
  6. Ikike: Oge obula inwere ike igbachi, weghachite ma hichapụ ihe omuma gi.

  1.   Asụsụ Serjiu dijo

    Mgbede na ekele maka ama ahụ.
    Enweela m ike ruo n'ókè "Hazi ebugharị okporo ụzọ" iwu abụọ nke mbụ abụrụla nke ọma mana nke atọ "iptables-restore </etc/iptables.ipv4.nat" emeghị.

    Mgbe nke a gasịrị, agbalịrị m ịga n'ihu na n'isi "Kwado njikọ Internetntanetị" mgbe m mere iwu ahụ "sudo brctl addif br0 eth0" Emechiela m na netwọk na rasperry, cable ma ọ bụ wifi

    Anọgidere m jiri nhazi ndị ọzọ na mpaghara ahụ, ma mgbe ịmalitegharị m ka enweghị netwọk.

    Enwere ike idozi ya ma ọ bụ gbanwee ya?

    Na-ekele ma na-ekele gị nke ukwuu n'ọdịnihu.