Linuxϵͳ¹ÜÀíʵ¼ù(10)£ºPPPoEÉÏÍøÅäÖÃ
µ±Ê¹ÓÃDSLÁ¬½ÓÉÏÍøʱ£¬Èç¹ûÄãʹÓÃÊÇÓй̶¨»ò¾²Ì¬IPµØÖ·µÄDSLÁ¬½Ó£¬ÄÇôÅäÖò½ÖèºÍÇ°ÃæµÄ“ÍøÂçÅäÖÔÖÐÃèÊöµÄÊÇÒ»ÑùµÄ¡£Äã°ÑÒÔÌ«Íø½Ó¿ÚÁ¬½Óµ½DSL modemÉÏ£¬ÅäÖÃISPÌṩµÄIPµØÖ·£¬×ÓÍøÑÚÂ룬¹ã²¥µØÖ·£¬ºÍÍø¹ØÐÅÏ¢¡£ÖØÆôÍøÂçÉ豸ºóÄã¾ÍÓ¦¸ÃÁ¬ÉÏÍøÁË¡£¼Çס£¬Äã¿ÉÄÜ»¹ÐèÒªÕýÈ·µØÅäÖÃDNS·þÎñÆ÷¡£Èç¹ûÄãʹÓõÄÊÇÓÐDHCP»ò¶¯Ì¬IPµØÖ·µÄDSLÁ¬½Ó£¬ÄÇô¹ý³Ì¾Í²»Ò»ÑùÁË¡£ÄãµÄISP»áΪÄúÌṩһ¸öPPPoE£¨PPP authentication over Ethernet£©µÄÓû§ÃûºÍÃÜÂ룬Õ⽫ʹÄúµÄµçÄÔÔÚÿ´ÎÆô¶¯Ê±Í¸Ã÷µØµÇ¼µ½»¥ÁªÍøÉÏ¡£×¢Òâ³ý·ÇÄãÌرðÉêÇ뾲̬IPµØÖ·£¬Ò»°ãÇé¿öÏÂISP¶¼ÊÇÏòÄãÌṩһ¸ö»ùÓÚDHCPµÄÁ¬½Ó¡£¶øDHCP·ÖÅä¸øÄãµÄ»úÆ÷»òÕß»¥ÁªÍø·ÓɵÄIPµØÖ·¿ÉÄܺܶàÌ춼²»»á¸Ä±ä£¬Äã¿ÉÄÜ»áÎóΪÊǾ²Ì¬µÄ¡£
1¡¢RedHat/FedoraÅÉϵ£º
ÐèÒª°²×°rp-pppoeµÄRPMÈí¼þ°üÀ´Ö§³ÖÕâ¸ö¹¦ÄÜ£¬Í¨³£ÊÇrp-pppoe-3.5-8.i386.rpm¡£ÔÚ°²×°RPMºó£¬ÄãÐèÒª¾¹ýÈô¸É²½ÖèÀ´Íê³ÉÁ¬½Ó¡£PPPoEÅäÖý«´´½¨Á¢Ò»¸öÃûΪppp0µÄÐéÄâ½Ó¿Ú£¬Ëü½«Í¨¹ýÎïÀíÍøÂç½Ó¿Úeth0µÄÀ´Á¬½Ó¡£»ù±¾µÄ¹ý³ÌÈçÏ£º
£¨1£©±¸·Ý/etc/sysconfig/network-scripts/ifcfg-eth0Îļþºó£¬±à¼ÄãµÄifcfg-eth0Îļþ£¬É¾³ýIPÐÅÏ¢£¬²¢ÇÒÉ趨ÔÚÆô¶¯Ê±¼¤»î¡£
DEVICE=eth0
ONBOOT=yes
È»ºóÓà ifdown eth0¹Ø±ÕÍø¿¨É豸¡£
£¨2£©ÔËÐÐadsl-setupÅäÖýű¾£ºËü»áÌáʾÄãÊäÈëÄãµÄISPÓû§Ãû£¬ÒªÊ¹ÓõÄÍøÂçÉ豸£¨eth0£©ºÍÊÇ·ñÄãÐèÒªÁ¬½Ó³¤ÆÚ±£³Ö£¬Èç¹û¿ÉÄÜÎÒÃǶ¼Ê¹ÓÃȱʡÉèÖ᣽Ó×Å»áÌáʾÄãÊäÈëÄãµÄDNS·þÎñÆ÷ÐÅÏ¢£¬Õâ²½»á±à¼ÄãµÄ/etc/resolv.confÎļþ¡£Èç¹ûÄãÔÚ·þÎñÆ÷ÉÏÒÔ»º´æDNSģʽÔËÐÐBIND£¬¾Í²»ÓÃÊäÈëÖ±½Ó»Ø³µ¡£Èç¹ûÄãÏ£ÍûÄãµÄISPµÄDNS·þÎñÆ÷×Ô¶¯ÌṩIPµØÖ·£¬¾ÍÊäÈëµ¥´Êserver¡£½Ó׎ű¾»áÌáʾÄãÊäÈëÄãµÄISPÃÜÂ룬ȻºóËü»áѯÎÊÊÇ·ñÔÊÐí³£¹æÓû§£¨²»Êdz¬¼¶Óû§root£©¼¤»î/Í£Ö¹Õâ¸öеÄppp0É豸£¬Õâ¿ÉÄÜÊÇÐèÒªµÄ£¬Èç¹ûÄã¼ÒÀïÓзÇrootµÄ³ÉÔ±ÐèÒª·ÃÎÊInternetµÄ»°¡£½Ó×ÅÄã»á±»Ñ¯ÎÊÊÇ·ñÔÚÆô¶¯Ê±¼¤»îÁ¬½Ó£¬´ó²¿·ÖÈ˶¼»áÑ¡Ôñyes¡£ÔÚ×îºó£¬Ëü»á¸æËßÄãÓÃifup ppp0/ifdown ppp0À´¼¤»î/¹Ø±ÕÕâ¸öеÄppp0É豸£¬ÒÔ¼°ÓÃadsl-status /etc/sysconfig/network-scripts/ifcfg-ppp0À´»ñµÃÉ豸µÄ״̬¡£ÔÚÄãÍê³Érp-pppoeµÄÅäÖÃáᣬÄãÓ¦¸Ã¿ÉÒÔͨ¹ýDSLµÄDHCPÁ¬½Óµ½InternetÉÏ¡£
adsl-setup´´½¨µÄһЩÖØÒªÎļþ£ºÓÐÈý¸öadsl-setup½Å±¾´´½¨µÄÎļþÄã¿ÉÄÜ»á¸
Ïà¹ØÎĵµ£º
ÀýÒ»£º·¢ËÍSignaling Packet£º
Signaling CommandÊÇ2¸öBluetoothʵÌåÖ®¼äµÄL2CAP²ãÃüÁî´«Êä¡£ËùÒÔµÃSignaling CommandʹÓÃCID 0x0001.
¶à¸öCommand¿ÉÒÔÔÚÒ»¸öC-frame£¨control frame£©Öз¢ËÍ¡£
Èç¹ûÒªÖ±½Ó·¢ËÍSignaling Command.ÐèÒª½¨Á¢SOCK_RAWÀàÐ͵ÄL2CAPÁ¬½ÓSocket¡£ÕâÑù²ÅÓлú»á×Ô¼ºÌî³äCommand Code£¬Identi ......
Ò»
°ãÀ´Ëµ¶ÔÓÚÐèÒª´óÁ¿cpu¼ÆËãµÄ½ø³Ì£¬µ±Ç°¶ËѹÁ¦Ô½´óʱ£¬CPUÀûÓÃÂÊÔ½¸ß¡£µ«¶ÔÓÚI/OÍøÂçÃܼ¯Ð͵Ľø³Ì£¬¼´Ê¹ÇëÇóºÜ¶à£¬·þÎñÆ÷µÄCPUÒ²²»Ò»¶¨ºÜµ½£¬
ÕâʱµÄ·þÎñÆ¿¾±Ò»°ãÊÇÔÚ´ÅÅ̵ÄI/OÉÏ¡£±È½Ï³¤¼ûµÄ¾ÍÊÇ£¬´óÎļþƵ·±¶ÁдµÄcpu¿ªÏúԶСÓÚСÎļþƵ·±¶ÁдµÄ¿ªÏú¡£ÒòΪÔÚI/OÍÌÍÂÁ¿Ò»¶¨Ê±£¬Ð¡ÎļþµÄ¶Á
д¸ü¼ÓƵ·±£¬ÐèÒª¸ü¶àµÄc ......
¶ÔÓÚ½ø³ÌµÄÒ»Éú¿ÉÒÔÓÃһЩÐÎÏóµÄ±ÈÓ÷×÷Ò»¸öССµÄ×ܽ᣺
Ëæ×ÅÒ»¾äfork£¬Ò»¸öнø³ÌßÉßÉÂäµØ£¬µ«ËüÕâʱֻÊÇÀϽø³ÌµÄÒ»¸ö¿Ë¡¡£
È»ºóËæ×Åexec£¬Ð½ø³ÌÍÑÌ¥»»¹Ç£¬Àë¼Ò¶ÀÁ¢£¬¿ªÊ¼ÁËΪÈËÃñ·þÎñµÄÖ°ÒµÉúÑÄ¡£
ÈËÓÐÉúÀϲ¡ËÀ£¬½ø³ÌÒ²Ò»Ñù£¬Ëü¿ÉÒÔÊÇ×ÔÈ»ËÀÍö£¬¼´ÔËÐе½mainº¯ÊýµÄ×îºóÒ»¸ö”}”£¬´ÓÈݵØÀëÎÒÃǶøÈ¥£»Ò²¿ÉÒ ......
1. grep¼ò½é
grep £¨global search regular expression(RE) and print out the line,È«ÃæËÑË÷ÕýÔò±í´ïʽ²¢°ÑÐдòÓ¡³öÀ´£©ÊÇÒ»ÖÖÇ¿´óµÄÎı¾ËÑË÷¹¤¾ß£¬ËüÄÜʹÓÃÕýÔò±í´ïʽËÑË÷Îı¾£¬²¢°ÑÆ¥ÅäµÄÐдòÓ¡³öÀ´¡£UnixµÄgrep¼Ò×å°ü À¨grep¡¢egrepºÍfgrep¡£egrepºÍfgrepµÄÃüÁîÖ»¸úgrepÓкÜС²»Í¬¡£egrepÊÇgrepµÄÀ©Õ¹£¬Ö§³Ö¸ü¶ ......
Ò»°ãÀ´½²£¬Èç¹ûÄãÓÐÒ»¸öÓÐÏßµ÷Öƽâµ÷Æ÷»òÕßÊý×ÖÓû§Ïß·£¬Äã¾Í¿ÉÒÔʹÓüÒÀïµÄµçÄÔ»ñÈ¡ÓÉÄãµÄ·þÎñÌṩÉ̶¯Ì¬·ÖÅäµÄIPµØÖ·¡£Èç¹ûÔÚµ÷Öƽâµ÷Æ÷ºÍ±¾µØÍøÂçÖ®¼ä°²×°ÁËÓÐÏß/Êý×ÖÓû§Ïß·µÄ·ÓÉÆ÷£¬ÄãµÄµçÄÔºÜÓпÉÄÜÊÇÔÚÆô¶¯¹ý³ÌÖдÓ·ÓÉÆ÷»ñÈ¡ÁËIPµØÖ·¡£ÄãÒ²¿ÉÒÔÑ¡Ôñ½ûÓñ¾µØ·ÓÉÆ÷ÖÐDHCP·þÎñÆ÷µÄ¹¦ÄÜ£¬¶øÉèÖà ......