Tlhophiso ea Marangrang le Tsamaiso - Li-network tsa SME

Lumelang metsoalle le metsoalle!

Kakaretso ea li-series: Li-network tsa likhomphutha tsa li-SME: Selelekela

Ha re e-so nehele sengoloa ho taba e hlahisang sehlooho sa ena. Hape ha re e-s'o bale maikutlo afe kapa afe a kopa ho ngola ka eona. Re e nkile habobebe hore e tsejoa ke bohle mme mohlomong ke lona lebaka le entseng hore re e hlokomolohe ho fihlela kajeno. Leha ho le joalo, re tla ngola molaetsa o hlakileng ka eona bakeng sa ba hlokang ho khatholla kapa ho ithuta ka taba ena.

Network: Tlhaloso e sebetsang

Bakeng sa merero e sebetsang, e le 'ngoe Ka kakaretso - Network E na le lisebelisoa tsa marang-rang tse peli kapa ho feta tse kang likhomphutha, li-server, liprinta, mehala ea thekeng, kapa lisebelisoa tse ling tsa marang-rang, tse hokahantsoeng ke likhoele tsa 'mele kapa lihokela tsa waelese molemong oa ho arolelana le ho aba tlhaiso-leseling lipakeng tsa lisebelisoa tse hokahantsoeng.

Bakeng sa tlhaiso-leseling e batsi:

Hopola hore lihokela li fanoa ka sepheo se felletseng eseng bakeng sa monyaka. 😉

Litlhophiso tsa marang-rang

  • Ke khothaletsa ho ba sebelisang lits'ebetso tsa ts'ebetso CentOS y bula SETE, tataisoa ke mongolo Tlhophiso ea Server Ka GNU / Linux, e ngotsoe ke mongoli Joel Barrios Dueñas. Ho thata ho nna ho ngola lihlooho tseo re tla sebetsana le tsona ka tlase bakeng sa likabo tsa Debian, CentOS le openSUSE sengolong se le seng, hobane tse peli tsa ho qetela li fapana le tsa pele haholo-holo ka mabitso, sebaka sa lifaele tsa phetolo, litaba tsa tsona le lintlha tse ling. filosofi e amanang le sehlooho.

Lisebelisoa tsa ts'ebetso tseo re li sebelisang letotong lena la lihlooho li na le lisebelisoa tsa lits'oants'o tsa ho hlophisa lisebelisoa tse fapaneng tsa marang-rang. Leha ho le joalo, poso ena e tla shebana le ho sebelisa konteraka ea taelo kapa terminal.

Joalokaha re bone lihloohong tse fetileng, maemong a mangata re hlophisa khokahano ea marang-rang - kapa li-interface - nakong ea ts'ebetso ea ho kenya ho netefatsa hore, hang ha sistimi ea ts'ebetso e se e kentsoe, komporo e na le khokahano e sebetsang ea letlooa.

Tlhophiso e nepahetseng ea bonyane marang-rang a pele -main- a bohlokoa bakeng sa mosebetsi o latelang oa Desktop, Mosebetsikapa Seva eo re e sebelisang.

Re ke ke ra sebelisa NetworkManager

Ho nolofatsa ho ngoloa ha sengoloa sena, tsepamisa maikutlo ho sebopeho sa seva, 'me u nolofalletse ho bala, re tla nka hore Che tšebeletso e fanoang ke sephutheloana e ntse e sebelisoa network-mookameli. Ho seng joalo re tlameha ho etsa liketso tse latelang:

Ka Debian

buzz @ sysadmin: ~ $ sudo systemctl emisa network-manager.service
buzz @ sysadmin: ~ $ sudo systemctl boemo ba network-manager.service
buzz @ sysadmin: ~ $ sudo systemctl tima network-manager.service
buzz @ sysadmin: ~ $ sudo ifconfig

Haeba phetolo ea likarete tsa marang-rang tse itšetlehileng ka ts'ebeletso network-mookameli li nepahetse, ebe re ka tsoelapele ho sebetsa. Leha ho le joalo, ho phetse hantle ho phethisa:

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

ho lekola habeli hore tsohle li sebetsa hantle.

Ka CentOS

