Sie sind auf Seite 1von 6

2/11/12

Advanced_Networking_Linux Oracle VM VirtualBox

AdvancedNetworksettingsforLinux
ContributedbyJeanJacquesSarton,2007/03/21 About Screenshots Downloads Documentation Enduserdocs Technicaldocs Contribute Community #/i/h !bns #stPT frtecs w aecle vasd o s ro e AH o h ae e r ald i uo r u ot PT=si:urbn/i:urbn AH/bn/s/i:bn/s/i #cet atp rae a tnt - tp - <sr ucl t a1 u ue> i ln stu dvtp p ik e p e a1 f #cet tebig rae h rde bcladrb0 rt db r bcladfb0tp rt di r a1 #stteI adesadruig e h P drs n otn i ln stu dvb0 p ik e p e r i ad ad1.../4dvb0 p dr d 01112 e r i ruead1.../4dvb0 p ot d 01102 e r Withthiscodeyouwillbeabletocontactthevirtualmachine attachedtotheHostInterfacetap1fromthehostandthehostfrom thevirtualmachine.TheIPadressshouldnotconflictwiththemain IPaddressofyourPCwhichwillprobablybeenwithintherange 192.168.0.0/16. Withthesesettingswewillnothaveanaccesstotheexternalworld fromthevirtualmachine.Howtodothiswillbeexplainedlater. Ifweplantousemoreasonevirtualmachinewecanaddfurther tapdevicestothebridge.Thescriptcanbemodifiedasfollow: #/i/h !bns #stPT frtecs w aecle vasd o s ro e AH o h ae e r ald i uo r u ot PT=si:urbn/i:urbn AH/bn/s/i:bn/s/i UE=nm o tev ue> SR<ae f h m sr NME_FV UBRO_M #cet tebig rae h rde bcladrb0 rt db r #cet tetp adisr te it tebig rae h as n net hm no h rde
https://www.virtualbox.org/wiki/Advanced_Networking_Linux 1/6

Thevirtualmachinemaybefullyintegratedintothenetworkand youmayhaveaccessbetweenallvirtualmachineandthehostifyou doalittlebitmore. Abridgecancontainonlyonephysical/virtualdevice.Soyoucan createyourbridgeasfollow:

2/11/12

Advanced_Networking_Linux Oracle VM VirtualBox

N= B1 wie[$B-t$UBRO_M hl N l NME_FV d o tnt - tpN - $SR ucl t a$B u UE i ln stu dvtpN p ik e p e a$B bcladfb0tpN rt di r a$B ltN=N+ e B$B1 dn oe #stteI adesadruig e h P drs n otn i ln stu dvb0 p ik e p e r i ad ad1.../4dvb0 p dr d 01112 e r i ruead1.../4dvb0 p ot d 01102 e r Nowwewillbeabletostartthevirtualmachines1ton,thevirtual machinearetobeattachedtotap1,tap2,...tapn. Settingswithinthevirtualmachines.Youmayusethetoolsprovided bytheguestsysteminordertoconfigurethedeviceusedforthe networkconnectionorsettheipaddressmanuallyorviaascript.On linuxthecommandswhicharetobecalledmanuallyare: i ln stu dveh p ik e p e t0 i ad ad1.../4dveh p dr d 01122 e t0 i rueaddfutva1... dveh p ot d eal i 0111 e t0 Youmustalsoeditthefile/etc/resolv.confinordertobeableto resolvenetworknamessuchaswww.virtualbox.orgorlocalnames. Thecontentofthisfilecanbethesameasfortheresolv.conffileon yourcomputer. YoumayalsoassigntheaddressviaDHCP,inthiscasethedhcpd daemonmustworkonthehostmachine.Asimpleconfigurationshall lookasfollow: dn-paesyeitrm dsudt-tl nei; inr cin-pae; goe letudts sbe 1... ntak2525250{ unt 0110 ems 5.5.5. #--dfutgtwy - eal aea oto rues pin otr oto sbe-ak pin untms oto dmi-ae pin oannm oto dmi-aesres pin oannm-evr # oto npsres pin t-evr 1...; 0111 2525250 5.5.5.; "oanog; dmi.r" 1...; 0111 1...; 0111

rnednmcbop1... 1...5; ag yai-ot 0112 01124 dfutlaetm 260 eal-es-ie 10; mxlaetm 420 a-es-ie 30; } IfyouwanttousezeroConfrendezvous/Bonjourforautomatic settingoftheIPaddressfortheguestsyoushoutuseanaddresin therange169.254.0.0/16forthehosteg169.254.0.1.
https://www.virtualbox.org/wiki/Advanced_Networking_Linux 2/6

2/11/12

Advanced_Networking_Linux Oracle VM VirtualBox

