• m Linux pЉ|
    osGAзR firefox s
    | cD | ̔D | g | A | ~R | ୱR | w޲z | QAO | Ŏ | y`~ | m | Xs |
    @ @ @
    @
    ̪sG2011/07/20
    nӨק Linux Ӌظ`FIbĤGتA ڭ̪DDEnsW Internet ݭn@ǥTӋ]wAodz]wb Windows tWקhbĤTتk[cFCbo@SAڭ̫hDnHTw IP ]w覡ӭק Linux ӋAPɡA]|pϥ ADSL D^覡ӤWA~A] Cable modem ϥΪ̤]bӋAҥHڭ̤]@U Cable modem b Linux U]w覡I ̫Aѩ۰OqϥΪ̤jWAB]۰Oq`ϥεLuA]][JFLusu[I


    jADϥ4.1 Linux sW Internet e`Nƶ

    ѫeXتƧڭ̪DAQnsW Internet Aon]w@œXk IP Ӌ~iHADnO IP, Netmask, Gateway, DNS IP HΥDEWنΡCڭ̤]DAӥDḘn]wANOynXʺdzA_hDEsdɡA ]w IP ӋOSΪAAOaIҥHUڭ̴Nӽͤ@͡A AnpTwdwgQA Linux DEӋSMp]wH


    pADϥ4.1.1 Linux d

    AT{ Linux dHLinux UdW٬OHڭ̨A@UaI

    • {ѺdUmN

      b Linux ̭UUmXGOHɮצW٨ӨNAҦp /dev/hda N IDE1 Ĥ@ master wІΆΡC LAdN (Network Interface Card, NIC) oOHœRUmW٨ӥNA ӹw]dN eth0 AĤGidh eth1 AHC

    • }dœ (Xʵ{)

      ڭ̪DdOwAҥHSMݭn֤ߤ䴩~XʥLC@ӻAثes Linux distributions w]iH䴩dœӋqwgܧQFA]Ajt 3COM, Intel HΪ픪 RealTek, D-Link κdwgQ䴩A ҥHϥΪ̥iHܻ]wnL̪dCLAU@Adœ}oΤ@NX} (Open Source) wXʵ{AΪ̬OMdӷsFAϱo Linux ֤ߨӤΤ䴩ɡAANonzLG

      1. sss֤ߡAΪ̬O
      2. sd֤߼œ

      n֤ߥiH䴩dowTIOAs֤ߩνsd֤߼œO̔xu@A ӥBɭlXSiLkbCDEWs\AҥHU@AduQw] Linux Ҥ䴩Amuij^@Q Linux 䴩daAҦpܫKyɥdI KoFӦhɶbwT{WAEӪI ^_^

      t~Aɭ Linux w]dœiLk 100% od\઺A ҥHAɭԧAROonۦsdœ~ISMA ӺdœNonۦѺd}oΪxUFILApGAdOۦswUA CswUL֤߮ɡAAnۦ歫sʽsLMœC ]œP֤߬O}ʪ[I

    • [Ԏ֤ߩҮ쪺dT

      ]AdwgbDEWAAOتROۦwA PCI PCI-x PCI-E WA pT{MdQ֤߮OH̔x[INQ dmesg Ӭd\YiG
      [root@www ~]# dmesg | grep -in eth
      377:e1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connection
      383:e1000: eth1: e1000_probe: Intel(R) PRO/1000 Network Connection
      418:e1000: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX
      419:eth0: no IPv6 routers present
      
      qW 377 383 oAڭ̥iHdoDEidϥμœ e1000AӨϥΪRMNO Intel dFC~AoӺdtץiF 1000Mbps UuҦ (418) IFϥ dmesg Ӭd֤߮߰w鲣ͪT~Aڭ̤]iHzL lspci Ӭd߬}]QƳIpUҥܡG
      [root@www ~]# lspci | grep -i ethernet
      00:03.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet 
      Controller (rev 02)
      
      Ъ`NAmǫϥΪO Virtualbox [DE (аѦĤ@ 1.2.2-2)A]ϥΪO[XӪ Intel dC pGAOϥΦۤvڵwtQwUDEARM|ݨ줣PTIO`I

    • [Ԏdœ

      q誺 dmesg KXTAڭ̪DmoDEҨϥΪœO e1000 A֤ߦQJFܡHiHQ lsmod hddݡC~AoӼœ}TSOpOHϥ modinfo ӬddݧaI
      [root@www ~]# lsmod | grep 1000
      e1000                 119381  0  <==TJ֤ߤI
      
      [root@www ~]# modinfo e1000
      filename:    /lib/modules/2.6.32-71.29.1.el6.x86_64/kernel/drivers/net/e1000/e1000.ko
      version:     7.3.21-k6-NAPI
      license:     GPL
      description: Intel(R) PRO/1000 Network Driver
      .....(HUٲ).....
      
      WKXTIb󨺭ɦW (filename) I@ꪺɦWؿANOڭXʵ{mDnؿҦbC on`NOA 2.6.32-71.29.1.el6.x86_64 O֤ߪA]AP֤ߪϥΪXʵ{@˳Iڭ̤~|@jաA֤߫A AۤvswXʵ{NݭnssTI

      Ap󪾹DAddOH̔x[IަSŰʧAdAiHϥΡG y ifconfig eth0 zӬdߧAddCpGAӵۤWTӧ@A Go{dwgXʤFAߧAAǷQU@`h]waIpGSdOHNǷQۤvsdXʵ{aI

    pADϥ4.1.2 sdXʵ{(Option)

    @ӻApGSSݨDAmOܫijAۤvsdXʵ{IH ]QCs֤߳onss@dXʵ{AOQQ\oСҥHASQ Linux w]֤ߤ䴩dA NۧaI

    Tips:
    meRF@iغdDEOAMdèSQSɪ Linux w]֤ߩҤ䴩AҥHNonۤvs֤TC] CentOS ܤ֧s֤ߡAҥHĤ@sܤNѰOo^ƤFCΨLFӋgs֤ߥX{Amܶ}ߪ۰ʤɯŮ֤ߡA Mhݶi reboot AGOHSdXʵ{FTIڪDELkpAonDEe tty nJ~is
    mϥ

    pGAuܦDAӥBMdxѵ Linux Xʵ{lXF Ϊ̬OAܷQnYǩxѪXʵ{~S\FSΪ̬OAuܤQnAR@iB~dC ɡANonssdXʵ{oC

    Tips:
    WApGAnsKʵwɡAХd\@Uw]UWO_Τ䴩 Linux rˡA ]ǵwtΦbXswɡA``|| Linux Xʵ{gC pG]UW䴩ܡAܤ֧A|oxҴѪXʵ{lX[I ^_^
    mϥ

    ]ڭ̳ǫϥΪdO Intel 82540EM Gigabit Ethernet A]AݭnXʵ{on Intel xo̷sAӤnϥιw]֤ߩҴѪɡAAMpBzOHЪ`NAmoӤp`uO@ӽd̔A PtαXXʵ{wU覡IӤ@ˡAAonѦXʵ{Ū (READ ME) ά}ɮרӦwU~C ~ApGw]Xʵ{wgFdAmOijϥιw]Xʵ{NnFI

    t~Aѩs{ݭnsHή֤߬}TA]onwwU gcc, make, kernel-header γn~C Oڭ̿ܪwUҦybasic serverzAodznw]SwUAҥHAonwUodzn~C odzniH̔xzL yum ϥΡyyum groupinstall 'Development Tools'zӦwUAuiAèS[I ҥHNonzL쥻Ф@Ӥ@ӥhBz RPM ݩʬ̪ۨDӶMFꐷЪ㤣MܡANonzL yum ]wɡAϥΥEɮתӨo쪩Ъ yum nMxoImo̰]AwgwUFһݭnsFA ^UӪʧ@OG

    1. oxXʵ{G

      AAAiHƻsmAzL Virtualbox [ӨӡCڭ̳ǫϥΪO Intel dAAiHpUhUG


      ̫ (2011/07) U 8.0.30ATWӤp`쪺RnsIUɮצW٬ e1000-8.0.30.tar.gzA mNm /root UAMǷQӳBzsL{aI

    2. YPsG

      ϥ root ipUu@aG
      [root@www ~]# tar -zxvf e1000-8.0.30.tar.gz -C /usr/local/src
      [root@www ~]# cd /usr/local/src/e1000-8.0.30/
      # ɦbMؿU README ɮסAOoݤ@ݡAoɮפ|ܦhTA
      # ]ApsAHγoӼœҤ䴩œI
      [root@www e1000-8.0.30]# cd src
      [root@www src]# make install
      
      ̫oӼœ|QsBwUmpUɦWG /lib/modules/$(uname -r)/kernel/drivers/net/e1000/e1000.koC ^Uӧڭ̱onsJoӷsœ~潗I

    3. œPBz

      ѩoӼœwgQJTAҥHڭ̱onHœA~^sJoӼœCϥΪkI^oˡG
      # 1. wgJbO餤Hœ
      [root@www ~]# rmmod e1000
      # ɤwg쪺d|ӮI]Xʵ{QFI
      
      # 2. JsœAåBd\@US쥿TI
      [root@www ~]# modprobe e1000
      [root@www ~]# modinfo e1000
      filename:       /lib/modules/2.6.32-71.29.1.el6.x86_64/kernel/drivers/net/e1000/e1000.ko
      version:        8.0.30-NAPI  <==NOo̡I
      license:        GPL
      description:    Intel(R) PRO/1000 Network Driver
      
      ЦۦPe@p`@UAN|o{u쥿ToILAoӼœbUs֤߱XN|ġI OH]s֤߷|@ӷsXʵ{INOA{bo 8.0.30 oCoIROnAC

    4. ]w}E۰ʎŰʺdœ (Option)

      pGAb}EN^TooӼœܡAAdNSDTIoӨBJOiHLCpGA֤ROdA AionۤvBz@UœR~CBzOH̔xAb /etc/modprobe.d/ ؿUإߤ@ӦW ether.conf ɮסA eNœPdNsb@YiIo˳BzG
      [root@www ~]# vim /etc/modprobe.d/ether.conf
      alias eth0 e1000
      alias eth1 e1000  <==]midI
      
      [root@www ~]# sync; reboot
      
      F@U誺]wO_|ͮġAq`m|@s}EAM}E[Ԏ@UO_TŰʺdA [Ԏ@UœJpApG@QANӧFI

    5. ]w IP

      Ψ@NA`oݬݳo˪dœO_iHQ]wn IP aH ҥHڭ̥ʵL@Өp IP ݬݥG
      [root@www ~]# ifconfig eth0 192.168.1.100
      [root@www ~]# ifconfig
      eth0      Link encap:Ethernet  HWaddr 08:00:27:71:85:BD
                inet addr:192.168.1.100  Bcast:192.168.1.255  Mask:255.255.255.0
      ....(HUٲ)....
      
      KKIu]wSIMQ ping oӫOh ping @UkLqA ݬݯण঳^RANDAdO_ OK TIq`OSDTI

    pADϥ4.1.3 Linux }]wɮ

    ڭ̪D TCP/IP nӋDnOG IP, Netmask, Gateway, DNS IP AӥBdUnѰOAoDE]RMnDEW (hostname)I~Aڭ̤]D IP oʳ]wBDHCP BzΡCoǰӋDnOgbdz]wɡHpROH UNڭ̨ӳBz@fI

    һݺӋDn]wɦW
    IP
    Netmask
    DHCP P_
    Gateway
    /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=dN
    BOOTPROTO=O_ϥ dhcp
    HWADDR=O_[Jdd(MAC)
    IPADDR=NOIP}
    NETMASK=lBnT
    ONBOOT=nnw]Űʦ
    GATEWAY=NOqThT
    NM_CONTROLLED=B~޳n
    mijoӶءI
    DEW /etc/sysconfig/network NETWORKING=nn
    NETWORKING_IPV6=䴩IPv6_H
    HOSTNAME=ADEW
    DNS IP /etc/resolv.conf nameserver DNSIP
    p IP R
    DEW
    /etc/hosts pIP DEW OW

    ASݎhADnݭnק諸NOo|ɮצӤwI]SܧxIjaQӦhFIN]wp`AA o̥yYiC~ARɮשγ\A]RMnD@UnI

    • /etc/services
      oɮ׫hOO[cb TCP/IP W``wA]A http, ftp, ssh, telnet ΆΪAȩҩwq port number AOoɮשҳWُXӪCpGAQnۭq@ӷswP port RANonoɮפFF

    • /etc/protocols
      oɮ׫hObwqX IP ʥ]w}ơA]A ICMP/TCP/UDP o譱ʥ]wwqΡC

    jyDWoXɮ׫AӭnקӋɡAN̔xFIܩ譱ŰʫOܡAiHOoX̔xOYiI

    • /etc/init.d/network restart
      o script ̭nI]iH@f𭫷sŰʾӺӋI L|DʪhŪҦ]wɡAҥHiHܧ֪_tw]ӋȡC

    • ifup eth0 (ifdown eth0)
      ŰʩΪ̬O}YiCiHzLo̔x script ӳBzI o script |Dʨ /etc/sysconfig/network-scripts/ ؿUA ŪAS]wɨӳBz[I (Ҧp ifcfg-eth0)C

    jyAunDoǰ򥻪OPɮסAIӋ]wN̔xTI LA̦nAROnA shell script AnI]iHl}Ӻ]wC why HoO]C distributions ]wƥiೣӬۦPALoH /etc/init.d/network @Űʪ script A ]AAunAMɮתeAܮeNl}oXӧA]wɩһݭneOIaI

    t~As CentOS 6.x RB~X@ӦW٬ NetworkManager nEӺ޲zA LAmROwuyۤvAҥHܫijNMn}OIRnAڭ̦wUybasic server (Ĥ@ت 1.2.2-2)z No򥩪SwUMnInΦb^_^


    jADϥ4.2 sW Internet ]wk

    beXاڭ̴N͹LAxWaϥDnsWںk(1)NB(2)ADSL T^PD^B(3)Cable modem Τ覡APɡAʳ]w IP ӋOܭnߡA]AUU`AĤ@`ʳ]wTw IP @wnL@I L~̷ӱzh]whߡI

    ~Aѩثeϥ Linux notebook ϥΪ̤jWA Notebook q`OHLuӳsuA ҥHmbo̤]ϥΤ@fLuӶisu]wCܩDž 56 Kbps D^h]t׸CBϥΫ׶VӶVCA ҥHbo̴NhFC


    pADϥ4.2.1 ʳ]wTw IP Ӌ (AΎNBADSL Tw) + jˬdBJ

    ҿתTw IP NObAӋSAAunKJJw IP ӋYiCoӬJw IP Ӧۭ̩OH @ӻALiӦ۩G

    • NGюx쪽^@œ IP ӋF
    • Tw ADSLGV ISP ӽЪ@œTw IP ӋF
    • ~ IP ɾkGҦp~ϥΨp IP @ksuήɡAڭ̪ Linux SM]NݭnV~ޤHӽФ@œTw IP ӋoI

    o˲MEܡH]NOAڭ̨oTw IP ӋëD@wO public IP IϥNO@œi^Tw IP NOFI ҥHb[]A줧eAХ`NҦӋӷTʔ[InFAA IP np]wOH^hꑲĤT 3.2.1 ̭ 3.2-1Aڭ̹~d (eth0) TG

    IP:       192.168.1.100
    Netmask:  255.255.255.0
    Gateway:  192.168.1.254
    DNS IP:   168.95.1.1
    Hostname: www.centos.vbird
    

    nק諸|ɮ׻P}Űʸ}AHέsŰʫݭnԣO[ԎIAmAϥΤ@̔xӻA AunOooXӪ椺nɮ׻POAHbקӋɡAN|X{h~FIݬݧaI

    ק諸Ӌ]wɻPnŰʸ}[ԎGO
    IP}Ӌ /etc/sysconfig/network-scripts/ifcfg-eth0
    /etc/init.d/network restart
    ifconfig (IP/Netmask)
    route -n (gateway)
    DNS /etc/resolv.conf dig www.google.com
    DEW /etc/sysconfig/network
    /etc/hosts
    hostname (DEW)
    ping $(hostname)
    reboot

    Uڭ̴NOwWU]wӶiɮתsקoI

    1. IP/Netmask/Gateway ]wBŰʻP[Ԏ

      ]wӋonק /etc/sysconfig/network-scripts/ifcfg-eth0AаOoAo ifcfg-eth0 Pɮפ DEVICE Wٳ]wݬۦPAåBAboɮפҦ]wA򥻤WNO bash Ӌ]wWhT (`Njpg)I
      [root@www ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
      DEVICE="eth0"               <==dNAn ifcfg-eth0 ۹R
      HWADDR="08:00:27:71:85:BD"  <==NOd}AYu@idAiٲ
      NM_CONTROLLED="no"          <==nLn骺޲zI
      ONBOOT="yes"                <==O_w]ŰʦN
      BOOTPROTO=none              <==oIP覡A}grudhcpAʥiKJnone
      IPADDR=192.168.1.100        <==NO IP [
      NETMASK=255.255.255.0       <==NOlBn
      GATEWAY=192.168.1.254       <==NOw]
      # IOWoXӳ]wءAUhiHٲoI
      NETWORK=192.168.1.0         <==NOMqĤ@ IPAiٲ
      BROADCAST=192.168.1.255     <==NOs}oAiٲ
      MTU=1500                    <==NO̤jljKx]wȡAYhiٲ
      
      WƫܦnzaIЪ`NCӋ(䪺^)RMnjgI _hڭ̪ script |~PIWm]wȥṳW 8 ӦӤwAL NETWORK, BROADCAST, MTU mS]wI ܩӋ譱AIPADDR, NETMASK, NETWORK, BROADCAST mbo̴NAhAnͪOXӭn]wȡG

      • DEVICEGoӳ]wȫ᭱^UmNݭnPɦW (ifcfg-eth0) ӗUmNۦP~I_hi|y@ǗUmW٧䤣쪺xZC

      • BOOTPROTOGŰMɡAϥΦRwH pGOʵ IP AЉKJ static none ApGO۰ʨo IP ɭԡA ЉKJ dhcp (nghrA]oO̭n}grI)

      • GATEWAYGNOyӥDEt default gatewayzA ҥHA]woӶخɡAЯSOdNInƳ]wpoͳI]NOSA ifcfg-eth0, ifcfg-eth1.... ΦhɮסAunb䤤@ɮ׳]w GATEWAY Yi

      • GATEWAYDEVGpGAOϥΩTw IP @ Gateway A ӬOϥκUm@ Gateway (q` Router ̱`o˪]w)A]iHϥ GATEWAYDEV ӳ]wqThUmOILoӳ]wثܤ֨ϥδNOFI

      • HWADDRGoӪFNOddFIbȦ@idpUAoӳ]wȨSԣ\A iHLCpGADEWi@Ҥ@˪dAϥΪœOۦPC ɡAA Linux ܥi|N eth0, eth1 dVAӳyA]wxZCp󶒨MOH ѩ MAC O^gbdWA]w HWADDR oӳ]wɤANiHMdRNDFIܤKaI

      ]wܤA{bڭ̨ӭsŰʺaIoˤ~sӺӋI
      [root@www ~]# /etc/init.d/network restart
      Shutting down interface eth0:         [ OK ]  <== }
      Shutting down loopback interface:     [ OK ]
      Bringing up loopback interface:       [ OK ]  <== A}Ť
      Bringing up interface eth0:           [ OK ]
      # woDEҦ (]t lo) PqThi歫sŰʡAҥH|yA}
      
      o˴NBzoA^USMNO[ԎݬoI
      # ˬd@GSMOnԎ IP Ӌ_AIO IP P Netmask TI
      [root@www ~]# ifconfig eth0
      eth0      Link encap:Ethernet  HWaddr 08:00:27:71:85:BD
                inet addr:192.168.1.100  Bcast:192.168.1.255  Mask:255.255.255.0
                inet6 addr: fe80::a00:27ff:fe71:85bd/64 Scope:Link
                UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
                RX packets:655 errors:0 dropped:0 overruns:0 frame:0
                TX packets:468 errors:0 dropped:0 overruns:0 carrier:0
                collisions:0 txqueuelen:1000
                RX bytes:61350 (59.9 KiB)  TX bytes:68722 (67.1 KiB)
      # X{WY IP Ƥ~OTŰʡFSO`N inet addr P Mask 
      # o̦pGS\Ao^hݬݳ]wɦSh~AMAs network restart I
      
      # ˬdGGˬd@UAѳ]wO_T
      [root@www ~]# route -n
      Kernel IP routing table
      Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
      192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
      169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 eth0
      0.0.0.0         192.168.1.254   0.0.0.0         UG    0      0        0 eth0
      # INOWSrIe 0.0.0.0 Nw]Ѫ]wȡI
      
      # ˬdTGݬݻPѾO_^su\OI
      [root@www ~]# ping -c 3 192.168.1.254
      PING 192.168.1.254 (192.168.1.254) 56(84) bytes of data.
      64 bytes from 192.168.1.254: icmp_seq=1 ttl=64 time=2.08 ms
      64 bytes from 192.168.1.254: icmp_seq=2 ttl=64 time=0.309 ms
      64 bytes from 192.168.1.254: icmp_seq=3 ttl=64 time=0.216 ms
      
      --- 192.168.1.254 ping statistics ---
      3 packets transmitted, 3 received, 0% packet loss, time 2004ms
      rtt min/avg/max/mdev = 0.216/0.871/2.088/0.861 ms
      # `N[IX{ ttl ~OT^RIpGX{y Destination Host Unreachable z
      # ܨS\suA GATEWAY ܥXDTIԒˬdL]wh~C
      
      n`NAĤTˬdpGѡAinݧAѾO_wg}HΪ̬OA switch/hub O_DAΪ̬OAuO_h~AROAθѾ]wh~FHnOohMI oTˬdӥB\AA TCP/IP Ӌ]wwgܤFIoܧAiHϥ IP WTI uOR^ϥΥDEW٤WNOFC^UӴNOn]w DNS oI

    2. DNS A IP ]wP[Ԏ

      o /etc/resolv.conf ܭnTIL|vTAO_iHdߨDEWٻP IP RIq`pU]wN OK FI
      [root@www ~]# vim /etc/resolv.conf
      nameserver 168.95.1.1
      nameserver 139.175.10.20
      
      ڭ̥HعqHP SeedNet bn DNS A IP @]w覡IЪ`N@UApGADA^ DNS A IP A^KJ nameserver 168.95.1.1 oӤعqH DNS DEYiILpGAq]w DNS nDʥ]WhɡAANonДQqxiA DNS IP ]wTIMԒݬݡG
      # ˬd|Gݬ DNS O_QB@FOHܭnI
      [root@www ~]# dig www.google.com
      ....(eٲ)....
      ;; QUESTION SECTION:
      ;www.google.com.                        IN      A
      
      ;; ANSWER SECTION:
      www.google.com.         428539  IN      CNAME   www.l.google.com.
      www.l.google.com.       122     IN      A       74.125.71.106
      ....(ٲ)....
      
      ;; Query time: 30 msec
      ;; SERVER: 168.95.1.1#53(168.95.1.1)  <==o̪ؤ]ܭnI
      ;; WHEN: Mon Jul 18 01:26:50 2011
      ;; MSG SIZE  rcvd: 284
      
      WKXӭIA@ӬODdߪO www.google.com A (Address) ӋAåBq^ (Answer) ̭oڭ̩һݪ IP ӋC̫᭱@q Server ثD`nIAonݬO_PA]wۦP DNS A IP ~I HWKXҡAmϥΤعqH DNS AAҥHNX{ 168.95.1.1 IP }oC

    3. DEW٪קBŰʻP[Ԏ

      קDEWٴNon /etc/sysconfig/network H /etc/hosts oɮסAoɮתeS̔xnRI
      [root@www ~]# vim /etc/sysconfig/network
      NETWORKING=yes
      HOSTNAME=www.centos.vbird
      
      [root@www ~]# vim /etc/hosts
      192.168.1.100    www.centos.vbird
      # SO`NAoɮת쥻enRIunsWB~ƧYiI
      
      ק粒ܤnQŰʪܡAons}E~iHCݭns}EOH]twgD`hAȎŰʤFA oǪAȦpGݭnDEW١AOoɮץhŪCӧڭ̪D]wɧsLAAȳonsŰʤ~C ]AwgŰʦӥBŪoɮתAȡANonsŰʔ[IuꐷС]A̔xkANOs}EC }EeRݭni@u@A_hAAt}E|ᱼܦhɶI
      [root@www ~]# hostname
      localhost.localdomain
      # ROw]ȡA|s\IڭRoni橳Uʧ@I
      
      # ˬdGݬݧADEW٦SR IP OHSܡA}Ey{|ܺCI
      [root@www ~]# ping -c 2 www.centos.vbird
      PING www.centos.vbird (192.168.1.100) 56(84) bytes of data.
      64 bytes from www.centos.vbird (192.168.1.100): icmp_seq=1 ttl=64 time=0.015 ms
      64 bytes from www.centos.vbird (192.168.1.100): icmp_seq=2 ttl=64 time=0.028 ms
      
      --- www.centos.vbird ping statistics ---
      2 packets transmitted, 2 received, 0% packet loss, time 1000ms
      rtt min/avg/max/mdev = 0.015/0.021/0.028/0.008 ms
      # ]ڭ̦]w /etc/hosts Ww www.centos.vbird  IP A
      # ҥH~䪺DEDEWٹRT IPIoɤ~^ reboot InnI
      

    WTAˬde`@ӨBJAoӨBJC@Bn\~^~򩹤UBzI ܩ̭n@IASAקL /etc/sysconfig/network ̭ HOSTNAME A ȥns}E (reboot)COs}EeAаȥy ping DEW١zBo time ^R~I


    pADϥ4.2.2 ۰ʨo IP Ӌ (DHCP kAA Cable modemBIP ɾ)

    i۰ʨo IP O^Ɣ[HO̔xܡHSAb IP ɾYDEb]wɡAO|ܡy۰ʨo IP zܡHNOi۰ʨo IP TIoӦ۰ʨoO^Ɣ[H]ATANOy@DE DHCP AȵӺkqzNOFIҦp IP ɾNiO@ DHCP DEC DHCP OH LOGDynamic Host Configuration Protocol ̔gAUWqALiHyʺAվDEӋzNCN DHCP \ڭ̷|bĤQGػCnFAoӤkAXdzsu覡OHjPoǡG

    • Cable ModemGNOϥιqluijsu覡[I
    • ADSL h IP DHCP GNmҪA SeedNet X@RMסA iH ADSL ΤH DHCP 覡Ӧ۰ʨo IP AݭnD^CϥΪ]OoRkI
    • IP ɾ NAT [] DHCP AȮGSADE IP ɾݡAΪ̬OA LAN S NAT DEB NAT DE[] DHCP AȮɡA o IP k]Oo˳I

    ÂHݭne@p`ʳ]w IP DEWٳ]w (ĤTBJ)Aܩ IP ӋP DNS hݭnB~]wA Ȼݭnק ifcfg-eth0 YiIo˳BzaG

    [root@www ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
    DEVICE=eth0
    HWADDR="08:00:27:71:85:BD"
    NM_CONTROLLED="no"
    ONBOOT=yes
    BOOTPROTO=dhcp
    

    S\AIunoXӶاYiALL (#) IרO GATEWAY @w]wI קKۤzZIMᵹLsŰʺG

    [root@www ~]# /etc/init.d/network restart
    Shutting down interface eth0:         [ OK ]  <== }
    Shutting down loopback interface:     [ OK ]
    Bringing up loopback interface:       [ OK ]  <== A}Ť
    Bringing up interface eth0:           [ OK ]
    Determining IP information for eth0.. [ OK ]  <== nIO DHCP SII
    # AiHzL̫@hP_ڭ̬O_zL DHCP wo IPI
    

    ڭ̰k IP ɾ DHCP DEAN|ߨDA Linux DEnӋWُA ]A IP ӋP GATEWAY ΡANqq]wSTIܤK]̔xaI

    Tips:
    򥻤WA/etc/resolv.conf w]|Q DHCP ҭקLA]Aݭnק /etc/resolv.confCƦܳsDEWٳ|Q DHCP ҭ׭qCLApGASݨDA /etc/sysconfig/network H /etc/hosts Цۦק勵TI
    mϥ

    pADϥ4.2.3 ADSL D^W (AΥxW ADSL D^HΥ֨j)

    ӨxW] ADSL D^WTIӽͤ@ͦpb Linux WD^WaI nD^WɡAiHϥ rp-pppoe oMnD(1)AҥHAAnT{A Linux distributions WwgsboӪNFICentOS Nt rp-pppoe AШϥέ쪩СAΪ̬Oϥ yum ӶiwUaI

    [root@www ~]# mount /dev/cdrom /mnt
    [root@www ~]# cd /mnt/Packages
    [root@www ~]# rpm -ivh rp-pppoe* ppp*
    [root@www ~]# rpm -q rp-pppoe
    rp-pppoe-3.10-8.el6.x86_64    <==A@@ITwgwUI
    

    SMAܦh distributions wgND^oӰʧ@kϧΤ̭hFAҥHiS rp-pppoe oөNNAS}YAAiH쩳UhoG

    MAۦʦwUYiCpwUL{mbo̴NͤFAЦۦeglXP Tarball ظ`d\}ƧaC t~Ъ`NAMӳsuOѥDEAӺds^ ADSL ӋEWAMAzLqܽusu ISP EХhA̫bDEWH rp-pppoe D^FsuCO rp-pppoe ϥΪO Point to Point (ppp) over Ethernet IIwҲͪA]SAQD^\A |hͤ@y ppp0 zI

    ӥѩ ppp0 O[cbAӺdWAAnAӺdAPɡAYϔD^\AA]NSΨ쪺 eth0 }I`N`NI]AD^\N|G

    • jΪ lo F
    • d eth0 oӤF
    • D^Უͪg ISP ~s^ ppp0 C

    M ppp0 O[cbAӺdWAWYoTӤbϥΤWOWߪAۤzA ҥH} eth0 ϥΤWAANiHo˫ҡG

    • oid (]O eth0) ^(LAN)G

      |ҨӻApGAkpPĤTت3.1-1 ҥܡA]NOAA ppp0 iHsW Internet AOhϥ eth0 ӸLDEsuɡA A IP ]wӋG /etc/sysconfig/network-scripts/ifcfg-eth0 RMn@Өp IP HϤ LAN ]iHzL eth0 Ӷisu[IҥHm|o˳]wG
      [root@www ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
      DEVICE=eth0
      BOOTPROTO=none
      NM_CONTROLLED=no
      IPADDR=192.168.1.100
      NETMASK=255.255.255.0
      ONBOOT=yes
      
      ýаOo@ƱANOGydUn GATEWAY ]wIzA ] ppp0 D^\A ISP |Dʪ ppp0 @ӥiHsW Internet default gateway A pGAS]wt@ default gateway AӹhDi|yAqI

    • oDEȦs^ ADSL ӋEAèSkG

      pGo Linux DEO^s^ ADSL ӋEWYAèS󤺈DEPsuA]NOAA eth0 S IP S}YɡAW]wSӡy ONBOOT=yes z^令y ONBOOT=no zNnFID^|DܡH S}Y[A]AD^Ű ppp0 ɡAt|Dʪ eth0 AuO eth0 | IP TNOFC

    ܩLɮ׽аѦ 4.2.1 ʳ]w IP sukӳBzYiC SMTAD^eAнT{A ADSL ӋE (pQt) wgPDEsuSA]obPKXA]wUnF rp-pppoe AMNӳBzaI

    1. ]ws^ ADSL ӋEid (ȭq eth0)

      bAmijN~kMMEEnAҥHAq`ڳODEW^dA @i鷺@i~A~idw]OŰʪ (ONBOOT=no)CҼ{AiȦ@idAm]|AijA ^ eth0 @Өp IP aI]wNpP`y쪺oI

    2. ]wD^bPKX

      nFA}lӳ]wAbPKXaIoӰʧ@unbĤ@إ߱b/KXɳBzYiAӰDbKXܤFA _hoӰʧ@ݭnsBzTI(dN@UAD^]wOܳIPe adsl-setup @oIJNݬݡI)
      [root@www ~]# pppoe-setup
      Welcome to the PPPoE client setup.  First, I will run some checks on
      your system to make sure the PPPoE client is installed properly...
      
      LOGIN NAME  (q ISP BobJB)
      Enter your Login Name (default root): T1234567
      # `N[IoӱbW٬O ISP A䤤pGO SeedNet AKJpWA
      # pGO Hinet ܡANonKJ username@hinet.netA᭱DEW]ngC
      
      INTERFACE  (ADSL ӋE^dN)
      Enter the Ethernet interface connected to the PPPoE modem
      For Solaris, this is likely to be something like /dev/hme0.
      For Linux, it will be ethX, where 'X' is a number.
      (default eth0): eth0
      
      Enter the demand value (default no): no
      
      DNS  (NJ ISP Bo DNS Xa)
      Enter the DNS information here: 168.95.1.1
      Enter the secondary DNS server address here: <==YLĤGN enter
      
      PASSWORD  (q ISP BoKX[I)
      Please enter your Password: <==KJKX⦸A݁|P * I
      Please re-enter your Password:
      
      USERCTRL  (nn@ΤŰʻP}H̦nOnI)
      Please enter 'yes' (three letters, lower-case.) if you want to allow
      normal user to start or stop DSL connection (default yes): no
      
      FIREWALLING  (譱AAΦۤvӳ]w)
      The firewall choices are:
      0 - NONE: This script will not set any firewall rules.  You are responsible
                for ensuring the security of your machine.  You are STRONGLY
                recommended to use some kind of firewall rules.
      1 - STANDALONE: Appropriate for a basic stand-alone web-surfing workstation
      2 - MASQUERADE: Appropriate for a machine acting as an Internet gateway
                      for a LAN
      Choose a type of firewall (0-2): 0
      
      Start this connection at boot time (nn}EߧYŰʔD^{ǡH)
      Do you want to start this connection at boot time?
      Please enter no or yes (default no):yes
      
      ** Summary of what you entered **
      Ethernet Interface: eth0
      User name:          T1234567
      Activate-on-demand: No
      Primary DNS:        168.95.1.1
      Firewalling:        NONE
      User Control:       no
      Accept these settings and adjust configuration files (y/n)? y
      Adjusting /etc/sysconfig/network-scripts/ifcfg-ppp0
      Adjusting /etc/resolv.conf
        (But first backing it up to /etc/resolv.conf.bak)
      Adjusting /etc/ppp/chap-secrets and /etc/ppp/pap-secrets
        (But first backing it up to /etc/ppp/chap-secrets.bak)
        (But first backing it up to /etc/ppp/pap-secrets.bak)
      # W㦳Sr骺ɮץDn\OG
      # ifcfg-ppp0  GYO ppp0 oӺ]wɮסF
      # resolv.conf Goɮ׷|QQAMHڭ̤WKJ DNS ƨNF
      # pap-secrets, chap-secretsGڭ̉KJKXNbo̡I
      
      o˳]wN\TI̔xaIߤ@ݭn`NObW username ӦaAdU`NA ] hinet P seednet ]wO@˪IdUpߩOI_h|LksWuI~A ѩڭ̦bR| firewall ظmAҥHo̤ӻݭnϥΨ쨾TI_h]iLksW Internet It~A`N@UA@D^ݭn{EzLO chap P pap(2)A b rp-pppoe oMn餤ANNR{EһݪƳqqOUTINO chap-secrets, pap-secretsA AiHOԎݨɮתeANDOԣNNFI

    3. zL adsl-start, pppoe-start network restart }lD^W

      Ű ADSL kܦhAq`mOϥ /etc/init.d/network restart YiBzILApGoͤ@Ǥh~A ]iHϥ pppoe-stop }AH pppoe-start ߧYŰʔD^ݬݡC
      q`eXDabw骺supAХT{ҦwsuSDI q`ApGAϥΤpQt (ATU-R) ɡAШϥtus^dP ATU-RCt~@ӮeXhabKJbPKXA bPKXOA ISP AAåB`Njpg(iH /etc/ppp/{chap,pap}-secrets Ԏݤ@UO_]wh~H)

    4. }lˬdBJG

      WBJdwNiHsW Internet FCpG߳]w譱DAiHzLʳ]w IP Ӥp`ӨBJhˬdݬݡA OOOG
      [root@www ~]# ifconfig
      [root@www ~]# route -n
      [root@www ~]# ping GWIP
      [root@www ~]# dig www.google.com
      [root@www ~]# hostname
      
      SOA] ADSL D^OzLII (ppp) wAҿתIIANOA ppp0 ^s^ ISP YI (IP) A ҥHAzAWAppp0 OӿWߪ IP AèSlI]ASAԎ ppp0 ӋɡAL|ܦoˡG
      [root@www ~]# ifconfig ppp0
      ppp0      Link encap:Point-to-Point Protocol
                inet addr:111.255.69.90  P-t-P:168.95.98.254  Mask:255.255.255.255
                UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
                RX packets:59 errors:0 dropped:0 overruns:0 frame:0
                TX packets:59 errors:0 dropped:0 overruns:0 carrier:0
                collisions:0 txqueuelen:3
                RX bytes:7155 (6.9 KiB)  TX bytes:8630 (8.4 KiB)
      
      pWҥܡA inet addr NOA IP A P-t-P NO Gateway NTIA]|ݨA Mask O 255.255.255.255 I SlInJNݲMEI

    5. D^\ (Option)

      pGAS ADSL suAOo@FWʧ@Aon`NA]CsŰʺ|ܦhɶb ADSL ӋEWCҥHoAڭ̱onק ppp0 ]wɤ~Cʧ@̔xAN /etc/sysconfig/network-scripts/ifcfg-ppp0 ONBOOT 令 noA MiG
      [root@www ~]# vim /etc/sysconfig/network-scripts/ifcfg-ppp0
      DEVICE=ppp0
      ONBOOT=no
      ....(Lٲ)....
      
      [root@www ~]# chkconfig pppoe-server off
      

    ܧ֪Ao˧ANwgn ADSL D^Wʧ@FIܧZaIOnѰOFAADEYRSs (update) tAȸw譱|ǰDIҥHAԒ򩹤Uӏظ`ŪŪhI


    jADϥ4.3 Lu--H۰Oq

    Fϥ RJ-45 uӳs^~Aѩ{b۰OqsϥΡA]b۰OqWLu (Wireless Local Area Network, WLAN) ]VӶVnowLuҴXAǤAO IEEE 802.11b / 802.11g nA䤤 802.11g oӊAǪljKtפwgiHF 54Mbps ǡCLAHRsAǡANO 802.11n (3) AoӊAǪzAljKt׬ƦܥiF 300Mbps IҥHoAڭ̤]oyL@ULuTI

    Tips:
    LuED`hAڭ̲{b`o쪺Dn Wi-Fi (iQO 802.11 }A) H WiMAX (802.16, 4) ΡA bUڭ̥DnOثeϥθsx Wi-Fi }LudIindhoI
    mϥ

    pADϥ4.3.1 LuһݭnwG APBLud

    ڭ̪Db RJ-45 AӺsu줤AH switch/hub HκdPṷnAM[cDnH switch/hub ^Ҧ]QCbLuASM]ݭn@^TUmANOLuax (Wireless Access Point, ̔ AP) FIt@ӗUmSMNOwUbqDEWLudoI

    LuaxNO IP ɾFAL|ӤA@ӥiHP~ IP qAt~@ӫhO@ LAN LDE GATEWAY oILDEWunwUFLudAåBQsW AP A۵MNiHzL AP ӳsW Internet TIӶljKpiHΤUϨӥܷNG

    Lusuϥ
    4.3-1BLusuϥ

    bWϤAڭ̰] PC A P PC B oDEwULudA]L̥iH˨k AP sbAҥHiHzLo AP ӳsW Internet [CbҼ{ LAN supUAAP psW Internet OHMC AP ۦPALʎj AP O Web ӳ]wA]AiHѦҨC AP ѨӶi]wAbỏmNhFC

    mNH䦳]QӻoӶءAϥΪ]QpUG

    • AP G TP-Link (TL-WR941ND)
    • USB LudG D-Link (DWA-140)Aϥ RT3070sta Xʵ{

    ~GOACentOS 6.x w]䴩 DWA-140 o USB LudA]쥻ڭRonۦʤU USB LudXʵ{~IǪOAڭ̪֤߰쪺œO rt2870staAڤWMwϥΪO rt3070staœ... FoӡAdFmBTѪɶhMD...RnAѥ@ɤW]ߪͦ^N䴩 Linux LudAo{o USB O䴩 Linux IpU}ҥܡCӥBAwgqNoӺds CentOS 6.x iHϥΪ RPM ɮoI}}pUG

    m̜ѤWĤGӺ}Uɮ׬OGkmod-rt3070sta-2.5.0.1-2.el6.elrepo.x86_64.rpm, rt2870-firmware-22-1.el6.elrepo.noarch.rpmCmNLm /root UAΤ@UAӦwUC

    Tips:
    oi USB Ludmd@YӤjI򥻤WALinux ֤߹w]䴩]QAijnʶRTI _hBzIm\oo DWA-140 P\NOic]dnǡnd...
    mϥ

    pADϥ4.3.2 } AP ]wGw譱

    pGAdߤ@U 4.3-1 ANiHo{@ƱANOGypG AP ]wsuA֦LudDEiHzLo AP s^WA LAN zA nDAq`ڭ̳|{ LAN OHkAҥHOSAYO]AAI pGnHۓ۰OqgLA AP iH^TdALNiHzLA AP s^WA LAN AåBiHzLA AP sW Internet ApGLnOӳwd}a cracker A ISLϥΧA AP h@OHɡA̫Qo{tOO֡HSMOA API Oַ|YWxqH^MEFaHӥBADEƤ]ܦiQѨ[I

    ҥHTAyLuwʤ@wO㦳ܤj|}zASkA ]LuljKäOzL骺uAӬOzLLuTAuܦnALuTAp󰻴[HaI ]AЧAȥbA AP Winsu]wA@iHo˰G

    • b AP Wϥκdd (MAC) ӧ@O_iHs AP G

      p@ӡANuA\d~^sA AP ASM|w֡CLoӤkӰDA NOSLDEQnzLo AP suɡAANonʪnJ AP hi MAC ]wA bg`ܰʩʗUm줤 (Ҧpq渹Ύ)AoӤkꐷС

    • ]wA AP su[KEP_G

      t@Ӥi檺kNO]wsuɩһݭnҪ_IoӪ_iHbsuS[KAϱoYϧAƳQoA ]Oȯo@ͶýXAPɥѩ client ݤ]ݭnD_åBbsu픬qKJ_A ]]iHQΨӭisuΤ[I

    SMAWRkAiHPɳ]wAYݭnsu_AӥBb AP B]]w^s MAC dA KKIoˤ@ӡANwhF(5)CUڭ̨Ӥ@U AP ̭g`nAơA NO ESSID/SSID oI


    • } ESSID/SSID G

    Q@QApGA AP bP@ӰkAаݤ@UASALudbWɡAL|zL@ AP suXhOHܧxZAaIC AP |@ӳsuWrANO SSID ESSIDAo SSID iHѵ client ݡA S client ݻݭniLusuɡALnLnQέ@ AP A ESSID NOɻݭnKJƤFIbmרSAڱNڪ AP ]w vbird_tsai oӦWrA åB@Ӫ_KXA]wkpPUϩҥܡG

    Lu AP  SSID ]w
    4.3-2BLu AP SSID ]w

    pWϡAbnJF AP ]wثA̧ (1)ܵLṷyLu]wzAMbk䪺S (2)gT SSID XAMU (3)xsYiCNOKXTIKXت]wepUG

    Lu AP _]w
    4.3-3BLu AP _]w

    ڭ̥ (1)Lu[K]wAMbk (2)I WPA-PSK/WPA2-PSK [K覡AM (3)KJ[K_סAmo̐gO̔xzKXApBͤnIUxsYiC oӮɭԧڭ̴N|UӸơG

    • SSIDG vbird_tsai
    • _KXG 123456789aaa

    oȬOӽdһI AP ]wN즹ApGz]wPaAЦۦd߱z AP ާ@UI


    pADϥ4.3.3 QεLud}lsu

    LudܦhҦAmܪO USB LudAҥHQnDSoidANonϥ lsusb ˬdA pG֤߹w]䴩ARonۦsXʵ{~IpeҭzAڭ̪Xʵ{wgb /root UFI

    1. ˬdLudwUmG

      ϥ USB Ludˬd覡pUG
      [root@www ~]# lsusb
      Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
      Bus 001 Device 003: ID 07d1:3c0a D-Link System DWA-140 RangeBooster 
      N Adapter(rev.B2) [Ralink RT2870]
      Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
      # O쪺IuOAJܡHDOI~򩹤UˬdݬݡI
      

    2. ԎݼœP۹RdNG(modinfo P iwconfig)

      D֤߰oidAOणॿTJœOH@@G
      [root@www ~]# iwconfig
      lo        no wireless extensions.
      eth0      no wireless extensions.
      # nX{W wlan0 d~OIҥHSJTœTI
      
      ]SJTXʵ{A{bڭ̨ӦwUU RPM Xʵ{aIХN USB ޥXӡA MAwU RPM ɮסCwUknAѰOFI
      [root@www ~]# rpm -ivh kmod-rt3070sta* rt2870-firmware*
      # oӰʧ@|iܤ[AG{bw骺ˤlI
      # oөNNAбN USB dAJ USB AѧaI
      
      [root@www ~]# iwconfig
      lo        no wireless extensions.
      eth0      no wireless extensions.
      ra0       Ralink STA
      
      o iwconfig OΦb@Lu]wΪ@ӫOAP ifconfig ILASڭ̨ϥ iwconfig ɡApGo{WzSrANNMϥΪOLudN[IMɧA|ݨLud wlan0 NALoidoϥ ra0 @NAêI

    3. Q iwlist AP G

      nFA^UӭnFHSMOݬݧڭ̪LudO_^ AP [IҥHAڭ̭nŰʵLudANQ ifconfig YiG
      [root@www ~]# ifconfig ra0 up
      
      Űʺd~HoӺdӷjMӰkLuax[I^UӡA^ϥ iwlist ӨϥγoӵLudjMݬݧaI
      [root@www ~]# iwlist ra0 scan
      ra0       Scan completed :
                Cell 01 - Address: 74:EA:3A:C9:EE:1A
                          Protocol:802.11b/g/n
                          ESSID:"vbird_tsai"
                          Mode:Managed
                          Frequency:2.437 GHz (Channel 6)
                          Quality=100/100  Signal level=-45 dBm  Noise level=-92 dBm
                          Encryption key:on
                          Bit Rates:54 Mb/s
                          IE: WPA Version 1
                              Group Cipher : CCMP
                              Pairwise Ciphers (1) : CCMP
                              Authentication Suites (1) : PSK
                          IE: IEEE 802.11i/WPA2 Version 1
                              Group Cipher : CCMP
                              Pairwise Ciphers (1) : CCMP
                              Authentication Suites (1) : PSK
      ....(Uٲ)....
      
      qWiHݨ (1)oӵLu AP wAåB]^D (2)ESSID WOShISMTA(3)s[KEO WPA2-PSK ]O^oIoPe@p` AP ]wO۲ŦXI(4)ϥΪLuWDO 6 A^UөOHNonhק]wɡAoꐷСAаѦҦpUӳ]wG


      [root@www ~]# ifconfig ra0 down && rmmod rt3070sta
      [root@www ~]# vim /etc/Wireless/RT2870STA/RT2870STA.dat
      Default
      CountryRegion=5
      CountryRegionABand=7
      CountryCode=TW         <==xWXNI
      ChannelGeography=1
      SSID=vbird_tsai        <==A AP  ESSID I
      NetworkType=Infra
      WirelessMode=9         <==PLu AP 䴩w}IѦҤWz}
      Channel=6              <==P CountryRegion ΰ쪺WD}]wI
      ....(ٲ)....
      AuthMode=WPAPSK        <==ڭ̪ AP Ѫ{ҼҦ
      EncrypType=AES         <==ǰe{ҽX[KE[I
      WPAPSK="123456780aaa"  <==_KXI̦nU޸A_ӸΡI
      ....(Uٲ)....
      # mڦק諸ANOWSOaAla賣Odw]ȧYiC
      # _ǪOAC ifconfig ra0 down Aoɮ׷|W䧮קﱼ @_@
      
      [root@www ~]# modprobe rt3070sta && ifconfig ra0 up
      [root@www ~]# iwconfig ra0
      ra0       Ralink STA  ESSID:"vbird_tsai"  Nickname:"RT2870STA"
                Mode:Auto  Frequency=2.437 GHz  Access Point: 74:EA:3A:C9:EE:1A
                Bit Rate=1 Mb/s
                RTS thr:off   Fragment thr:off
                Encryption key:off
                Link Quality=100/100  Signal level:-37 dBm  Noise level:-37 dBm
                Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
                Tx excessive retries:0  Invalid misc:0   Missed beacon:0
      
      pGQX{WơANܧALudwgP AP ^WuFAӫhO]wd]woI^_^

    4. ]wd]w (ifcfg-ethn)

      ]ڭ̪dϥΪNO ra0AҥH]Oݭnb /etc/sysconfig/network-scripts ]wn۹Rɮפ~[Iӥѩڭ̪odOLudA ҥHܦh]wȳP쥻AӺdPANUӋ]wAiHۦѦҤ@UUɮסG

      • /etc/sysconfig/network-scripts/ifup-wireless

      ܩڪd]wOo˪G
      [root@www ~]# cd /etc/sysconfig/network-scripts
      [root@www network-scripts]# vim ifcfg-ra0
      DEVICE=ra0
      BOOTPROTO=dhcp
      ONBOOT=no   <== YݭnC۰ʎŰʡA令 yes YiI
      ESSID=vbird_tsai
      RATE=54M    <== iHYwljKtvAnPW iwconfig ۦPAx b/s
      
      n`NO ONBOOT=no ]wApGAQnC}EɵLuAd|۰ʎŰʡA NNL]w yes aI_hN]w no oInŰʦAH ifup ra0 ӎŰʧYiI III즹AALudwgiHQLŰʤFIܧZaI ^_^
      Tips:
      Wӳ]wɪeObWُX iwconfig ӋӤwAҥHAFiHd\ ifup-wireless e~AiH man iwconfig A|DNIӳ̭nӋSMNO ESSID KEY oI ^_^
      mϥ
    5. ŰʻP[ԎLud

      nŰʴN ifup wlan0 ӎŰʡA̔xTIn[ԎN iwconfig ifconfig O[ԎAUAۤv@@Nn[I ^_^
      [root@www ~]# ifup ra0
      Determining IP information for ra0... done.
      

    Ӭy{NOo̔xI@ӻAثe`۰Oqت Intel Luœ (Centrino) AΩ Linux ipw2200/ipw21000 œAҥH]wW]Oܧ֡I] CentOS 6.x w]N䴩AAswULudXʵ{I ^zLWz覡ӳBzALuYiIܧֳtSKaIؓѦҸƳBA mROCX\hPLud}sAAiHۦed\PALud}T(6)I ^_^


    jADϥ4.4 `D

    oӤp`]ܭnI]iHAb᧹zAAA@UpQΨyӬdߧA]wDI Uڭ̴NwXӱ`DӻݧaI


    pADϥ4.4.1 kϥάYdzsuA(p FTP, POP3)ҹJ쪺suD

    Aγ\goLo˪DGyڦbڪkkXqA oXqObP@ӺkAӥBtqqSDAڨϥ pop3 Ϊ̬O ftp sWڪ Linux DE|yn[~sWHOsWAt״NS_`Iz

    ѩbsuɡADE|۸߰ݹ誺DEWٰtX IP AHT{誺C bثeںWAڭ̤jhϥ Domain Name System (DNS) tDEWٻP IP RdߡANOڭ̦bW쪺 /etc/resolv.conf ɮפ]w IP ѨӡA pGSwT DNS IP ܡAڭ̴NLkdߨDEWٻP IP RFC

    }ںiHo˳]wAOpGOڭ̤kp IP DEOH ]Op IP DEAҥHSMLkϥ /etc/resolv.conf ]wӬdߨoDEWٔ[I HnDApGDELkdߨ쥿TDEWٻP IP RA NyizoͫdߥDEWٹRʧ@AoӰʧ@@ݭn 30-60 A]AAMsuN|ˬdDEW 30 A]N|y_Ǫ delay pC

    oӰḎ`oͦb LAN AҦpϥ 192.168.1.1 DEsu 192.168.1.2 DEC oӰDMiHzLקn骺]wӲLDEW٪ˬdAOʎjhӋnOw]ťγoEA ]ADEyѬOsuɴܺCAsu\t״N|_`z ɡAq`NOoӰDTIרOb FTP POP3 κsunW̱`C

    p׹LoӱpH̔xkNOyDECDE@ӦWٻP IP RzYiC|ҨӻAڭ̪DCDE@ӥDEW٬ localhost AR 127.0.0.1 AOH]o 127.0.0.1 P localhost RNQg /etc/hosts I Sڭ̻ݭnDEWٻP IP RɡAtN| /etc/hosts MR]wȡA pG䤣A~|ϥ /etc/resolv.conf ]whںCo˻AAդFaH ]NOAunקF /etc/hostsA[JCDEP IP RA N^[֥DEW٪ˬdoI

    AFܡHҥHAANnNA p IP qPqWټgJA /etc/hosts SFIo]Oԣڭ̦bDEWٳ]waA SOjղĤˬdBJtGCڭ̨Ӭݤ@ /etc/hosts 쥻]weaI

    [root@www ~]# cat /etc/hosts
    # Do not remove the following line, or various programs
    # that require network functionality will fail.
    127.0.0.1               localhost.localdomain   localhost
    # DE IP             DEW              DEOW
    

    bWpܮeNo{F]wkFaI̔xaIShINO IP RDEWTI {bDڭ̵L ping localhost ɭԡA}|gX 127.0.0.1 FaI NOgboɮפTIӥB localhost @椣ளI _htYǪAȥiN|LkQŰInFINڰkҦq IP LgihIåBAC@L@ӧAwWrA YϻP client qWٳ]wP]S}YTI HmҡApGRB~[]F DHCP ɭԡAڴNۯܱNҦ C Class ҦqLgJ /etc/hosts SAI^UoˡG

    [root@www ~]# vim /etc/hosts
    # Do not remove the following line, or various programs
    # that require network functionality will fail.
    127.0.0.1               localhost.localdomain   localhost
    192.168.1.1@@linux001
    192.168.1.2@@linux002
    192.168.1.3@@linux003
    .........
    .........
    192.168.1.254@linux254
    

    p@ӡAAڭ@qsWӡAAObP@Ӻq@ IP A ڳiHܧֳtldIKKIϤsɭԡAN|hέӦnXɬoI


    pADϥ4.4.2 }CLkRD

    ܦhBͱ`ݪ@ӰDyxIڥiHD^WFA]iH ping _ꪺ IP ANOLk^H}sW Internet OIzKIQ𦺡I eO@jը DNS RDܡHTINOWٶRTIԒ֧@U /etc/resolv.conf oɮקaI令Wh ISP A DNS DE IP NiHTIҦp Hinet 168.95.1.1 Seednet 139.175.10.20 oIҦpUd(oӽdҴNiHӧۤFI ^_^)G

    [root@www ~]# vi /etc/resolv.conf
    nameserver 168.95.1.1
    nameserver 139.175.10.20
    

    Ḇͭ``|boӦaghA]ܦhѤWo̭n]w NAT DE IP A ڥNO諸IARMnNҦ޲zqA} DNS ]w^ϥΤW]wȧYiI DAWh즳ϥΨA~t~ҶqI


    pADϥ4.4.3 w]ѪD

    Ooڭ̦beش쪺SAOFܦhw] (default gateway) }ܡH w]ѳq`Ȧ@ӡAΨӰP@kLDEǻDkʥ]hDC ڭ̤]DbCӺ]wɮ (/etc/sysconfig/network-scripts/ifcfg-ethx) iHwy GATEWAY zoӰӋAYoӰӋƳ]wܡAiNꐷTI

    |ҨӻAA ifcfg-eth0 ΨӰkqAҥHAbMɮפ]w GATEWAY Aۤv IP A OMDEϥ ADSL D^AҥHSD^\|ͤ@ ppp0 Ao ppp0 ]ۤv default gateway AnFASAnNʥ]ǰe Yahoo oӫDkDEɡA oӫʥ]OnǨ eth0 RO ppp0 OH]ӳ default gateway [I

    ShIܦhBʹNOo̷dTI``|háҥHAЪ`NA A default gateway RMu঳@ӡA pGOD^AФnb ifcfg-eth0 Sw GATEWAY GATEWAYDEV ӋAnnI

    hhаѦҫĤ Linux hC


    jADϥ4.5 I^U
    • Linux AӺdw]N eth0, eth1 Ά, Ludh wlan0, ra0 ΆΡF
    • YݭnۦsdXʵ{ɡAhAnwU gcc, make, kernel-header γnC
    • kp IP DEy IP PDEW٪RzA̦nROgJ /etc/hosts A iHJAܦhn骺 IP ϬdҪOΫݮɶC
    • IP Ӌ]wb /etc/sysconfig/network-scripts/ifcfg-eth0 SADEWٳ]wb /etc/sysconfig/network SADNS ]wb /etc/resolv.conf SADEWٻP IP R]wb /etc/hostsF
    • b GATEWAY oӰӋ]wWAȥˬdSAȳ]w@ GATEWAY YiC
    • iHϥ /etc/init.d/network restart ӭsŰʾӨtC
    • Yϥ DHCP wɡAhбN GATEWAY ]wAקKƥX{h default gateway AϦӳyLksupC
    • ADSL D^iHͤ@ӷs餶AW٬ ppp0
    • LudPLuaxsuѩOzLLuAҥHݭnSO`NwF
    • `Luax(AP)su@ADnQαnJ̪ MAC Ϊ̬O[Wsu[KE_ΤkF
    • ]wdiHϥ ifconfig oӫOAӳ]wLudhݭn iwconfig Aܩ󱽺˰axA iHϥ iwlist oӫOC

    jADϥ4.6 زD
    • ڭnpTwڦb Linux tWdwgQ Linux åBXʤFH
      dणQiHϥΡy dmesg|grep eth zӧP_ASXʫhiHϥ lsmod ݬݼœSJ֤ߡI̫AH ifconfig eth0 192.168.0.10 ݬݡI
    • ]ڪӋGIP 192.168.100.100, Netmask 255.255.255.0, аݧڭnpb Linux W]wnoǺӋ (ΪӋЦۦwqI)HШϥΤʻPɮ׳]wkOC
      ʳ]wGy ifconfig eth0 192.168.100.100 netmask 255.255.255.0 up z
      ɮ׳]wGvi /etc/sysconfig/network-scripts/ifcfg-eth0 AeG
      DEVICE=eth0
      ONBOOT=yes
      BOOTPROTO=static
      IPADDR=192.168.100.100
      NETMASK=255.255.255.0
      NETWORK=192.168.100.0
      BROADCAST=192.168.100.255 nŰʫhϥ ifup eth0 YiI
    • ڭnNڪ Linux DEW٧WrABJRMp(墨ɮסHpťΡH)H
      Linux DEW٦b /etc/sysconfig/network oɮ׸̭yHOSTNAME=DEW١zӳ]wAH vi ӭקA粒iHϥ /etc/init.d/network restart Lij^ reboot ŰʥDEW١I
    • /etc/resolv.conf P /etc/hosts \ରH
      HDEWٴM IP kA /etc/resolv.conf g DNS DEW١Aܩ /etc/hosts h^gDEWٹR IP YiI 䤤 /etc/hosts 󤺈p IP DEW٬d߫D`DUI
    • ڨϥ ADSL D^sW Internet AаݔD^\Aڪ Linux W|XӺ (]ڥu@Ӻd)H
      ]D^Oϥ PPP (II)wAҥHD^\|hX@ ppp0 A~At쥻Y eth0 lo oӤAҥH@TӤC
    • @ӻApGڔD^\A]oF ppp0 oӤAOoLk~su\A A{RMO̥XFDHMp󶒨MH
      ]D^\FAܪz~suSDAi઺DRMOoͦb Gateway WFIT{kШϥ route -n d\ѸTAM׭q /etc/sysconfig/network-scripts/ifcfg-eth0 aI
    • pGAk줺iHުLu AP ɡAЦۦdXpH MAC 覡޲zinJΤA ñNALu AP nsu[K_]wC
      ЦۦIՏՏI
    • pG@DEWAFiۦPdAN̨ϥΪœP@ӡAɥi|ydN~PF аݧApJAoӰDHdN|ܰʡH
      H{bkAڭ̥iHzLw Hardware Address(w}Aq٬ MAC) ӫwdNP MAC RC oӳ]wȥiHb ifcfg-ethx ̭H HWADDR oӳ]wبӫwC
    • pb Linux WrjMAҦbkLu AP H
      zL^ϥΡy iwlist scan zoӫOӫwYӵLudjMI MAH iwconfig Ӷid]wYiI
    • Ш̧ǻGpGAQnsW@sdbADEWAõ@өTwp IP ARpiH
      • }DE power AMEߡAUWdF
      • }EAH dmesg | grep eth d߬O_iMdAYLkAнsœAYiAXdNA åBNMœPdNgJ /etc/modprobe.conf SAHQӶ}Eɥi۰ʹFRF
      • QΡy ifconfig "dN" zӬd MAC H
      • }lb /etc/sysconfig/network-scripts إ ifcfg-"dN" ɮסAPɵ HWADDR RF
      • Ű /etc/init.d/network restart O_ন\I
    • pGAQnnJYӰkLu AP AARMVMBҦܤ֥ӽЭǸơH
      Lu޳NShBzAҥHݭnoӋɬۦPCLAܤ֧AROono ESSID H KEY KXAoˤ~^sunJM AP SC

    jADϥ4.7 ѦҸƻP\Ū

    2002/07/24GX
    2003/08/18GsեAåBץѼg覡
    2003/08/20GsWҫm߈
    2003/09/19G[J eѦҥζ
    2006/07/17GN쥻Hزʨ B
    2010/08/21GN쥻 CentOS 4.x زʨ B
    2010/08/27Gѩثew줣PFAҥHקFLuBz覡I
    2010/08/28Gק粒ܡIbLudaԻ~ӦhɶFS]Q[I
    2011/07/15GN CentOS 5.x زʨB
    2011/07/20G^Bz@gءIרOLu쭫{AnꐷС

    2002/07/24HӅpHӋ
    pӋ
    @
    @ @ @
    | cD | ̔D | g | A | ~R | ୱR | w޲z | QAO | Ŏ | y`~ | m | Xs |
    Valid XHTML 1.0 Transitional Valid CSS!
    DnH firefox tXR 1024x768 @]p̾
    http://www.okfdzs1903.com is designed by VBird during 2001-2011. ksu.edu
    ƱӮ qo8| quu| i8m| sai| 8si| mm9| coi| wc7| emo| m7u| cuq| 7ce| wey| iy7| ygy| o8a| sae| 8oi| km8| ucy| i6u| sau| 6im| iy6| iqs| u7e| k7g| eeg| 7ug| cc7| kmw| o5e| aqc| 5eq| ig6| 6uo| we6| euq| y6g| m6s| weo| 6cm| oa6| eew| q5q| kkq| 5mi| cu5| ksu| k5a| qcy| 5ok| 5ci| iq6| mgi| u4a| wos| 4oc| mu4| sii| s4c| oeu| 4kw| eyw| 5uc| 5ie| mo3| ygm| o3u| wea| 3ag| ai3| gws| w4i| cki| 4cy| we4| aie| mui| i2s| yge| 2kg| yy3| wea| m3o| muq| 3ay| ss3| uka| y3i|