Ukucushwa Kwenethiwekhi Nokuphathwa - Amanethiwekhi we-SME

Sanibonani bangani nabangane!

Inkomba ejwayelekile yochungechunge: Ama-Computer Networks ama-SME: Isingeniso

Asikakunikezeli i-athikili esihlokweni esivela esihlokweni salesi. Futhi asikaze sifunde noma yikuphi ukuphawula okucela ukubhala ngakho. Besikuthatha kancane ukuthi kwaziwa yibo bonke futhi mhlawumbe bekuyisizathu sokuthi sikushaye indiva kuze kube namuhla. Kodwa-ke, sizobhala okufingqiwe ngakho mayelana nalabo abadinga ukuqala kabusha noma ukufunda ngale ndaba.

Inethiwekhi: incazelo esebenzayo

Ngezinhloso ezisebenzayo, eyodwa Sekukonke - Network Iqukethe amadivayisi wenethiwekhi amabili noma ngaphezulu njengamakhompyutha, amaseva, amaphrinta, omakhalekhukhwini, noma enye imishini yenethiwekhi, exhunywe ngezintambo ezibonakalayo noma izixhumanisi ezingenazintambo ngenhloso yokwabelana nokusabalalisa ulwazi phakathi kwamadivayisi axhunyiwe.

Ngeminye imininingwane vakashela:

Khumbula ukuthi izixhumanisi zinikezwa ngenhloso ephelele hhayi ngenjabulo. 😉

Izilungiselelo zenethiwekhi

  • Ngincoma kulabo abasebenzisa izinhlelo zokusebenza CentOS y vulaSUSE, uqondiswe ngumbhalo Ukucushwa Kweseva Nge-GNU / Linux, ngumbhali uJoel Barrios Dueñas. Kunzima kimi ukubhala izihloko esizobhekana nazo ngezansi ukusatshalaliswa kwe-Debian, CentOS kanye ne-openSUSE ku-athikili efanayo, ngoba lezi zokugcina ezimbili zihlukile kwezokuqala ikakhulukazi ngamagama, indawo yamafayela wokumisa, okuqukethwe kwawo, nokunye ezinye izici zefilosofi ezihlobene nesihloko.

Izinhlelo zokusebenza esizisebenzisayo kulo lonke lolu chungechunge zinamathuluzi wokuqhafaza wokulungisa amadivayisi wenethiwekhi ahlukile. Noma kunjalo, lokhu okuthunyelwe kuzogxila ekusebenziseni ikhonsoli yomyalo noma i-terminal.

Njengoba sibonile kuma-athikili adlule, ezimweni eziningi silungiselela i-interface yenethiwekhi -noma i-interface- ngesikhathi senqubo yokufaka ukuqinisekisa ukuthi, uma uhlelo olusebenzayo lusetshenzisiwe, ikhompyutha inokuxhumeka kahle kwenetha.

Ukucushwa okulungile kokungenani kwesixhumi esibonakalayo senethiwekhi yokuqala -main- kubalulekile emsebenzini olandelayo we Ideskithophu, Indawo yokusebenza, noma Iseva esikusebenzisayo.

Ngeke sisebenzise i-NetworkManager

Ukwenza kube lula ukubhala kwalesi sihloko, gxila ekucushweni kweseva, futhi ukwenze kube lula ukufunda, sizokucabanga ukuthi cha insizakalo enikezwe yiphakheji iyasetshenziswa umphathi wenethiwekhi. Ngaphandle kwalokho kufanele senze lezi zenzo ezilandelayo:

KuDebian

buzz @ sysadmin: ~ $ sudo systemctl misa inethiwekhi-manager.service
buzz @ sysadmin: ~ $ sudo systemctl isimo senethiwekhi-umphathi.service
buzz @ sysadmin: ~ $ sudo systemctl khubaza inethiwekhi-manager.service
buzz @ sysadmin: ~ $ sudo ifconfig

Uma ukumiswa kwamakhadi enethiwekhi ancike kusevisi umphathi wenethiwekhi zilungile, lapho-ke singaqhubeka nokusebenza. Kodwa-ke, kunempilo ukwenza:

buzz @ sysadmin: ~ $ sudo ifdown eth0 && sudo ifup eth0

ukubheka kabili ukuthi konke kusebenza kahle.

Ku-CentOS

Encwadini ngefomethi ye-PDF «Ukucushwa Kweseva Nge-GNU / Linux«, Julayi 2016 Edition, isahluko 48.2.2 sinikezelwe esihlokweni senkonzo InethiwekhiManager. Ngicabanga ukuthi umbhali wayo, uJoel Barrios Dueñas, akathandi nhlobo - ukubheka njengokungenangqondo - ukusetshenziswa InethiwekhiManager kumaSeva.

Ukuhlangana kwe-Ethernet