Connectingtheinternalnetworktotheworld. Withtheabovescenariowedon'thaveaccesstothewideworldand willnotneabletoupdateaguestsystemordownloadanythings.In orderotgetthisworkingwemustconfigurethemainsystemsothat itdoNAT. Thesimplestwayshouldbetoinserttheinterfaceusedforthe connectiontotheinternetandusingthedhcpserverprovidedbythe router(ifyouareattachedtotheinternetviaaDSLrouter).Iwedo so,allsystemscanreachthewebandyoumaysurfordownload fileswithinyourvirtualmachine. Ifyouwantthatthemachinearenotnormallyconnectedtothewide worldyoucansetyouhostmachine(andunsetit)foratemporary connectiontotheworld. SettingNATcanbedowiththefollowingcode ITF"r" NI=b0 ETF"t0 XI=eh" eh 1>/rcssntiv/pfrad co po/y/e/p4i_owr #cereitn itberls stadfutplc la xsig pal ue, e eal oiy itbe - IPTACP pals P NU CET itbe - IPT pals F NU itbe - OTU ACP pals P UPT CET itbe - OTU pals F UPT itbe - FRADDO pals P OWR RP itbe - FRAD pals F OWR itbe - ntpals t a F #stfradn adntrls e owrig n a ue itbe - FRAD- $XI - $NI - ACP pals A OWR i ETF o ITF j CET itbe - FRAD- $NI - $XI - ACP pals A OWR i ITF o ETF j CET itbe - nt- PSRUIG- $XI - MSURD pals t a A OTOTN o ETF j AQEAE Stigwl b d wt etn il e o ih #cereitn itberls stadfutplc la xsig pal ue, e eal oiy itbe - IPTACP pals P NU CET itbe - IPT pals F NU itbe - OTU ACP pals P UPT CET itbe - OTU pals F UPT itbe - FRADDO pals P OWR RP itbe - FRAD pals F OWR itbe - ntpals t a F #dsbefradn ial owrig eh 0>/rcssntiv/pfrad co po/y/e/p4i_owr eh 1>/rcssntiv/pdndr co po/y/e/p4i_yad Ifafirewallisalreadyinstalledyoumayalsoenable/disablethe accesstotheinternetcalling: #isr NTrl net A ue itbe - nt- PSRUIG- eh - MSURD pals t a A OTOTN o t0 j AQEAE #eal fradn nbe owrig eh 1>/rcssntiv/pfrad co po/y/e/p4i_owr
https://www.virtualbox.org/wiki/Advanced_Networking_Linux 3/6

2/11/12

Advanced_Networking_Linux Oracle VM VirtualBox

anddisablingtheinternetaccesswith: #rmv NTrl eoe A ue itbe - ntpals t a F #dsbefradn ial owrig eh 0>/rcssntiv/pfrad co po/y/e/p4i_owr ConnectionviaIpv6 SincetheIpv6Addressrangeislimitedtoapproximately3.59
addressesandmostofthemarealreadyused,thenextgenerationofthe Internetprotocolwasdeveloped.AmajoradvantageofIpv6isthatthereare enoughroomforprovidingallsystemswithuniqueandworldwidevalidwithout theneedofspecialthinksasNATorSTUN.Withtheadvanceoftechnologyand useofIPbasedservicesforcomputers,IPbasedtelephonesandsoontheneed ofanextendedrangeofIPaddressincreaseconsiderably.