Bukeng ka sebopeho sa PDF «Tlhophiso ea Server Ka GNU / Linux«, Khatiso ea Phupu 2016, khaolo ea 48.2.2 e nehetsoe ho sehlooho sa ts'ebeletso NetworkManager. Ke lebelletse hore mongoli oa eona Joel Barrios Dueñas ha a rate ho hang - o nka ho sa utloahale - ts'ebeliso ea NetworkManager ho Servers.

Likarolo tsa Ethernet

E le molao o akaretsang, ha re sebetsa le mechini e hlakileng ho Qemu-KVM, sistimi e sebetsang e khetholla li-interface tsa Ethernet tse nang le mabitso a kang ethX, moo X e emela boleng ba linomoro. Sebopeho sa pele sa Ethernet se khetholloa e le eth0, sa bobeli e le eth1, joalo-joalo.

Haeba e mabapi le lits'ebetso tsa Debian - le tse tsoang- e sebelisang mechini ea 'mele, notation e fetileng le eona ke' nete.

Haeba re sebetsa ka mechini ea 'mele e nang le lits'ebetso tse sebetsang CentOS y bula SETE, mokhoa oa tšebetso o ba khetholla e le enoX. Ho tšoana ho hoholo ho ka etsahala ka mechini e fumanehang ka nnete -ka lits'ebetso tsena tsa ts'ebetso ho li-hypervisor tsa vmware bao.

Ka mechini e fumanehang ka mokhoa oa ts'ebetso FreeBSD -e boetse ke Software ea Mahala- ka kakaretso e tsejoa e le emX o vtnetX ho latela hore na li ho Qemu-KVM kapa ho VMware ka tatellano. Haeba ke tsa 'mele ka tloaelo li tsejoa e le emX.

Khetholla likarolo tsa Ethernet

Ho khetholla marang-rang ohle a fumanehang ka har'a komporo ea ka sysadmin.fromlinux.fan, rea phetha:

buzz @ sysadmin: ~ $ sudo ifconfig -a
Khokahano ea khokahano ea eth0: 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 Boholo: Link ... lo Link encap: 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 Boholo: Khokahano ... virbr0-nic Khokahano ea khokahano: 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 Boholo: Khokahano ...
  • Ellipsis tse tharo liphethong tse fetileng li bolela hore tlhaiso-leseling e ngata e khutlisitsoe eo re sa e boneng ho boloka sebaka.

Joalo ka ha ke kentse sistimi e sebetsang ea Debian 8 "Jessie" mananeo a mabeli a ts'ehetso ea mochini, ke hore Qemu-KVM y Sesebelisoa sa VMware Workstation 10.0.6, taelo e khutlisa likarolo tsohle tse teng.

  • Bakeng sa rekoto: software ea poraefete VMware Workstation Server 10.0.6 ke kopi ea molao e fanoeng ke motsoalle oa ka le mosebetsi-'moho le 'na El NeoZelandes, ea e fumaneng ka marang-rang naheng ea habo mme a le mosa ho ka nthomella eona.

Ha re boneng hore na ke leseli lefe leo re ka le fumanang ho tsoa ho sehlahisoa se fetileng:

  • eth0: Sebopeho se seholo sa marang-rang se nang le aterese ea IPv4 10.10.10.1. Aterese ea IPv6 le eona ea hlahisoa.
  • lo: Loopback kapa wa selehae ka IPv4 127.0.0.1 le IPv6 -e tloaelehileng ho likhokahano tsena kaofela- :: 1/128.
  • lebogang: Sebopeho sa marang-rang sa mofuta oa Bridge -  Borilla ka IPv4 192.168.10.1 le aterese MAC 52:54:00:c8:35:5e. Sebopeho sena se hlakileng ke seo re se thehang le ho se hlophisa ka Virt-Motsamaisi ea Qemu-KVM joalo ka marang-rang «ya kamehla»Ea mofuta oa NAT.
  • lenapa-nic: Sebopeho sa marang-rang se etsang file ea Qemu-KVM, ea mofuta oa Anonymous Bridge- Anonymous Bridge le ka aterese e tšoanang MAC 52:54:00:c8:35:5e bashagak lebogang. Ha e na aterese ea IP e abetsoeng.
  • vmnet8Mofuta oa sebopeho sa marang-rang NAT e lokiselitsoe ho vmware bao Virtual Network Editor.

El Sesebelisoa sa VMware Workstation ka tsela ea hae Virtual Network Editor, hlophisa marokho ao u a thehang ka sehokelo se seng le se seng sa Moamoheli ka tsela e fapaneng - Sebetsa. Na jargon e sebelisitsoe ho lingoloa tse fetileng?.