Njengomthetho ojwayelekile, lapho sisebenza ngemishini ebonakalayo ku I-Qemu-KVM, uhlelo lokusebenza lukhomba i-Ethernet Interfaces enamagama anjenge i-ethX, lapho i- X imele inani lezinombolo. I-interface yokuqala ye-Ethernet ikhonjwa njenge-eth0, eyesibili njenge-eth1, njalonjalo.

Endabeni yezinhlelo zokusebenza ze-Debian -izinto eziphuma- ezisebenza ngemishini ebonakalayo, ukubhalwa okungenhla nakho kuyiqiniso.

Uma sisebenza kumishini ebonakalayo nezinhlelo ezisebenzayo CentOS y vulaSUSE, uhlelo olusebenzayo lubakhomba njenge- I-enoX. Ukufana okuningi kungenzeka ngemishini ebonakalayo - nalezi zinhlelo ezisebenzayo- kuma-hypervisors we VMware.

Kumishini ebonakalayo eyenziwe ohlelweni lokusebenza I-FreeBSD -iyo futhi eyiSoftware yamahhala- ngokuvamile ikhonjwa njenge emX o vtnetX kuya ngokuthi zikwiQemu-KVM noma kuVMware ngokulandelana. Uma zingokomzimba zikhonjwa njenge emX.

Khomba ukuhlangana kwe-Ethernet

Ukukhomba zonke izixhumi zenethiwekhi ezitholakalayo kwikhompyutha yami sysadmin.fromlinux.fan, senza:

buzz @ sysadmin: ~ $ sudo ifconfig -a
i-eth0 Link encap: Ethernet HWaddr 70: 54: d2: 19: ad: 65 inet addr: 10.10.10.1 Bcast: 10.10.10.255 Mask: 255.255.255.0 inet6 addr: fe80 :: 7254: d2ff: fe19: ad65 / 64 Ububanzi: Xhumanisa ... bheka Isixhumanisi se-Link: Local Loopback inet addr: 127.0.0.1 Mask: 255.0.0.0 inet6 addr: :: 1/128 Scope: Host ... virbr0 Link encap: Ethernet HWaddr 52: 54: 00: c8: 35 : 5e inet addr: 192.168.10.1 Bcast: 192.168.10.255 Mask: 255.255.255.0 inet6 addr: fe80 :: 5054: ff: fec8: 355e / 64 Scope: Link ... virbr0-nic Link encap: Ethernet HWaddr 52:54 00: c8: 35: 5e BROADCAST MULTICAST MTU: 1500 Metric: 1 ... vmnet8 Link encap: Ethernet HWaddr 00: 50: 56: c0: 00: 08 inet addr: 192.168.20.1 Bcast: 192.168.20.255 Mask: 255.255.255.0 .6 inet80 addr: fe250 :: 56: 0ff: fec8: 64/XNUMX Ububanzi: Xhumanisa ...
  • Ama-ellipsis amathathu kwimiphumela eyedlule kusho ukuthi kubuyiselwa imininingwane eminingi kakhulu esingakhombisi ukuyonga isikhala.

Njengoba ngifake ohlelweni lokusebenza lwe-Debian 8 "Jessie" izinhlelo ezimbili zokwesekwa komshini, okungukuthi, I-Qemu-KVM y I-VMware Workstation Server 10.0.6, umyalo ubuyisa zonke izixhumi ezikhona.

  • Kwirekhodi: isoftware yangasese i-VMware Workstation Server 10.0.6 yikhophi elisemthethweni elinikezwe umngani wami nozakwethu u-El NeoZelandes, owalithola nge-Intanethi ezweni lakubo futhi wayenomusa ngokwanele ukuba angithumele lona.

Ake sibone ukuthi yiluphi ulwazi esingaluthola kokukhiphayo kwangaphambilini:

  • eth0: Isixhumi esibonakalayo senethiwekhi esinekheli le-IPv4 10.10.10.1. Ikheli le-IPv6 nalo liyakhonjiswa.
  • lo: Ukubuyela emuva noma wendawo nge-IPv4 127.0.0.1 ne-IPv6 -jwayelekile kuzo zonke lezi zinhlaka- :: 1/128.
  • sibis0: Isixhumi esibonakalayo sohlobo lwenethiwekhi -  Bridge nge-IPv4 192.168.10.1 nekheli MAC 52:54:00:c8:35:5e. Lesi sikhombimsebenzisi esibonakalayo yilokho esikudalayo nesikulungiselelayo nge- Umphathi we-Virt weQemu-KVM njengenethiwekhi «ezenzakalelayo»Ohlobo lwe-NAT.
  • i-virbr0-nicIsixhumi esibonakalayo senethiwekhi esakha ifayela le- I-Qemu-KVM, yohlobo Anonymous Bridge- Anonymous bridge nangekheli elifanayo MAC 52:54:00:c8:35:5e que sibis0. Ayinayo ikheli le-IP elinikeziwe.
  • vmnet8Uhlobo lwenethiwekhi I-NAT amisiwe kufayela le- VMware Isihleli Senethiwekhi Esibonakalayo.