WithIPv6thefullconnectivitytothenetwillbecomerealandthe communicationbetweendifferentsystemswillbeeasier. AllmajorOS(BSD,LinuxMacOSXandotherUNIXlikesystems supportactuallyIPv6.ThisisalsothecaseforWindowsVistaand WindowsXP(onXPyoumayneedsomesupplementsfrom Microsoft). IfyouhaveaconnectiontotheIPv6worldviaaprovideras SIXXS.NEToruse6to4(Protocol41)youwillgetanIPv6main Addressandhavethepossibilitytouseownsegmentsforyourlocal network.EachofthesystemswillbeconnectedtotheIPv6network withouttheneedofNATandsoon. ForthiscaseweassumethatyouwilltryIPv6onavirtualmachine andgetyourfirstexperienceswithIPv6basednetwork. AfurtherassumptionisthatyouhaveafixIPv6addressfrom sixxs.netoranothersupplierandalsotheabilitytoconfigureyour ownsegment. Theaddressyouwillgetmaylookas2001:XXXX:YYYY:ZZZZ::2 (XXXX,YYYYansZZZZarehexadecimalcodedvalues).Thiswillbe themainaddressforconnectiontoIPv6viaatunnel.Ifyoursupplier provideyouwiththeabilitytousesegmentsyouwillgetthemain partoftheIPv6Addressyoumayuse(Prefix)andthisshouldbe 2001:XXXX:SSSS::/48XXXX.Youcanwiththisusetheprefixes 2001:XXXX:SSSS:0000::/64upto2001:XXXX:SSSS:ffff::/64within yourIPv6network. Forthebridgeyouwillneedanowninterfaceortapdevice,itshall notbeconnectedtoyourmaininterfaceport. Ascriptforsettingthebridgelookasfortheexampleabove,there areonlyafewsdifferences. #/i/h !bns #stPT frtecs w aecle vasd o s ro e AH o h ae e r ald i uo r u ot PT=si:urbn/i:urbn AH/bn/s/i:bn/s/i
https://www.virtualbox.org/wiki/Advanced_Networking_Linux 4/6

2/11/12

Advanced_Networking_Linux Oracle VM VirtualBox

#cet atp rae a tnt - tp - <sr ucl t a1 u ue> i ln stu dvtp p ik e p e a1 #cet tebig rae h rde bcladrb0 rt db r bcladfb0tp rt di r a1 #stteI adesadruig e h P drs n otn i ln stu dvb0 p ik e p e r i - ad ad20:XXSS::16 dvb0 p 6 dr d 01XX:SS1:/4 e r i - ruead20:XXSS::6 dvb0 p 6 ot d 01XX:SS1/4 e r Onthevirtualmachineyoucanusetheautomaticrouterandip settingfeatureprovidedbyIPv6.Inthiscaseyoushouldinstall radvd(providedbymostLinuxdistributions)andmodifythefile /etc/radvd.conf: itraeb0 nefc r { Aveddeto; dSnAvr n MntAvnevl3; iRrdItra 0 MxtAvnevl10 aRrdItra 0; pei 20:XXSS::/4 rfx 01XX:SS1:6 { Avniko; dOLn n Avuoooso; dAtnmu n Avotrdro; dRueAd n } ; } ; Theinterface(br0)andtheIPv6prefixmustbemodified,theother valuesarenormallyOK. Onthevirtualhostyoumustnotdoanythings,theIPv6Addressand theroutingwillbesetautomatically.TheonlyproblemisthatDNS willnotwork.YoumayreachotherhostwithintheIPv6netifyou usetheIPv6Addressdirectly.OnLinuxandUNIXlikesystemsyou cansolvetheDNSproblemifyouputintothefile/etc/resolv.conf theIPv6addressofthenameserver.YourDNSserverwillprobably nothaveanIPv6Addressandyourvirtualhostwillnotdealwith Ipv4Addresses.Inordertosolvethisproblemyoucandownload ptrtdandtotd.Aftercompiling,configuringthenandstartingthem youmustonlyeditthe/etc/resolv.conffileandputtheretheline nameserver2001:XXXX:SSSS:1::1tothisfileandyouwillhavefull connectiontotheIpv4andIpv6worlds.Totd(TrickorTreat Daemon)ftp://ftp.pasta.cs.uit.no/pub/Vermicelliisacaching nameserverwhichlookfirstfoIPv6addressesandifthereisnosuch addresslookfortheIPv4addressandbuildanIPv6addresswhich willhavetheconfiguredprefix.Ptrtd(PortableTransportRelay TranslatorDaemon)hearrecponizesuchaddressandtranslatethe IPv6ethernetframestoIPv4Framesandforframesreturnedfrom theoutsideconvertthemtoIPv6. CompilingTotdmayfail,butyoucanfixthisifyoueditthefile MakefileanddeletetheoptionWerror.Totdisnormallyinstalled under/usr/local/sbinandexpecttheconfigurationsfiletotd.conf underthedirectory/usr/local/etc.Thisfileshallcontainthe following:
https://www.virtualbox.org/wiki/Advanced_Networking_Linux 5/6

2/11/12

Advanced_Networking_Linux Oracle VM VirtualBox

fradrYU_P4ADES owre ORIv_DRS pei 20:X:S:: rfx 01XXSSN: pdie/a/u/odpd ifl vrrntt.i YOUR_IPv4_ADDRESSand2001:XXX:SSS:N::aretobereplacedwith propervalues,NisthesegmentnumberfortranslatedIPv4 addressesandmaybeforexample4. Forptrtdthereisnoconfigurationfile,soyoumuststartitasfollow: prd- 20:X:S:: tt p 01XXSSN: NameresolutionforyouIPv6Network Theeasiestwayistorunavahionyourhostandontheguest systemsthecorrespondingservice.AvahiistheZeroconf implementationonLinuxandisavailableonthemostrecent distributions.ZeroConfwasoriginallydevelopedbyAppleandis availableunderMacOSX.UnderLinuxyoushalleditthefile /etc/nsswitch.confandmodifythehostslineaccordingthefollowing: hosts:filesdnsmdns6Thisshallbedoneforthehostsystemand theLinuxvirtualmachine.Pleasereferalsototheavahi documentation.

ContactPrivacypolicyTermsofUse

https://www.virtualbox.org/wiki/Advanced_Networking_Linux

6/6

Das könnte Ihnen auch gefallen