Kopo e 'ngoe - ha se eona feela kapa ea ho qetela- ho fumana leseli mabapi le li-interface tsa marang-rang ke lshw - Thathamisa Hardware. lshw ke sesebelisoa se hlahisang tlhaiso-leseling e batsi mabapi le tlhophiso ea mochini. Haeba re matha ka har'a komporo:

buzz @ sysadmin: ~ $ aptitude search lshw
p lshw - leseli mabapi le phetolo ea li-hardware  
p lshw-gtk - leseli le hlakileng mabapi le phetolo ea li-hardware

Rea hlokomela hore e na le sebopeho sa eona seo re se tlohelang hore u se leke. Ha re kenye mode ea console ebe re matha ka mor'a moo:

buzz @ sysadmin: ~ $ sudo lshw -class network
[sudo] phasewete bakeng sa buzz:
  * -network               
       Tlhaloso: Ethernet sehlahisoa sa sehokelo: 82579V Gigabit Network Connection morekisi: Intel Corporation 'meleng ID: 19 bus info: pci @ 0000: 00: 19.0 lebitso le utloahalang: mofuta oa eth0: 05 serial: 70: 54: d2: 19: papatso: 65 size: Boima ba 100Mbit / s: bophara ba 1Gbit / s: lioache tse 32 tsa oache: bokhoni ba 33MHz: pm msi bus_master ...
  * -network E holofetse
       Tlhaloso: Ethernet interface interface id: 1 lebitso le utloahalang: virbr0-nic serial: 52: 54: 00: c8: 35: 5e size: 10Mbit / s

Ha re laoleng mabitso a utloahalang a li-interface

Ka linako tse ling, haholo-holo ha re chencha karete ea marang-rang ka lebaka lefe kapa lefe, re hlokomela hore palo eo ke ea nomoro X e khethollang segokanyimmediamentsi sa keketseho e eketsehile ka 1 'me rea e hlokomela feela ha re matha ifconfig -a, lipakeng la boemo se etsahetseng kamora phetoho. E ka etsahala hape ha re tlosa marang-rang a marang-rang ka lebaka lefe kapa lefe, ebe re eketsa e 'ngoe hape.

Lintlha tse kaholimo li ka tena ha re hlophisitse le ho hokahanya - tlama ho ts'ebeletso e le 'ngoe kapa ho feta, lebitso le itseng le utloahalang la sehokelo eth0, ena1 o em0. Ntho e sa nepahalang ka ho fetisisa ke hore hangata e etsahala nako e telele kamora - lilemo mohlomong - ho tloha tlhophisong ea pele. Ebe likarolo tse ncha li hlaha ka mabitso a kang eth1,eth2, ena2, em1, jj, mme lits'ebeletso tse ling li emisa ho sebetsa hantle. Ba fetileng boemong bo tšoanang maemo Oa tseba na ke bolelang 😉

Mabitso a utloahalang a li-network tsa li-network tsa Debian - le tse ling tsa tsona - a ka fumanoa faeleng /etc/udev/rules.d/70-persistent-net.rules. Ho CentOS 7 e ho file /etc/udev/rules.d/90-eno-fix.rules, athe liphetolelong tsa eona tse fetileng e ne e le file e tšoanang le ea Debian.

Ka DebianHaeba u batla ho fetola lebitso le utloahalang la marang-rang a itseng, fumana mola o lumellanang le aterese ea oona MAC le ho fetola boleng LEBITSO = ethX ka boleng bofe kapa bofe ba lebitso leo u le hlokang. Hore liphetoho li atlehe, o tlameha ho qala komporo ea hau bocha.

Bakeng sa CentOS 7, bona mosebetsi «Tlhophiso ea Server Ka GNU / Linux»Ka Joel Barrios Dueñas, moo ho fanoang ka mokhoa o qaqileng.

  • Bohlokoa: Boemong ba ka, Hlokomela! Ka ts'ebeletso NetworkManager haeba o sebetsana le likhokahano.

Fetola mekhahlelo ea marang-rang a marang-rang

Ka Debian, haeba re batla ho fetola likarolo tsa karete ea marang-rang ka ho sa feleng, re tlameha ho hlophisa faele / etc / network / likarolo joalo ka ha ho hlalositsoe ka tlase.