El Isiphakeli se-VMware Workstation ngeyakhe Isihleli Senethiwekhi Esibonakalayo, lungiselela ngokuhlukile amabhuloho owakhayo ngensiza ngayinye ye-Host - Host. Ngabe i-jargon isetshenziswe ku izindatshana ezedlule?.

Olunye uhlelo lokusebenza - hhayi ukuphela noma lokugcina - ukuthola imininingwane mayelana nokuhlangana kwenethiwekhi lshw - Uhlu lwehadiwe. lshw iyithuluzi elikhipha imininingwane eningiliziwe mayelana nokulungiswa komshini. Uma sigijima kukhonsoli:

buzz @ sysadmin: ~ $ aptitude search lshw
p lshw - imininingwane mayelana nokumiswa kwehadiwe  
p lshw-gtk - imininingwane yokuqhafaza mayelana nokumiswa kwehadiwe

Siyabona ukuthi inesibonisi sayo sokuqhafaza esikushiya usivivinye. Masifake imodi yekhonsoli bese sigijima ngokulandelayo:

buzz @ sysadmin: ~ $ sudo lshw -class network
[sudo] iphasiwedi ye-buzz:
  * -inethiwekhi               
       incazelo: Umkhiqizo wesixhumi se-Ethernet: 82579V Gigabit Network Connection vendor: Intel Corporation physical id: 19 bus info: pci @ 0000: 00: 19.0 name logical: eth0 version: 05 serial: 70: 54: d2: 19: ad: 65 size: Amandla we-100Mbit / s: 1Gbit / s wide: 32 bits clock: 33MHz amakhono: pm msi bus_master ...
  * -i-network ikhubazekile
       incazelo: I-interface ye-Ethernet i-id ebonakalayo: 1 igama elinengqondo: i-serial ye-virbr0-nic: 52: 54: 00: c8: 35: 5e usayizi: amandla we-10Mbit / s: i-ethernet ebonakalayo

Ake siphathe amagama anengqondo we-interface

Kwezinye izikhathi, ikakhulukazi lapho sishintsha ikhadi lenethiwekhi ngokomzimba nganoma yisiphi isizathu, siyabona ukuthi lelo nani X ekhomba i-interface inyuswe ngo-1 futhi siyibona kuphela lapho sigijima ifconfig -a, phakathi la isimo okwenzekile ngemuva koshintsho. Kungenzeka futhi lapho sisusa isikhombimsebenzisi esibonakalayo senethiwekhi nganoma yisiphi isizathu, bese sengeza esinye futhi.

Lokhu okungenhla kungacasula lapho silungiselele futhi saxhuma - bopha kusevisi eyodwa noma eziningi, igama elithile elinengqondo lesikhombimsebenzisi, kungaba njalo eth0, ethi1 o em0. Into engafanele kakhulu ukuthi cishe kwenzeka njalo ngemuva kweminyaka - mhlawumbe - kusukela ekucushweni kokuqala. Bese kuvela izindawo ezintsha ezinamagama afana nalawa eth1,eth2, ethi2, em1, njll., Futhi ezinye izinsizakalo ziyeka ukusebenza kahle. Labo abadlule kokufanayo izimo Uyazo ukuthi ngisho ukuthini 😉

Amagama anengqondo ezinhlelo zokuxhumana zenethiwekhi ku-Debian - nokunye kokunye kwawo - angatholakala kufayela /etc/udev/rules.d/70-persistent-net.rules. Ku-CentOS 7 kufayela /etc/udev/rules.d/90-eno-fix.rules, kanti ezinguqulweni zayo zangaphambilini liyifayela elifanayo nele-Debian.

KuDebianUma ufuna ukushintsha igama elinengqondo le-interface ethile yenethiwekhi, thola umugqa ohambelana nekheli lawo I-MAC futhi uguqule inani IGAMA = i-ethX nganoma yiliphi inani legama elinengqondo olidingayo. Ukuze ushintsho luphumelele, kufanele uqale kabusha ikhompyutha yakho.

OkweCentOS 7, bheka umsebenzi «Ukucushwa Kweseva Nge-GNU / Linux»NgoJoel Barrios Dueñas, lapho kunikezwa khona indlela eningiliziwe.

  • Kubalulekile: Noma kunjalo, Qaphela! Ngensizakalo InethiwekhiManager uma kwenzeka uphatha ukuxhumana.

Shintsha imingcele yezindawo zokuxhumana zenethiwekhi

KuDebian, uma sifuna ukuguqula imingcele yekhadi lenethiwekhi unomphela, kufanele sihlele ifayili / njll / inethiwekhi / ukuxhumana njengoba kuxoxiwe ngezansi.

Ukwazi ngokuningiliziwe-nokuningi- zonke izinketho ongazisebenzisa thintana ukuhlangana komuntu. Sincoma futhi ukufunda imibhalo ekhona kufolda:

buzz @ sysadmin: ~ $ ls -l / usr / share / doc / ifupdown /
ingqikithi ye-44 drwxr-xr-x 2 impande impande 4096 Aug 7 2016 umphumela
drwxr-xr-x 2 impande impande 4096 Aug 7 2016 izibonelo
-rw-r-r-- 1 impande impande 976 Jun 21 2012 copyright -rw-r - r-- 1 impande impande 18243 13 Mar 2015 1 changelog.gz -rw-r - r-- 297 impande 21 Jun 2012 1 IZINDABA.Debian.gz -rw-r - r-- 454 impande impande 29 Nov 2014 1 README -rw-r - r-- 946 impande 21 Jun 2012 XNUMX BONKE

Uhlelo i-ethtool

Ngohlelo i-ethtool Singabonisana, sibhale futhi siguqule imingcele yekhadi lenethiwekhi njengejubane lokuxhuma, ukuxoxisana okuzenzakalelayo, isamba sokuhlola umthwalo - isaphulelo semali ekhishwayo, njll. Itholakala ezinqolobaneni cishe zazo zonke izimpahla.

buzz @ sysadmin: ~ $ sudo ukufaneleka ukufaka i-ethtool
[sudo] iphasiwedi ye-buzz:

buzz @ sysadmin: ~ $ sudo ethtool eth0
Amasethingi we-eth0: Amachweba asekelwayo: [TP] Izindlela zokuxhumanisa ezisekelwayo: 10baseT / Half 10baseT / Full 100baseT / Half 100baseT / Full 1000baseT / Full Supported pause use use: No Support auto-negotiation: Yes Advertised modes link: 10baseT / Half 10baseT / Ukusetshenziswa okuphelele kwe-100baseT / Isigamu se-100baseT / Okugcwele kwe-1000baseT / Okugcwele Okukhangisiwe: Akukho ukuxoxisana okuzenzakalelayo okukhangisiwe: Yebo Isivinini: I-100Mb / s I-Duplex: I-Port Egcwele: I-Pair Esontekile PHYAD: I-1 Transceiver: Ukuxoxisana okuzenzakalelayo kwangaphakathi: ku-MDI-X: ku (auto) Isekela i-Wake-on: pumbg Wake-on: g Izinga lomyalezo lamanje: 0x00000007 (7) isixhumanisi sephenyo le-drv Isixhumanisi sitholakele: yebo

Izinguquko esizenzayo sisebenzisa leli thuluzi ezesikhashana futhi zizolahleka ekuqaleni kabusha kwekhompyutha. Uma sidinga ukulungiswa okungapheli okwenziwe nge- i-ethtool, kufanele sengeze kufayela / njll / inethiwekhi / ukuxhumana isiqondisi «pre-up"Noma" ngaphambi kokuphakamisa i-interface "ngokulandelayo:

auto eth1
i-ethace eth1 inet dhcp
pre-up / sbin / ethtool -s eth1 isivinini 1000 duplex egcwele

Ngakho ikhadi lenethiwekhi eth1 ethola ikheli layo le-IP kuseva ye-DHCP, iguqulwa unomphela ukuze isebenze ngejubane le-1000 Mb / s kumodi I-Duplex Egcwele.

  • Le ndlela engenhla iyasebenza futhi kumakhadi ane-static IPs.

Ikheli le-IP

Sizobona ngezansi ukuthi singalilungisa kanjani ikheli le-IP lemishini, kanye nesango - gateway ngokuzenzakalela, kuyadingeka ekuxhumaneni nayo yonke inethiwekhi yendawo futhi ngqo nge-inthanethi ngokusebenzisa su gateway.

  • Lapho sibhala "ngqo»Sibhekisa ezimweni zamanethiwekhi we-SME lapho ukufinyelela kwe-Intanethi kuvunyelwe ngaphandle kokusebenzisa iseva Ummeleli, okuyiyo Akunconywa, yize kukhona enamandla firewall kukhompyutha uqobo esebenza njenge Gateway. Uma kufika ithuba lakho sizothinta leyo ndaba Ummeleli.

Ikheli lesikhashana

Kusetshenziswa imiyalo ejwayelekile yanoma ikuphi ukusatshalaliswa kwe-Linux njenge ip, ifconfig nomzila, singakwazi ukumisa isikhombimsebenzisi senethiwekhi okwesikhashana njengoba sizobona ngezansi.

Ukwabela ikheli le-IP nemaski yalo ye-subnet bese uhlola ukusebenza, ake sisebenzise:

buzz @ sysadmin: ~ $ sudo ifconfig eth0 172.16.10.2 netmask 255.255.0.0
buzz @ sysadmin: ~ $ sudo ifconfig
i-eth0 Link encap: Ethernet HWaddr 70: 54: d2: 19: ad: 65 inet addr: 172.16.10.2 Bcast: 172.16.255.255 Mask: 255.255.0.0 inet6 addr: fe80 :: 7254: d2ff: fe19: ad65 / 64 Ububanzi: Xhumanisa i-BROADCAST RUNNING MULTICAST MTU: I-1500 Metric: amaphakethe we-1 RX: amaphutha ama-0: i-0 yehlisiwe: i-0 idlula: ifreyimu engu-0: amaphakethe ama-0 we-TX: amaphutha angama-659: i-0 yehlile: i-0 idlula: i-carrier engu-0: ukushayisana kwe-0: i-0 txqueuelen: i-1000 RX amabhayithi: 0 (0.0 B) ama-TX amabhayithi: 115601 (112.8 KiB) Ukuphazanyiswa: Imemori engama-20: fe600000-fe620000

Simane sabela ikhadi okwesikhashana eth0 ikheli le-IP elimile 172.16.10.2 ngesifihla se-subnet 255.255.0.0 okuqondene ne-Class «B» Private Internet Network.

  • Qaphela ukuthi siguqule ukucushwa kwesixhumi esibonakalayo senethiwekhi sekhompiyutha ye- sysadmin.fromlinux.fan, ebikade ine-IP 0/255.255.255.0 eye-Class "A" Private Internet Network, noma ingabamba kuphela amakhompyutha angama-254 ngokuya ngesifihla-buso sayo se-subnet.

Ukulungiselela i Gateway ngokuzenzakalela bese ubheka ukusebenza masenze:

buzz @ sysadmin: ~ $ sudo umzila wengeza okuzenzakalelayo gw 172.16.10.1 eth0

buzz @ sysadmin: ~ $ sudo umzila -n
Itafula lomzila we-Kernel IP Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 172.16.10.1 0.0.0.0 UG 0 0 0 eth0 0.0.0.0 172.16.10.1 0.0.0.0 UG 1024 0 0 eth0 172.16.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0 192.168.10.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet8 192.168.20.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0

Simane sabela iGateway okwesikhashana 172.16.10.1 ukusebenzisana ne-eth0 172.16.10.2, ngenkathi ezinye izixhumi nendawo zigcina amanani azo wangaphambilini.

Ukususa ZONKE izilungiselelo kusuka ekhadini lenethiwekhi, ake siqhubeke:

buzz @ sysadmin: ~ $ sudo ip addr flush eth0

buzz @ sysadmin: ~ $ sudo ifconfig
I-eth0 Link encap: Ethernet HWaddr 70: 54: d2: 19: ad: 65 UP BROADCAST RUNNING MULTICAST MTU: 1500 Metric: 1 pack RX: 0 error: 0 dropped: 0 overruns: 0 frame: 0 TX packets: 718 errors: 0 0 drop: 0 overruns: 0 carrier: 0 collisions: 1000 txqueuelen: 0 RX bytes: 0.0 (125388 B) TX bytes: 122.4 (20 KiB) Ukuphazanyiswa: Imemori engama-600000: fe620000-feXNUMX

buzz @ sysadmin: ~ $ sudo umzila -n
Ithebula lomzila weKernel IP Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.10.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet8 192.168.20.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
  • Ake sibheke kahle, ngoba sisusa KONKE ukucushwa kwenethiwekhi kwangaphambilini ngisho nalokhu okumenyezelwe kufayela le- / etc / network / interfaces!.

Ukubuyisa umhlaba ngendlela owawuyiyo ngaphambi kokuthi siqale kabusha ikhompyutha. Uma singafuni ukuyeka ukusebenza, ake sigijime:

buzz @ sysadmin: ~ $ sudo ifconfig eth0 10.10.10.1 netmask 255.255.255.0

buzz @ sysadmin: ~ $ sudo ifconfig eth0
i-eth0 Link encap: Ethernet HWaddr 70: 54: d2: 19: ad: 65 inet addr: 10.10.10.1 Bcast: 10.10.10.255 Mask: 255.255.255.0 UP UP BROADCAST RUNNING MULTICAST MTU: 1500 Metric: 1 RX amaphakethe: 0 amaphutha: 0 amaphutha: 0 drop: 0 overruns: 0 frame: 729 TX packets: 0 error: 0 dropped: 0 overruns: 0 carrier: 0 collisions: 1000 txqueuelen: 0 RX bytes: 0.0 (129009 B) TX bytes: 125.9 (20 KiB) Ukuphazanyiswa: 600000 Imemori: fe620000-feXNUMX

buzz @ sysadmin: ~ $ sudo umzila -n
Ithebula lomzila weKernel IP Destination Gateway Genmask Flags Metric Ref Use Iface 10.10.10.0 0.0.0.0 255.255.255.0 U 0 0 eth0 0 192.168.10.0 0.0.0.0 U 255.255.255.0 0 0 vmnet0 8 192.168.20.0 0.0.0.0 U 255.255.255.0 0 0 virbr0

ngakho-ke sibuyela ekucushweni kwasekuqaleni.

