Muaj ntau cov neeg raug teeb meem thaum sim teeb rooj Internet hauv Ubuntu. Feem ntau qhov no yog vim yog kev poob siab, tab sis kuj muaj lwm yam. Tsab xov xwm yuav muab cov lus qhia rau kev teeb tsa ntau hom kev sib txuas nrog ib qho kev tshawb xyuas ntawm txhua yam teeb meem hauv txoj kev ua.
Configuring lub network hauv Ubuntu
Muaj ntau hom kev sib txuas hauv Internet, tab sis tsab xov xwm no yuav qhia txog cov kev nrov tshaj plaws: wired network, PPPoE thiab DIAL-UP. Tseem yuav qhia txog qhov chaw cais ntawm DNS servers.
Saib kuj:
Yuav ua li cas los tsim ib tug bootable USB flash tsav nrog Ubuntu
Yuav ua li cas rau nruab Ubuntu ntawm tus tsav flash
Npaj cov haujlwm
Ua ntej koj pib tsim kom muaj kev sib txuas, koj yuav tsum nco ntsoov tias koj lub cev npaj rau qhov no. Tam sim ntawd nws yog ib qhov tsim nyog yuav tau qhia ntxiv hais tias cov lus txib raug tua "Terminal", tau muab faib ua ob hom: ntxiv cov neeg siv cov cai (nyob rau hauv pem hauv ntej ntawm lawv yuav muaj ib lub cim $) thiab ntxiv cov cai ntawm superuser (thaum pib muaj ib qho cim #). Them rau qhov no, vim tsis muaj cai, feem ntau cov lus txib tsuas yog tsis kam ua. Nws tseem yog ib qho tseem ceeb kom paub tias cov cim lawv tus kheej yog "Terminal" tsis tas yuav nkag mus.
Koj yuav tsum ua kom tiav cov ntsiab lus:
- Xyuas kom tseeb tias cov kev siv hluav taws xob uas siv los mus txuas rau lub network yog muab tua. Piv txwv, ua ib qho ntawm qhov chaw "Terminal"Nws pom zoo kom lov tes taw Network Manager (network icon nyob rau sab xis ntawm lub sab saum toj kawg nkaus).
Ceeb Toom: Nyob ntawm qhov kev sib txuas, tus nais npav Network Manager yuav tshwm sim txawv, tab sis nws ib txwm nyob rau sab laug ntawm hom lus bar.
Txhawm rau lov tes taw cov dej taws, khiav cov lus txib nram qab no:
$ sudo nres network-tus thawj tswj
Thiab khiav, koj tuaj yeem siv tau qhov no:
$ sudo pib network-tus manager
- Nco ntsoov hais tias cov chaw lim dej network yog teeb tsa kom raug, thiab nws tsis cuam tshuam nrog cov txheej txheem ntawm lub network.
- Khaws nrog koj cov ntaub ntawv tsim nyog los ntawm tus neeg zov me nyuam, uas qhia txog cov ntaub ntawv tsim nyog los txhim kho qhov Internet txuas.
- Tshawb xyuas cov tsav tsheb rau daim npav network thiab kev sib txuas ntawm tus neeg muab kev pab kab mob.
Ntawm lwm yam, koj yuav tsum paub lub npe ntawm lub network adapter. Yog xav paub, sau rau hauv "Terminal" kab lus no:
$ sudo lshw -C network
Yog li ntawd, koj yuav pom ib yam zoo li nram no:
Saib kuj: Nquag Siv Commands hauv Linux Terminal
Lub npe ntawm koj lub network adapter yuav nyob rau ntawm cov lus tsis txaus ntseeg "lub npe loj". Hauv qhov no "enp3s0". Qhov no yog lub npe uas yuav tshwm nyob hauv tsab xov xwm; koj yuav muaj qhov sib txawv.
Ceeb Toom: Yog tias koj muaj ntau lub network adapters ntsia koj lub computer, lawv yuav tsum muab suav ua kom raws li (enp3s0, enp3s1, enp3s2, thiab ntxiv rau). Txiav txim siab seb koj yuav ua haujlwm li cas, thiab siv nyob rau tom qab ntawd.
Txoj kev 1: Terminal
"Terminal" - Qhov no yog lub cuab tam universal rau kev teeb tsa txhua yam hauv Ubuntu. Nrog nws, nws yuav muaj peev xwm tsim kom muaj Internet txuas rau txhua hom, uas yuav tham txog tam sim no.
Wired Network teeb
Ubuntu wired network configuration yog ua los ntawm kev ntxiv cov khoom tshiab rau cov ntaub ntawv tawm tswv yim "interfaces". Yog li, ua ntej koj yuav tau qhib cov ntaub ntawv no tib yam:
$ sudo gedit / etc / network / interfaces
Lus Cim: qhov kev hais kom ua siv cov Gedit ntawv sau editor los qhib cov ntaub ntawv teev cia, tab sis koj tuaj yeem sau ntawv rau lwm tus editor, piv txwv li, vi, nyob rau hauv ib qho.
Saib kuj: Cov phau ntawv kho kom nrov dua rau Linux
Tam sim no koj yuav tsum txiav txim siab seb hom IP koj tus kws kho mob. Muaj ob hom: zoo li qub thiab tsis muaj zog. Yog tias koj tsis paub xyov, ces hu rau cov neeg ntawd. kev txhawb nqa thiab sab laj nrog tus neeg teb xov tooj.
Ua ntej, cia peb nrog ib tus IP dynamic - nws txoj kev yooj yim yog yooj yim. Tom qab nkag mus rau cov lus txib yav dhau los, hauv cov ntaub ntawv qhib, hais kom meej rau cov nram qab no:
iface [interface npe] inet dhcp
pib [interface npe]
Qhov twg
- iface [interface npe] inet dhcp - hais txog cov kev xaiv uas muaj qhov sib txuas lus IP (dhcp);
- pib [interface npe] - ntawm login nws ua ib qho kev txuas tsis zoo txuas mus rau qhov kev cai tswjhwm interface nrog tag nrho cov teev tsis.
Tom qab nkag koj yuav tsum tau txais ib yam dab tsi zoo li no:
Tsis txhob hnov qab txuag tag nrho cov kev hloov uas tau los ntawm txhaj rau khawm tsim nyog nyob rau sab qaum txoj cai ntawm tus editor.
Nws yog qhov yooj yim dua rau configure IP zoo li qub. Qhov loj tshaj plaws yog kom paub tag nrho cov qhob. Nyob rau hauv cov ntaub ntawv configuration koj yuav tsum sau cov kab hauv qab no:
iface [interface npe] inet zoo li qub
chaw nyob [chaw nyob]
netmask [chaw nyob]
qhov rooj [chaw nyob]
dns-nameservers [chaw nyob]
pib [interface npe]
Qhov twg
- iface [interface npe] inet zoo li qub - txhais cov adapter IP qhov chaw nyob raws li txoj cai;
- chaw nyob [chaw nyob] - txiav txim siab qhov chaw nyob ntawm koj qhov chaw nres nkoj hauv Ethernet hauv computer;
Lus Cim: Qhov chaw nyob hauv IP tuaj yeem raug pom los ntawm khiav cov lus qhia ifconfig. Nyob hauv cov zis, koj yuav tsum tau saib cov nqi tom qab ntawm "inet addr" - qhov no yog qhov chaw nyob hauv chaw nres nkoj.
- netmask [chaw nyob] - txiav txim rau subnet mask;
- qhov rooj [chaw nyob] - qhia qhov chaw nyob hauv lub rooj vag;
- dns-nameservers [chaw nyob] - txiav txim siab rau DNS neeg rau zaub mov;
- pib [interface npe] - txuas mus rau daim ntawv teev kev ntaus network thaum OS pib.
Tom qab nkag mus rau tag nrho cov ciaj ciam, koj yuav pom ib yam zoo li nram no:
Tsis txhob hnov qab txuag txhua qhov nkag tsis tau ua ntej kaw cov ntawv nyeem.
Ntawm lwm yam, hauv Ubuntu OS, koj tuaj yeem ua ib qho chaw ib ntus mus txuas rau Internet. Nws txawv rau hauv cov ntaub ntawv teev lus teev tseg tsis hloov cov ntaub ntawv cov ntaub ntawv, thiab tom qab qhib lub PC, tag nrho yav tas los teev cov chaw yuav pib dua. Yog tias qhov no yog thawj zaug uas koj sim tsim kom muaj kev sib txuas ntawm Ubuntu, ces tus qauv no yog pom zoo kom pib nrog.
Tag nrho cov tsis muaj teev siv ib qho hais kom ua:
$ sudo ip addr ntxiv 10.2.119.116/24 dev enp3s0
Qhov twg
- 10.2.119.116 - IP-chaw nyob ntawm daim card card (koj yuav muaj lwm tus);
- /24 - ntau cov khoom hauv qhov prefix ntawm qhov chaw nyob;
- enp3s0 - kev sib txuas ntawm lub network uas tus neeg muab kev pab kab mob txuas nrog.
Sau tag nrho cov ntaub ntawv tsim nyog thiab khiav cov lus txib hauv "Terminal", koj tuaj yeem tshawb xyuas lawv qhov tseeb. Yog tias Internet nyob hauv lub PC, ces txhua tus tsiaj ntawv yeej muaj tseeb, thiab lawv tuaj yeem nkag mus rau hauv cov ntaub ntawv tawm.
DNS teeb
Teem tau ib qhov txuas DNS nyob hauv txawv versions of Ubuntu yog txawv. Nyob rau hauv versions ntawm OS los ntawm 12.04 - ib txoj kev, nyob rau hauv ua ntej - lwm. Peb yuav xav txog ib qho kev sib txuas zoo li qub xwb, zoo li qhov ua kom pom tseeb ntawm cov DNS servers.
Teeb hauv OS versions saum toj no 12.04 tshwm sim hauv cov ntaub ntawv uas tau paub dhau los. "interfaces". Nws yog ib qho tsim nyog nkag mus rau ib txoj hlua "dns-serververs" thiab qhov chaw sib cais qhov chaw.
Yog li thawj zaug qhib "Terminal" configuration ntaub ntawv "interfaces":
$ sudo gedit / etc / network / interfaces
Ntxiv nyob rau hauv cov ntawv nyeem qhib sau kab hauv qab no:
dns-nameservers [chaw nyob]
Yog li ntawd, koj yuav tsum tau txais tej yam zoo li no, tsuas yog qhov tseem ceeb yuav txawv:
Yog hais tias koj xav configure DNS hauv Ubuntu ua ntej version, cov ntaub ntawv configuration yuav txawv. Qhib nws los ntawm "Terminal":
$ sudo gedit /etc/resolv.conf
Tom qab nws koj tuaj yeem tsim qhov tsim nyog DNS chaw nyob. Nws yog tsim nyog noj mus rau hauv tus account tias, tsis zoo li nkag tsis "interfaces"hauv "resolv.conf" chaw nyob yog sau txhua lub sijhawm nrog ib pawg lus, lub prefix siv ua ntej tus nqi "cov npe" (tsis muaj quotes).
PPPoE Kev Txuas Hluav Taws Xob
Configure PPPoE ntawm "Terminal" tsis hais qhov kev taw qhia ntawm ntau yam tsis nyob hauv ntau yam ntaub ntawv hauv computer. Ntawm qhov tsis yog, tsuas yog ib pab neeg siv xwb.
Yog li, ua kom muaj point-to-point connection (PPPoE), koj yuav tau ua cov hauv qab no:
- Nyob rau hauv "Terminal" ua:
$ sudo pppoeconf
- Tos lub khoos phis tawj rau kev kuaj xyuas cov khoom siv network thiab modems txuas rau nws.
Ceebtoom: Yog tias lub chaw dej taws tsis pom lub hub raws li tag nrho, ces xyuas seb tus neeg zov me nyuam kab txuas zoo li cas thiab lub modem lub hwj chim, yog tias muaj.
- Nyob rau hauv lub qhov rais uas pom, xaiv lub network card uas tus neeg muab kev pab kab mob txuas nrog (yog tias koj muaj ib daim card network, qhov rai no yuav raug xa mus).
- Hauv qhov "nrov xaiv" qhov rai, nias "Muaj".
- Sau tus ID nkag mus, uas tau muab los ntawm koj tus kws kho mob, thiab xyuas qhov kev txiav txim. Sau tus password.
- Nyob rau hauv lub qhov rais rau xaiv lub ntsiab txhais ntawm DNS servers, nias "Muaj"Yog hais tias IP chaw nyob yog dynamic, thiab "Tsis muaj"yog tias zoo li qub. Nyob rau hauv rooj plaub thib ob, nkag mus rau DNS neeg rau zaub mov manually.
- Tom qab ntawd lub fais fab yuav thov kev tso cai los txwv qhov loj ntawm MSS rau 1452-byte - muab kev tso cai los ntawm txhaj "Muaj".
- Hauv kauj ruam tom ntej, koj yuav tsum tso cai rau koj mus txuas rau PPPoE network thaum lub computer pib los ntawm txhaj "Muaj".
- Hauv lub qhov rais kawg, lub chaw tso dej yuav thov kom tso cai rau tsim kom muaj kev txuas tam sim no - nyem "Muaj".
Tom qab tag nrho cov yeeb yam koj tau ua lawm, koj lub computer yuav tsim kom muaj kev txuas mus rau hauv Internet, yog tias koj tau ua txhua yam zoo.
Nco ntsoov tias lub chaw ua haujlwm yuam kev pppoeconf hu tsim kev twb kev txuas dsl-provider. Yog hais tias koj xav tau mus tua cov kev twb kev txuas, ces khiav "Terminal" hais kom ua:
$ sudo poff dsl-provider
Los tsim kom muaj kev sib txuas dua, ntaus:
$ sudo pon dsl-provider
Lus cim: Yog tias koj txuas rau lub network siv lub pppoeconf chaw ua haujlwm, ces cov kev tswj ntawm network ntawm Network Manager yuav tsis tuaj yeem vim cov kev taw qhia ntawm cov tsis nyob hauv cov "interfaces" configuration file. Rov qab qhib tag nrho cov chaw thiab kev hloov mus rau Network Manager, koj yuav tsum qhib cov ntaub ntawv interfaces thiab hloov tag nrho cov ntsiab lus nrog cov ntawv hauv qab no. Tom qab nkag, txuag cov kev hloov thiab pib dua lub network nrog cov lus txib "$ sudo /etc/init.d/networking Updated 10/10/10/07/07/07/07/07/07/07/07/07/07 / ntxiv tshiab tshiab (tsis muaj quotes). Kuj tau pib dua Network Network utility khiav tawm "$ sudo /etc/init.d/NetworkManager restart" (tsis muaj quotes).
Teem ib qhov kev sib txuas ntawm dial-up
Txhim kho Dial-UP, koj tuaj yeem siv ob lub nqi hluav taws xob: pppconfig thiab wvdial.
Teem kev txuas nrog pppconfig yooj yim txaus. Nyob rau hauv dav dav, txoj kev no yog heev uas zoo sib xws rau yav dhau los ib (pppoeconf): Koj yuav raug nug cov lus nug tib yam, teb rau hauv tag nrho koj yuav tsim kev sib txuas lus hauv Internet. Ua ntej khiav dej num nws tus kheej:
$ sudo pppconfig
Tom qab ntawd ua raws li cov lus qhia. Yog tias koj tsis paub ib co lus teb, nws raug nquahu kom hu rau tus neeg teb xov tooj ntawm cov neeg no. txhawb koj tus kws kho mob thiab nrog nws tham. Tom qab ua tiav tag nrho cov chaw rau kev txuas yuav raug tsim.
Hais txog customization siv wvdialces nws tshwm sim me ntsis tuaj. Ua ntej koj yuav tsum nruab ib pob ntawm nws tus kheej los ntawm "Terminal". Ua li no, khiav cov lus txib nram qab no:
$ sudo apt nruab wvdial
Nws muaj xws li ib qho hluav taws xob tsim los txiav txim siab txhua yam tsis. Nws hu ua "wvdialconf". Khiav nws:
$ sudo wvdialconf
Tom qab nws tiav nyob rau hauv "Terminal" Ntau yam tsis muaj thiab cov yam ntxwv yuav tshwm - lawv tsis tas yuav tsum to taub. Koj tsuas yog xav paub tias lub chaw ua haujlwm tau tsim cov ntaub ntawv tshwj xeeb. "wvdial.conf", uas tau ua cov kev tsim nyog, nyeem lawv ntawm lub modem. Tom ntej no koj yuav tsum hloov kho cov ntaub ntawv tsim. "wvdial.conf"peb qhib nws dhau los "Terminal":
$ sudo gedit /etc/wvdial.conf
Raws li koj tau pom, feem ntau ntawm cov chaw twb spelled, tab sis peb lub ntsiab lus tseem yuav tsum tau ntxiv. Koj yuav tsum sau npe rau hauv lawv tus xov tooj, tus ID nkag mus thiab tus password, raws li. Txawm li cas los xij, txhob maj txhawm rau kaw cov ntaub ntawv, kom yooj yim rau kev lag luam nws pom zoo kom ntxiv ob peb yam ntxiv:
- Sab hauv vib nas this = 0 - qhov kev txuas yuav tsis tawg txawm tias ntev inactivity hauv lub computer;
- Dial Attempts = 0 - ua rau tsis muaj kev sim siab tsim kom muaj kev sib txuas;
- Dial Command = ATDP - kev hu xov tooj yuav raug muab coj los ua ib qho kev poob siab.
Yog li ntawd, cov ntaub ntawv tsim yuav zoo li qhov no:
Thov nco ntsoov tias cov chaw muab faib ua ob lub blocks, muaj cai npe nrog cov npe hauv pawg. Qhov no yog qhov tsim nyog los tsim ob lub qauv ntawm kev siv tsis. Yog li, tsis nyob hauv "[Dialer tseeb]"yuav ib txwm yuav tua, thiab nyob rau hauv "[Dialer txos]" - thaum qhia meej txog qhov kev xaiv tsim nyog hauv qhov kev hais kom ua.
Tom qab ua tag nrho cov chaw, los tsim ib qho kev sib txuas hauv DIAL-UP, koj yuav tsum khiav cov lus txib no:
$ sudo wvdial
Yog tias koj xav tsim kom muaj teeb meem plawv, ces sau cov nram qab no:
$ sudo wvdial mem tes
Yuav kom ua txhaum txoj kev twb kev txuas, hauv "Terminal" yuav tsum tau nias rau ib qho tseem ceeb ua ke Ctrl + C.
Txoj kev 2: Tus Thawj Tswj Network
Ubuntu muaj ib qho dej tshwj xeeb uas yuav pab tsim kom muaj kev sib txuas ntawm ntau hom. Tsis tas li ntawd, nws muaj qhov graphical interface. Qhov no yog Network Manager, uas yog hu los ntawm txhaj rau lub cim icon ntawm sab xis ntawm lub sab saum toj vaj huam sib luag.
Wired Network teeb
Peb yuav pib rau tib txoj kev nrog cov chaw nruab nrab ntawm cov kab sib txuas. Ua ntej koj yuav tsum qhib lub fais fab nws tus kheej. Ua li no, nyem rau ntawm nws lub cim thiab nias "Hloov Cov Kev Sib Txuas" hauv cov ntawv qhia zaub mov. Tom ntej hauv lub qhov rais uas pom, ua cov nram qab no:
- Ndliv lub khawm "Ntxiv".
- Nyob rau hauv lub qhov rais uas pom, los ntawm daim ntawv teev npe cia, xaiv qhov khoom "Ethernet" thiab nias "Tsim ...".
- Nyob rau hauv lub qhov rais tshiab, qhia lub npe ntawm qhov kev txuas hauv cov tswv yim sib txuas.
- Hauv tab "Ethernet" los ntawm cov npe teev cia "Ntaus" txiav txim siab rau daim npav siv network.
- Mus rau tab "General" thiab muab tus zuam tom ntej rau cov khoom "Txuas mus txuas rau lub network no thaum nws muaj" thiab "Txhua tus neeg siv tau txuas mus rau lub network no".
- Hauv tab "IPv4 Chaw" txhais cov txheej txheem raws li "Tsis siv neeg (DHCP)" - rau dynamic interface. Yog tias koj muaj nws zoo li qub, koj yuav tsum xaiv yam khoom ntawd "Los ntawm txhais tes" thiab qhia tag nrho cov kev tsim nyog uas tus kws kho mob tau muab rau koj.
- Laub khawm "Txuag".
Tom qab tag nrho cov saum toj no cov kauj ruam, qhov kev txuas hauv wired internet yuav tsum tau tsim. Yog tias qhov no tsis tshwm sim, khij tag nrho cov nkag tsis tau, koj yuav tau ua yuam kev qhov chaw. Tsis tas li ntawd, nco ntsoov xyuas seb lub checkbox checked. "Network Management" nyob rau hauv dropdown cov zaub mov ntawm lub chaw tso dej.
Qee lub sij hawm nws yuav rov qab pib lub computer.
DNS teeb
Tsim kom muaj kev sib txuas, koj yuav tsum manually configure DNS servers. Ua li no, ua cov hauv qab no:
- Qhib cov qhov sib txuas sib txuas network hauv Network Manager los xaiv lub chaw tso dej los ntawm cov ntawv qhia zaub mov "Hloov Cov Kev Sib Txuas".
- Nyob rau hauv lub qhov rais ntxiv, qhia qhov kev tsim muaj yav dhau los thiab nias rau "Hloov".
- Tom ntej, mus rau lub tab "IPv4 Chaw" thiab hauv daim ntawv teev npe "Txoj Kev Xam Pom" nyem rau "Tsis siv neeg (DHCP, chaw nyob nkaus xwb)". Ces tom qab ntawd "DNS Servers" nkag mus rau cov ntaub ntawv xav tau, ces nias "Txuag".
Tom qab qhov no, qhov DNS teeb yuav pom tias tiav. Yog tias tsis muaj dab tsi hloov, ces sim rov qab qhib lub tshuab computer rau lawv siv.
PPPoE teeb
Teem ib PPPoE kev twb kev txuas hauv Network Manager yog yoojyim li "Terminal". Qhov tseeb, koj yuav tsum qhia meej txog tus ID nkag mus thiab tus password uas tau txais los ntawm tus kws kho mob. Tab sis xav txog tag nrho cov ntxaws ntxiv.
- Qhib txhua qhov txuas sib txuas los ntawm clicking Network Manager utility icon thiab xaiv "Hloov Cov Kev Sib Txuas".
- Nyem "Ntxiv"thiab tom qab ntawm dropdown list select "DSL". Tom qab nias "Tsim ...".
- Nyob rau hauv lub qhov rais uas pom, sau lub npe ntawm qhov kev txuas, uas yuav muab tso rau hauv cov ntawv qhia zaub mov.
- Hauv tab "DSL" sau tus ID nkag mus thiab lo lus zais rau hauv thaj chaw uas tsim nyog. Optionally, koj tuaj yeem hais qhia lub npe qhov kev pab, tab sis qhov no yog nyob ntawm koj xaiv.
- Nias lub tab "General" thiab khij lub voj voog nyob ze ntawm thawj ob yam khoom.
- Hauv tab "Ethernet" hauv cov ntawv teev npe cia "Ntaus" taw qhia koj daim npav ua haujlwm.
- Mus rau "IPv4 Chaw" thiab txhais tau tias txoj kev ua raws li "Tsis siv neeg (PPPoE)" thiab txuag koj xaiv los txhaj khawm tsim nyog. Yog tias koj xav nkag mus rau hauv DNS neeg rau zaub mov manually, xaiv "Automatic (PPPoE, chaw nyob xwb)" thiab muab cov kev txwv tsis zoo, ces nias "Txuag". Thiab thaum muaj tag nrho cov chaw yuav tsum nkag mus rau hauv tus kheej, xaiv qhov khoom nrog tib lub npe thiab sau rau hauv thaj chaw uas tsim nyog.
Tam sim no ib tug tshiab DSL kev twb kev txuas tau tshwm sim nyob rau hauv Network Manager zaub mov, xaiv qhov uas koj yuav tau nkag mus rau hauv Internet. Rov qab hais tias qee zaus koj yuav tsum pib dua koj lub computer rau cov kev hloov rau kev siv.
Xaus
Yog li ntawd, peb tuaj yeem hais tias Ubuntu operating system muaj ntau ntau cov cuab yeej rau kev teeb tsa kev tsim nyog rau Internet. Chaw Haujlwm Pabcuam Teebmeem Network tau muaj graphical interface, uas ua kom yooj yim rau kev ua haujlwm, tshwj xeeb yog rau cov neeg tshiab. Txawm li cas los "Terminal" tso cai rau koj ua ntau lub chaw yooj yim los ntawm kev nkag mus tsis muaj nyob hauv cov dej taws.