Ho tseba ka botlalo-le ho feta- likhetho tsohle tseo u ka li sebelisang likarolo tsa motho. Re khothaletsa hape ho bala litokomane tse foldareng:

buzz @ sysadmin: ~ $ ls -l / usr / share / doc / ifupdown /
Kakaretso ea 44 drwxr-xr-x 2 motso oa 4096 Aug 7 2016 kenya letsoho
drwxr-xr-x 2 motso oa 4096 Aug 7 2016 mehlala
-rw-r-r-- 1 motso oa motso 976 Jun 21 2012 copyright -rw-r - r-- 1 motso motso 18243 13 Mar 2015 1 changelog.gz -rw-r-r-- 297 motso motso 21 Jun 2012 1 NEWS.Debian.gz -rw-r-r-- 454 motso motso 29 Nov 2014 1 README -rw-r - r-- 946 motso motso 21 Jun 2012 XNUMX TSOHLE

Lenaneo ethtool

Ka lenaneo ethtool Re ka bala, ra thathamisa le ho fetola mekhahlelo ea karete ea marang-rang joalo ka lebelo la khokahano, puisano e ikemetseng, ho lekola palo ea mojaro chefo ea palo e felletsengjj. E fumaneha litsing tsa polokelo tsa likhakanyo tsohle.

buzz @ sysadmin: ~ $ sudo aptitude kenya ethtool
[sudo] phasewete bakeng sa buzz:

buzz @ sysadmin: ~ $ sudo ethtool eth0
Litlhophiso tsa eth0: Libaka tse tšehelitsoeng: [TP] Mekhoa ea khokahano e ts'ehetsoeng: 10baseT / Half 10baseT / 100baseT e felletseng / Half 100baseT / Full 1000baseT / ts'ebeliso e felletseng ea tšebeliso ea khefu: Ha e tšehetse puisano ka boiketsetso: E. Full 10baseT / Half 10baseT / Full 100baseT / Phatlalatso e felletseng ea tšebeliso ea khefu: Ha ho phatlalatso ea puisano ea likoloi: E Lebelo: 100Mb / s Duplex: Port e Felletseng: Pair e sothehileng PHYAD: 1000 Transceiver: Auto-negotiation ea ka hare: ho MDI-X: on (auto) E ts'ehetsa ho tsoha: pumbg Tsoha-on: g Boemo ba molaetsa oa hajoale: 100x1 (0) sehokela sa probe ea drv Khokahano e fumanoe: e

Liphetoho tseo re li etsang ka sesebelisoa sena ke tsa nakoana 'me li tla lahleha khomphuteng e latelang ea komporo. Haeba re hloka liphetoho tse sa feleng tse entsoeng ka ethtool, Re tlameha ho eketsa faeleng / etc / network / likarolo taelo «peleho"Kapa" pele o phahamisa sebopeho "ka tsela e latelang:

likoloi eth1
haeba eth1 inet dhcp
pre-up / sbin / ethtool -s eth1 lebelo 1000 duplex e tletse

Kahoo karete ea marang-rang eth1 e fumanang aterese ea eona ea IP ho tsoa ho seva ea DHCP, e fetotsoe ruri hore e sebetse ka lebelo la 1000 Mb / s ka mokhoa Duplex e felletseng.

  • Mokhoa o kaholimo o boetse oa sebetsa bakeng sa likarete tse nang le li-IP tsa static.

Aterese ea IP

Re tla bona ka tlase mokhoa oa ho hlophisa aterese ea IP ea lisebelisoa, hammoho le tsela ea heke - Heke ka boiketsetso, e hlokahalang bakeng sa puisano le marang-rang a lehae le ka ho toba ka inthanete ka su Heke.

  • Ha re ngola "ka kotloloho»Re bua ka linyeoe tsa marang-rang a SME moo marang-rang a lumelloang ntle le ts'ebeliso ea seva Proxy, e leng sona ha e khothalletsoe, leha ho na le matla Pula Tsa Lehlohonolo khomphuteng ka boeona e sebetsang e le heke. Ha nako ea hau e fihla re tla ama taba ena Proxy.

Ho sebetsana le nakoana

Ho sebelisa litaelo tse tloaelehileng tsa kabo ea Linux joalo ka ip, ifconfig le tsela, ka nakoana re ka hlophisa khokahano ea marang-rang joalokaha re tla bona ka tlase.