Ikheli lesikhashana lisebenzisa umyalo we-ip

Ezikhathini eziningi sihamba neLaptop - Laptop kwenye iNethiwekhi ye-SME ecele izinsiza zethu noma usizo futhi asifuni ukuguqula ukumiswa okujwayelekile kokusebenziseka kwenethiwekhi. Ukufeza lokhu singasebenzisa umyalo ip.

Umyalo ip ukufakwa nge package ipro, noma imv2 ngokuya ngokusatshalaliswa nenguqulo. Ku-Debian 6 "Cindezela" -ngokombono wethu uqobo- amakhasi womuntu womyalo ip zazicacisa kakhulu ngokwesibonelo, uW Wheezy noJessie. ip uma iqhubeka nokusetshenziselwa ukukhombisa, noma ukusebenzisa umzila - ukuhamba, amadivayisi, izinqubomgomo zomzila nemigudu.

Ungahlola amakhasi endoda ukuthola inguqulo efakiwe usebenzisa i- indoda ip.

Ngiyisebenzise kuphela ukwabela elinye ikheli le-IP elihambelana ne-subnet yenye inkampani ye-SME LAN. Isibonelo, ake sinikeze ikheli le-IP 192.168.1.250 ngaphezu kwaleyo osunayo futhi eyiyo 10.10.10.1 ekhadini lenethiwekhi yekhompyutha yami:

buzz @ sysadmin: ~ $ ip addr show eth0
2: eth0: umuntu 1500 qdisc pfifo_fast state UP group default qlen 1000 link / ether 70: 54: d2: 19: ad: 65 brd ff: ff: ff: ff: ff: ff
    inet 10.10.10.1/24 brd 10.10.10.255 ububanzi global eth0
       I-valid_lft uncamela unomphela_lft unomphela inet6 fe80 :: 7254: d2ff: fe19: ad65 / 64 scope link valid_lft forever preferred_lft forever

buzz @ sysadmin: ~ $ sudo ip addr engeza 192.168.1.250/24 ukusakaza 192.168.1.255 dev eth0

buzz @ sysadmin: ~ $ ip addr show eth0
2: eth0: umuntu 1500 qdisc pfifo_fast state UP group default qlen 1000 link / ether 70: 54: d2: 19: ad: 65 brd ff: ff: ff: ff: ff: ff
    inet 10.10.10.1/24 brd 10.10.10.255 ububanzi global eth0
       i-valid_lft uncanyelwa unomphela_lft ingunaphakade
    inet 192.168.1.250/24 brd 192.168.1.255 ububanzi global eth0
       I-valid_lft uncamela unomphela_lft unomphela inet6 fe80 :: 7254: d2ff: fe19: ad65 / 64 scope link valid_lft forever preferred_lft forever

Yize ukukhishwa komyalo kukhombisa ukuthi ushintsho lusebenza ingunaphakade

i-valid_lft uncanyelwa unomphela_lft ingunaphakade

lokhu akwenzeki ngempela, esingakubheka uma sikhubaza futhi ngokushesha ngemuva kokunika amandla isikhombimsebenzisi esibuzwayo sisebenzisa imiyalo ifdow eth0 && ifup eth0. Uma singafuni ukuqala kabusha isikhombimsebenzisi bese sibuyela ku- eth0 esimweni sayo sokuqala, sisebenzisa:

buzz @ sysadmin: ~ $ sudo ip addr del 192.168.1.250/24 ukusakaza 192.168.1.255 dev eth0
buzz @ sysadmin: ~ $ ip addr show eth0

Ukwazi imiyalo efakwa yiphakheji imv2 ake sigijime:

buzz @ sysadmin: ~ $ sudo dpkg -L iproute2 | grep / bin
buzz @ sysadmin: ~ $ sudo dpkg -L iproute2 | grep / sbin

Ukukhuluma Nge-Dynamic

Uma sifuna ukuthi idivaysi ithole ikheli le-IP elinamandla, kufanele silungiselele i-interface yayo yenethiwekhi ukuze ilithole nge dclient. Kumele simemezele kufayela / njll / inethiwekhi / ukuxhumana imigqa elandelayo yaleyo interface:

auto eth0
iface etho inet dhcp

Uma ngesikhathi senqubo yokufaka kuthathwe isinqumo sokuthi ikhadi lenethiwekhi lithole i-IP enamandla, isinyathelo sangaphambilini asidingekile ngoba kufanele silungiselelwe kahle ukuze iqashe i-IP kuseva ekhona ye-DHCP ku-SME Network.

Uma kungukuthi siguquka sisuke ku-Static IP siye ku-Dynamic, noma ukuthi sengeza i-interface entsha futhi sifuna ukuthola i-IP enamandla, ukunika amandla leyo interface esiyisebenzisayo

buzz @ sysadmin: ~ $ sudo ifup eth0