Ho abela aterese ea IP le subnet mask ea eona ebe o lekola ts'ebetso, ha re etseng:

buzz @ sysadmin: ~ $ sudo ifconfig eth0 172.16.10.2 netmask 255.255.0.0
buzz @ sysadmin: ~ $ sudo ifconfig
Khokahano ea eth0: 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 Boholo: Khokahano ea UP UP BROADCAST RUNNING MULTICAST MTU: 1500 Metric: lipakete tse 1 tsa RX: liphoso tse 0: 0 li theohile: 0 li feta: 0 foreimi: lipakete tse 0 tsa TX: liphoso tse 659: 0 li theohile: 0 li feta: 0 o tsamaisang: 0 thulana: 0 txqueuelen: 1000 RX li-byte: 0 (0.0 B) li-byte tsa TX: 115601 (112.8 KiB) Ho sitisa: 20 Memori: fe600000-fe620000

Re abetse karete ka nakoana eth0 static IP aterese 172.16.10.2 ka mask a subnet 255.255.0.0 bao e leng ba Sehlopha sa «B» Inthanete Inthanete.

  • Hlokomela hore re fetotse phetolo ea khokahano ea marang-rang eth0 ea komporo ea sysadmin.fromlinux.fan, eo pele e neng e na le IP 10.10.10.1/255.255.255.0 ea Sehlopha sa "A" sa Marangrang a Marangrang, leha e ka amohela likhomphutha tse 254 feela ho latela mask a eona a subnet.

Ho hlophisa heke ka boiketsetso ebe o lekola ts'ebetso eo re e etsang:

buzz @ sysadmin: ~ $ sudo tsela eketsa default gw 172.16.10.1 eth0

buzz @ sysadmin: ~ $ sudo tsela -n
Tafole ea Kernel IP routing 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 virbr0

Re sa tsoa fa Gateway nakoana 172.16.10.1 ho hokahanya eth0 172.16.10.2, ha likarolo tse ling li boloka litekanyetso tsa tsona tsa pele.

Ho tlosa litlhophiso TSOHLE tsa karete ea marang-rang, ha re matheng:

buzz @ sysadmin: ~ $ sudo ip addr flush eth0

buzz @ sysadmin: ~ $ sudo ifconfig
Khokahano ea khokahano ea eth0: Ethernet HWaddr 70: 54: d2: 19: ad: 65 UP BROADCAST RUNNING MULTICAST MTU: 1500 Metric: lipakete tse 1 tsa RX: liphoso tse 0: 0 li theohile: 0 li feta: foreimi ea 0: lipakete tsa TX tsa TX: liphoso tse 0: 718 dropped: 0 overruns: 0 carrier: 0 collisions: 0 txqueuelen: 0 RX bytes: 1000 (0 B) TX bytes: 0.0 (125388 KiB) Interrupt: 122.4 Memory: fe20-fe600000

buzz @ sysadmin: ~ $ sudo tsela -n
Tafole ea Kernel IP routing 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
  • Ha re shebeng hantle, hobane re tlosa lits'ebetso TSOHLE tsa marang-rang tse fetileng esita le e phatlalalitsoeng ho file ea / etc / network / interfaces!.

Ho khutlisetsa lefats'e kamoo le neng le le kateng pele re ka qala komporo hape. Haeba re sa batle ho emisa ho sebetsa, ha re matheng:

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

buzz @ sysadmin: ~ $ sudo ifconfig eth0
Khokahano ea khokahano ea eth0: 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 BROADCAST RUNNING MULTICAST MTU: 1500 Metric: lipakete tse 1 tsa RX: liphoso tse 0: 0 drop: 0 overruns: 0 frame: 0 TX packets: 729 error: 0 dropped: 0 overruns: 0 carrier: 0 collisions: 0 txqueuelen: 1000 RX bytes: 0 (0.0 B) TX bytes: 129009 (125.9 KiB) Ho sitisa: 20 Khopotso: fe600000-fe620000

buzz @ sysadmin: ~ $ sudo tsela -n
Tafole ea Kernel IP routing 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

kahoo re khutlela tlhophisong ea mantlha.

Aterese ea nakoana u sebelisa ip command

Ka makhetlo a mangata re tsamaea le Laptop - Laptop ho Network e 'ngoe ea SME e kopileng lits'ebeletso tsa rona kapa thuso mme ha re batle ho fetola sebopeho sa marang-rang a eona. Ho fihlela sena re ka sebelisa taelo ip.

Taelo ip e kenya ka package iproute, kapa tse ipeha2 ho latela phetolelo le phetolelo. Ho Debian 6 "Squeeze" -ka maikutlo a rona ka seqo- maqephe a motho oa taelo ip li ne li hlakile haholo ho feta mohlala, Wheezy le Jessie. ip haeba e ntse e tsoela pele ho sebelisoa ho bonts'a, kapa ho tsamaisa tsela - Ho tsamaisa, lisebelisoa, melaoana ea litsela le likonopo.

O ka sheba maqephe a monna bakeng sa mofuta o kentsoeng o sebelisa monna ip.

Ke e sebelisitse feela ho abela aterese e 'ngoe ea IP e tsamaellanang le subnet ea SMB LAN ea k'hamphani e' ngoe. Mohlala, ha re abeng aterese ea IP 192.168.1.250 ho tlatselletsa le eo u seng u ntse u e-na le eona 10.10.10.1 ho karete ea marang-rang ea k'homphieutha ea ka:

buzz @ sysadmin: ~ $ ip addr bontša eth0
2: eth0: motho 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 bophara global eth0
       valid_lft e khethiloe ka ho sa feleng_lft ka ho sa feleng inet6 fe80 :: 7254: d2ff: fe19: ad65 / 64 scope link valid_lft forever preferred_lft forever

buzz @ sysadmin: ~ $ sudo ip addr eketsa 192.168.1.250/24 e phatlalatsoang 192.168.1.255 dev eth0

buzz @ sysadmin: ~ $ ip addr bontša eth0
2: eth0: motho 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 bophara global eth0
       valid_lft e khethiloe ka ho sa feleng_lft ka ho sa feleng
    inet 192.168.1.250/24 brd 192.168.1.255 bophara global eth0
       valid_lft e khethiloe ka ho sa feleng_lft ka ho sa feleng inet6 fe80 :: 7254: d2ff: fe19: ad65 / 64 scope link valid_lft forever preferred_lft forever

Le ha tlhahiso ea taelo e bonts'a hore phetoho e sebetsa ka ho sa feleng

valid_lft e khethiloe ka ho sa feleng_lft ka ho sa feleng

sena ha se hlile ha se etsahale, seo re ka se hlahlobang haeba re sa sebetse le hang kamora hore re lumelle sebopeho se botsitsoeng ka ho sebelisa litaelo ifdow eth0 && ifup eth0. Haeba re sa batle ho qala sebopeho hape re khutlele ho eth0 ho ea boemong ba eona ba pele, re phetha:

buzz @ sysadmin: ~ $ sudo ip addr del 192.168.1.250/24 e phatlalatsoang 192.168.1.255 dev eth0
buzz @ sysadmin: ~ $ ip addr bontša eth0

Ho tseba litaelo tseo sephutheloana se li kenyang ipeha2 ha re matheng:

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

Ho bua ka Matla

Haeba re batla hore sesebelisoa se fumane aterese e matla ea IP, re tlameha ho hlophisa sehokelo sa marang-rang hore se e fumane ka dhclient. Re tlameha feela ho phatlalatsa faeleng / etc / network / likarolo mela e latelang ea sebopeho seo:

likoloi eth0
iface etho inet dhcp

Haeba nakong ea ho kenya ts'ebetso ho ile ha etsoa qeto ea hore karete ea marang-rang e fumane IP e matla, mohato o fetileng ha o hlokehe kaha o tlameha ho hlophisoa ka nepo hore o hira IP ho tsoa ho seva sa DHCP se teng ho SME Network.

Haeba ke hore re fetoha ho tloha ho Static IP ho ea ho Dynamic, kapa hore re eketsa segokanyimmediamentsi sa sebolokigolo 'me re batla ho fumana IP e matla, ho etsa hore sebopeho seo re se sebelisang se sebetse.

buzz @ sysadmin: ~ $ sudo ifup eth0

laela hore ntlheng ena e laele lenaneo dhclient qala ts'ebetso ea DHCP. Ho thibela sebopeho seo re se sebelisang

buzz @ sysadmin: ~ $ sudo ifdown eth0

taelo e qalang ts'ebetso ea tokollo - ho lokolloa tlhophiso ka DHCP le ho koala marang-rang.