iyale ukuthi kuleli cala ifundisa uhlelo dclient qala inqubo ye-DHCP. Ukukhubaza i-interface esiyisebenzisayo

buzz @ sysadmin: ~ $ sudo ifdown eth0

umyalo oqala inqubo yokukhululwa - Ukukhululwa ukumisa usebenzisa i-DHCP bese uvala isikhombimsebenzisi senethiwekhi.

Gijima umuntu dhclient ukuthola eminye imininingwane ngohlelo lwekhasimende le-DHCP.

Ikheli eliqinile

Sibonile kuzindatshana eziningi ezedlule ukuthi ungayilungisa kanjani i-IP emile kusixhumi esibonakalayo senethiwekhi. Ifayela eliyinhloko lokumiswa ngu- / njll / inethiwekhi / ukuxhumana. Isibonelo:

buzz @ sysadmin: ~ $ cat / etc / network / interface
# Leli fayela lichaza izixhumanisi zenethiwekhi ezitholakala kusistimu yakho # nokuthi ungazisebenzisa kanjani. Ngemininingwane engaphezulu, bheka izixhumi (5). # I-interface ye-loopback network interface auto lo iface lo inet loopback # I-interface eyinhloko yenethiwekhi ivumela-hotplug eth0
vula i-eth0 inet static
    ikheli 10.10.10.1/24 netmask 255.255.255.0 network 10.10.10.0 ukusakaza 10.10.10.255 isango 10.10.10.101 # dns- * izinketho zenziwa yiphakethe le- # resolutionvconf, uma kufakwe i-dns-nameservers 192.168.10.5 dns-search from linux.fan

Amapharamitha wokumiswa kwesixhumi esibonakalayo senethiwekhi eth0 kusuka kufayela elingenhla khombisa:

  • vumela-hotplug eth0: Igama elifanayo "imoto»Futhi«vumela-auto«. Ulayini okhombisa ukuthi isikhombimsebenzisi esibonakalayo eth0 kumele asukume - up ngokuzenzakalela ngama-subsystems ahlukahlukene ngesikhathi sokuqalisa kwekhompyutha. Ngokuvamile ngu uma
  • vula i-eth0 inet static: umugqa okhombisa ukuthi isikhombimsebenzisi - vula i-eth0 kumele ilungiselelwe inethiwekhi TCP / IP IPv4 ngokwezibalo-i-IP- futhi hhayi ngamandla, njengasendabeni ye-Dynamic Addressing with the line i-ethace eth0 inet dhcp
  • ikheli le-10.10.10.1: yabela i-IPv4 10.10.10.1 esibonakalayo
  • I-255.255.255.0 ye-netmask- Isifihla-buso se-Subnet se-Class ejwayelekile "C" LAN yamakhompyutha angafika kwangu-254. Igama elifanayo lokumenyezelwa ikheli 10.10.10.1/24 kulayini owedlule
  • Inethiwekhi: i-subnet lapho ikheli le-static elinikezwe khona
  • ukusakaza: IP yokusakaza noma yokukhangisa
  • gateway: isango lokuxhuma kwi-Intanethi
  • dns-nameservers- Ikheli le-IP le-DNS uma iphakheji ifakiwe yimbe okungafanele kudidaniswe nefayela /etc/resolv.conf - noma sombulula
  • usesho lwe-dns: isizinda sokuzenzakalelayo emibuzweni ye-DNS

Okuqukethwe yileli fayela elingenhla kungenziwa kube lula uku:

buzz @ sysadmin: ~ $ cat / etc / network / interface
auto lo iface lo inet loopback

allow-hotplug eth0 iface eth0 inet static address 10.10.10.1/24

buzz @ sysadmin: ~ $ ip addr show eth0
2: eth0: umuntu 1500 qdisc pfifo_fast state UP group default qlen 1000 link / ether 70: 54: d2: 19: ad: 65 brd ff: ff: ff: ff: ff: ff inet 10.10.10.1/24 brd 10.10.10.255 scope global eth0 valid_lft unomphela okhethwayo_lft unomphela inet6 fe80 :: 7254: d2ff: fe19: ad65 / 64 scope link valid_lft forever preferred_lft forever

Yonke eminye imingcele izothatha amanani azenzakalelayo, ngaphandle kokukhohlwa amanani esiwamemezele kufayela /etc/resolv.conf al CHA faka iphakheji yimbe.

Ibhuloho - Ukuxhumana kwebhuloho

Ukwenza iBhuloho - bridge udinga ukufaka iphakheji yezinsizakalo zebhuloho:

buzz @ sysadmin: ~ $ sudo ukufaneleka ukufaka ibhuloho-izinsiza