Matha motho dhclient bakeng sa tlhaiso-leseling e batsi ka lenaneo la moreki la DHCP.

Aterese e tsitsitseng

Re bone lihloohong tse ngata tse fetileng hore na o ka hlophisa IP e sa fetoheng joang marang-rang. Faele ea mantlha ea phetisetso ke / etc / network / likarolo. Mohlala:

buzz @ sysadmin: ~ $ katse / jj / netweke / likarolo
# Faele ena e hlalosa marang-rang a marang-rang a fumanehang ho sistimi ea hau # le hore na o ka e kenya tšebetsong joang. Bakeng sa tlhaiso-leseling e batsi, sheba likarolo (5). # The loopback network interface auto lo iface lo inet loopback # Sebopeho se ka sehloohong sa marang-rang se lumella-hotplug eth0
iface eth0 inet e tsitsitse
    aterese 10.10.10.1/24 netmask 255.255.255.0 network 10.10.10.0 e phatlalatsoang 10.10.10.255 heke ea 10.10.10.101 # dns- * likhetho li kengoa tšebetsong ke # resolutionvconf package, haeba e kentsoe dns-nameservers 192.168.10.5 dns-search ho tloha linux.fan

Lisebelisoa tsa marang-rang tsa sebopeho sa marang-rang eth0 ho tsoa faeleng e kaholimo bontša:

  • lumella-hotplug eth0: Le tšoanang le "koloi»Le«lumella-auto«. Mohala o bonts'ang sebopeho sa 'mele eth0 o tlameha ho tsoha - up ka boiketsetso ke litsamaiso tse fapaneng nakong ea qalo ea likhomphutha. Ka tloaelo ke haeba
  • iface eth0 inet e tsitsitse: mola o bonts'a hore segokanyimmediamentsi sa sebolokigolo - iface eth0 e tlameha ho hlophisoa bakeng sa netweke TCP / IP IPv4 ka lipalo-e lokisitsoeng IP- eseng ka matla, joalo ka ha ho buuoa ka Dynamic Addressing ka mohala haeba eth0 inet dhcp
  • aterese 10.10.10.1: abela IPv4 10.10.10.1 ho segokanyimmediamentsi sa sebolokigolo
  • letlooa 255.255.255.0- Subnet mask bakeng sa "Class" C ea LAN ea likhomphutha tse ka bang 254. Le tšoanang le ho phatlalatsa aterese 10.10.10.1/24 moleng o fetileng
  • netweke: subnet eo aterese ea static e abetsoeng e le ea eona
  • hasa: IP kapa phatlalatso IP
  • Heke: heke ea ho hokela inthaneteng
  • dns-mabitso- Aterese ea IP ea seva ea DNS haeba sephutheloana se kentsoe soqqoa e sa lokelang ho ferekanngoa le file /etc/resolv.conf - kapa rarolla
  • patlo ea dns: domain search ea kamehla ho lipotso tsa DNS

Litaba tsa faele e kaholimo li ka nolofatsoa ho:

buzz @ sysadmin: ~ $ katse / jj / netweke / likarolo
auto lo iface lo inet loopback

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

buzz @ sysadmin: ~ $ ip addr bontša eth0
2: eth0: motho 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 bophara global eth0 valid_lft e khethiloeng ka ho sa feleng_lft ka ho sa feleng inet6 fe80 :: 7254: d2ff: fe19: ad65 / 64 link link valid_lft forever preferred_lft forever

Litekanyetso tse ling kaofela li tla nka litekanyetso tsa mantlha, ntle le ho lebala litekanyetso tseo re li phatlalalitseng faeleng /etc/resolv.conf al Che kenya sephutheloana soqqoa.

Borokho - Khokahano ea Borokho

Ho etsa borokho - Bridge o hloka ho kenya sephutheloana sa lisebelisoa tsa borokho:

buzz @ sysadmin: ~ $ sudo aptitude kenya li-bridge-utils

Marokho a sebelisoa haholo ho Virtualization. Ha re re re na le seva ea HP Proliant ML 350 Gen 8 kapa Gen 9 e nang le li-network tsa 4. Re ka tlohela e mong oa hae hore a buisane ka kotloloho le Moamoheli Sebetsa e ts'ehetsang mechini ea nnete. Ka tse tharo tse setseng re ka etsa Borokho bo sa Tsejoeng -ntle le ho fana ka aterese efe kapa efe ea IP- 'Me u hokela mechini e fumanehang borokhong boo hore e tle e khone ho kena ho SME LAN, mechini ena e nang le liaterese tsa IP tse sa fetoheng kapa tse matla.

Ntlha ena ea bohlokoa e ile ea fanoa ke motsoalle le mosebetsi-'moho Edward Claus. Hape, ho file / usr / share / doc / ifupdown / example / bridge re tla fumana sengoloa - rx mabapi le mokhoa oa ho koala marang-rang a marang-rang.

buzz @ host: ~ $ sudo nano / etc / network / interfaces
auto lo iface lo inet loopback lumella-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 bridge_ports eth1 eth2 eth3

Kakaretso

Taba ea Puisano ka Mehala e thata ebile e hloka thuto le boithuto bo bongata. Sysadmin e hloka ho tseba lintho tsa bohlokoa. Sengoliloeng sena ke feela Ntho e Nyane ea ho Kena. Ha e sa le eo.

Ha rea ​​ama - ebile ha re na ho ama - Mohlala oa OSI «Tlosa Khokahano ea Sisteme»Eo e leng mofuta oa litšupiso bakeng sa li-protocol tsa marang-rang tse nang le meaho e khabisitsoeng e entsoeng ka 1980 ke Mokhatlo oa Machaba oa Boemo ba Temo«ISO".

Theohela litabeng tsa thuto ea Mohlala oa OSI, hoo e batlang e lekana le ho theohela ho Webosaete e Tebileng kapa Webosaete e Tebileng ... Hacker.

Tlhahiso e latelang

Selelekela sa Tšebeletso ea Bopaki


Litaba tsa sengoloa sena li latela melao-motheo ea rona ea melao ea boitšoaro ea bongoli. Ho tlaleha phoso tlanya mona.

Maikutlo a 5, siea ea hau

Siea maikutlo a hau

aterese ya hao ya imeile ke ke ho phatlalatswa.

*

*

  1. E ikarabella bakeng sa data: Miguel Ángel Gatón
  2. Morero oa data: Laola SPAM, tsamaiso ea maikutlo.
  3. Molao: Tumello ea hau
  4. Puisano ea data: Lintlha li ke ke tsa tsebisoa batho ba boraro ntle le ka tlamo ea molao.
  5. Polokelo ea data: Database e hapiloeng ke Occentus Networks (EU)
  6. Litokelo: Nako efe kapa efe o ka fokotsa, oa hlaphoheloa mme oa hlakola tlhaiso-leseling ea hau.

  1.   Zodiac Carburus a re

    Taelo ip Ke e sebelisitse joalo ka uena, Fico, makhetlo a mangata mme e sebelitse e le mohala oa bophelo. U ne u tlameha feela ho ngola ka marang-rang a ikemetseng a boloketsoeng marang-rang a khoebo. Ke masoabi hore sengoloa se "nang le thuso" kapa buka ea matsoho 'me se eteloa ke ba bangata ha se na maikutlo a mang hape.

  2.   Zodiac Carburus a re

    Ke lemohile hore ha u na karabo, Fico. Polelong ea borokho e re:
    iface br0 inet bukana

    Joalo ka ha o tseba, ka mohala o le mong ha o qala botjha borokho ha o iphahamise. E lokela ho re:

    likoloi br0
    bukana ea inet bro
    bridge_ports eth1 eth2 eth3

    Ho lebohile nna. 🙂

  3.   federico a re

    Lumela Zodiac.
    Uena joalo ka ha u bala melaetsa ea ka ka botebo.
    Ke tla kenyelletsa sehlooho sa marang-rang a poraefete sengoloeng sa pele sa Samba 4. Mme ee, ke lebetse ho ngola likoloi br0 qalong ea phetolo ea borokho. Ha re boneng hore na Luigys ea ratehang, motsamaisi oa sebaka sa marang-rang o fetola poso.
    Ke leboha haholo ka nako ea hau, Zodiac.

  4.   ke a e rata a re

    Ke rata ho bala mefuta ena ea lithuto ho RSS ea ka. Ke li balile nako e telele mme ke ne ke oele hore li tšoana le likhaolo. Ka re ... Ke a leboha, ke o badile

  5.   federico a re

    Tsoela pele ho natefeloa ke ho bala, Ado Ello. Lumelang!

bool('nete)