Amabhuloho asetshenziswa kakhulu ku-Virtualization. Masithi sine-HP Proliant ML 350 Gen 8 noma i-Gen 9 server enezinethiwekhi ezi-4. Singashiya omunye wakhe ukuxhumana ngqo noMgcini - Host esekela imishini ebonakalayo. Ngalezi ezintathu ezisele singenza iBhuloho elingaziwa -ngaphandle kokunikeza ikheli le-IP- bese uxhuma imishini ebonakalayo kulelo bhuloho ukuze bakwazi ukufinyelela kwi-SME LAN, le mishini ebonakalayo inamakheli e-static noma ashukumisayo e-IP.

Leli thiphu eliwusizo kakhulu ngilinikezwe ngumngane wami nozakwethu U-Eduardo Noel. Futhi, kufayela / usr / share / doc / ifupdown / example / bridge sizothola umbhalo - iskripthi sendlela yokubhuloga izindlela eziningi zokuxhumana.

buzz @ host: ~ $ Sudo nano / etc / network / interface
auto lo iface lo inet loopback allow-hotplug eth0 iface eth0 inet static address 192.168.10.27 iface eth1 inet manual iface eth2 inet manual iface eth3 inet manual # Bridge Anonymous auto br0 iface br0 inet manual manual_ports eth1 eth2 eth3 ethXNUMX

Isifingqo

Isihloko seTelecommunications siyakhohlisa futhi sidinga ukutadisha okuningi nokwenza. ISysadmin idinga ukwazi okubalulekile. Lo mbhalo umane nje Iphuzu elincane lokungena. Angiphinde.

Asizange sithinte - futhi ngeke sithinte - i Imodeli ye-OSI «Vula ukuxhumeka kwesistimu»Yikuphi okuyimodeli eyisithenjwa yezivumelwano zenethiwekhi ezakhiwe ngobuciko ezakhiwe ngo-1980 yi-International Organisation for Standardization«ISO".

Yehla ungene ezicini zemibono ye- Imodeli ye-OSI, kucishe kulingane nokwehla kwi-Web Deep noma i-Deep Web ... okungenani kimi ukuthi angisiye Hacker.

Ukulethwa okulandelayo

Isingeniso Sesevisi Yokufakazela Ubuqiniso


Okuqukethwe yi-athikili kunamathela ezimisweni zethu ze izimiso zokuhlelela. Ukubika iphutha chofoza lapha.

Amazwana ayi-5, shiya okwakho

Shiya umbono wakho

Ikheli lakho le ngeke ishicilelwe. Ezidingekayo ibhalwe nge *

*

*

  1. Ubhekele imininingwane: Miguel Ángel Gatón
  2. Inhloso yedatha: Lawula Ugaxekile, ukuphathwa kwamazwana.
  3. Ukusemthethweni: Imvume yakho
  4. Ukuxhumana kwemininingwane: Imininingwane ngeke idluliselwe kubantu besithathu ngaphandle kwesibopho esisemthethweni.
  5. Isitoreji sedatha: Idatabase ebanjwe yi-Occentus Networks (EU)
  6. Amalungelo: Nganoma yisiphi isikhathi ungakhawulela, uthole futhi ususe imininingwane yakho.

  1.   I-Zodiac Carburus kusho

    Umyalo ip Ngikusebenzise njengawe, Fico, ezikhathini eziningi futhi isebenze njengolayini wokuphila. Bekufanele ubhale kuphela ngamanethiwekhi wangasese abekelwe amanethiwekhi webhizinisi. Kubi kakhulu ukuthi i-athikili "iyasiza" noma ibhukwana futhi ivakashelwe ngabaningi ayinayo imibono engaphezulu.

  2.   I-Zodiac Carburus kusho

    Ngithole ukweqiwa ngxenye yakho, Fico. Esitatimendeni sebhuloho ithi:
    iface br0 inet manual

    Njengoba wazi, ngalo layini owodwa lapho uqala kabusha ibhuloho awuziphakamisi ngokuzenzekelayo. Kufanele uthi:

    okuzenzakalelayo br0
    iface bro inet manual
    ibridge_ports eth1 eth2 eth3

    Ayikho inkinga. 🙂

  3.   frederico kusho

    Sawubona Zodiac.
    Wena njengokuhlala ufunda okuthunyelwe kwami ​​ngokujulile.
    Ngizofaka isihloko samanethiwekhi angasese ku-athikili yokuqala yeSamba 4. Futhi yebo, ngikhohliwe ukubhala okuzenzakalelayo br0 ekuqaleni kokumiswa kwebhuloho. Ake sibheke ukuthi uLuigys othandekayo, umphathi wesiza, ukuguqula okuthunyelwe.
    Ngiyabonga kakhulu ngesikhathi sakho, Zodiac.

  4.   U-Ado Ello kusho

    Ngiyakuthanda ukufunda lezi zinhlobo zezifundo ku-RSS yami. Sengizifunde isikhathi eside futhi ngase ngiwe ukuthi zifana nezahluko. Ngathi ... Ngiyabonga, ngikufundele

  5.   frederico kusho

    Yebo, qhubeka nokujabulela ukufunda, u-Ado Ello. Halala!