Linux iptables ¶Ë¿Ú Ó³Éä°¸Àý
iptablesÊÇÒ»¸ö
Linux
ÏÂÓÅÐãµÄnat+·À»ðǽ¹¤¾ß£¬ÎÒʹÓøù¤¾ßÒԽϵÍÅäÖõĴ«Í³pcÅäÖÃÁËÒ»¸ö
Áé»îÇ¿¾¢µÄ·À»ðǽ+natϵ
ͳ,СÓÐÐĵ㬿´
ÁËÍøÉÏÒ²ÓкܶàÕâ·½ÃæµÄÎÄÕ£¬µ«ÊÇËƺõҪô˵µÄ±È½ÏÉÙ£¬ÒªÃ´¾ÍÊDZȽÏÆ«£¬ÄÚÈݲ»È«£¬ÈÝÒ×Îóµ¼£¬ÎÒÑо¿ÁËÒ»¶Îʱ¼äµÄiptablesͬʱҲÓÃÁ˺ܾã¬ÓеãµÎ
¾Ñ飬дÀ´¹©´ó¼Ò²Î¿¼£¬Í¬Ê±Ò²±¸ÈÕºó×Ô¼º·ÔÄ¡£
Ê×ÏÈҪ˵Ã÷µÄÊÇ£¬iptables²Ù×÷µÄÊÇ2.4ÒÔÉÏÄں˵Änetfilter.ËùÒÔÐèÒª linuxµÄÄÚºËÔÚ2.4ÒÔÉÏ¡£Æ书ÄÜÓ밲ȫÐÔÔ¶Ô¶±ÈÆäÇ°±²
ipfwadm,ipchainsÇ¿´ó£¬iptables´óÖÂÊǹ¤×÷ÔÚOSIÆß²ãµÄ¶þ¡¢Èý¡¢ËIJ㣬ÆäÇ°±²ipchains
²»Äܵ¥¶ÀʵÏÖ¶Ôtcp/udp
portÒÔ¼°¶ÔmacµØÖ·
µÄ
µÄ¶¨ÒåÓë²Ù×÷£¬ËùÒÔÎÒÏëipchainsÓ¦¸ÃÊǽö½ö¹¤×÷ÔÚÈý²ãÉϵġ£
ÎÒÃÇ
Ïȼòµ¥½éÉÜÒ»ÏÂ
netfilterµÄ´óÖ¹¤×÷Á÷³Ì£¬Ò²¾ÍÊÇÒ»¸öÊý¾Ý°ü£¨»òÕ߽зÖ×é¡¢packet,ÎÒ¸öÈËÏ°¹ß½Ð°ü£©ÔÚµ½´ïlinuxµÄÍøÂç½Ó¿ÚµÄʱºò
£¨Íø¿¨£©ÈçºÎ´¦ÀíÕâ¸ö°ü£¬È»ºóÔÙ½éÉÜÒ»ÏÂÈçºÎÓÃiptables¸Ä±ä»òÕß˵¿ØÖƶÔÕâ¸öÊý¾Ý°ü½øÐвÙ×÷¡£netfilterÄÚ²¿·ÖΪÈý¸ö±í£¬·Ö±ðÊÇ
filter,nat,mangle£¬Ã¿¸ö±íÓÖÓв»Í¬µÄ²Ù×÷Á´£¨Chains£©¡£ÔÚfilter£¨¹ýÂË£©±íÖУ¬Ò²¾ÍÊÇËûµÄ·À»ðǽ¹¦ÄܵÄÕâ¸ö±í£¬¶¨ÒåÁËÈý¸ö
Chain¡£·Ö±ðÊÇINPUT,FORWARD,OUTPUT¡£Ò²¾ÍÊǶ԰üµÄÈ롢ת·¢¡¢³ö½øÐж¨ÒåµÄÈý¸ö¹ýÂËÁ´¡£¶ÔÓÚÕâ¸öfilter±íµÄ²Ù×÷ºÍ¿ØÖÆÒ²ÊÇ
ÎÒÃÇ
ʵÏÖ·À»ðǽ¹¦ÄܵÄÒ»¸ö
ÖØÒªÊֶΣ»ÔÚnat(Network Address
Translation¡¢ÍøÂçµØÖ··Òë)±íÖУ¬Ò²¾ÍÊÇÎÒÃÇÓÃÒÔʵÏÖµØַת»»ºÍ¶Ë¿Úת·¢¹¦ÄܵÄÕâ¸ö±í£¬¶¨ÒåÁËPREROUTING,
POSTROUTING,OUTPUTÈý¸öÁ´,ÏÂÃæÎÒÃÇ»á¶ÔÕâÈý¸öÁ´×÷ÏêϸµÄ˵Ã÷£»¶ønetfilterµÄmangle±íÔòÊÇÒ»¸ö×Ô¶¨Òå±í£¬ÀïÃæ°üÀ¨ÉÏÃæ
µÄfilterÒÔ¼°nat±íÖеĸ÷ÖÖchains,Ëü¿ÉÒÔÈÃÎÒÃǽøÐÐһЩ×Ô¶¨ÒåµÄ²Ù×÷£¬Í¬Ê±Õâ¸ömangle±íÖеÄchainsÔÚnetfilter¶Ô°ü
µÄ´¦ÀíÁ÷³ÌÖд¦ÔÚÒ»¸ö±È½ÏÓÅÏȵÄλÖã¬ÏÂÃæÓÐÒ»ÕÅͼÇåÎúµÄÃè»æÁËnetfilter¶Ô°üµÄ´¦ÀíÁ÷³Ì£¨¸Ãͼժ×ÔÍøÉÏ£¬²»Öª×÷ÕßÊÇË£¬ÔÚ´ËÉî±í¾´Ò⣡£©£¬Ò»°ã
Çé¿öÏ£¬ÎÒÃÇÓò»µ½Õâ¸ömangle±í£¬ÔÚÕâÀïÎÒÃǾͲ»×ö½éÉÜÁË¡£
´ó¼Ò¿ÉÒÔ¿´µ½£¬PREROUTINGÕâ¸öchainÔÚ×îÇ°Ã棬µ±Ò»¸ö°üÀ´µ½linuxµÄÍøÂç½Ó¿ÚµÄʱºòÏȹýmangleµÄPREROUTING,È»ºóÊÇ
natµÄPREROUTING,´ÓÕâ¸öchainµÄÃû×ÖÎÒÃÇ¿ÉÒÔ¿´³ö£¬Õâ¸öchainÊÇÔÚ·ÓÉ֮ǰ(pre-routing)Òª¹ýµÄ¡£ÎªÊ²Ã´ÒªÔÚ·ÓÉ֮ǰ
¹ýÄØ£¿´ó¼Ò¿ÉÒÔ¿´µ½Õâ¸öͼÉÏ£¬ÉÏÃæÓÐÒ»¸öÁâÐεIJ¿·Ö½ÐROUTING,Õâ¸öROUTING²¿·Ö¾ÍÊÇLinuxµÄroute
Ïà¹ØÎĵµ£º
½ñÌìµÄÊÂÌ«¶à£¬Ã»ÓÐÈÏÕæµÄÍê³ÉÈÎÎñ£¬²»¹ý°Ñ·þÎñÆ÷¶ËµÄÎļþ´«Êä×öºÃÁË£¡
Ã÷Ìì°Ñ·þÎñÆ÷¶ËµÄ´úÂ뼯³ÉÆðÀ´²âÊÔһϣ¬²¢°ÑÍøÂç¿Í»§¶Ë³ÌÐò×öºÃ£¡
°Ñ´úÂëÌù³öÀ´°É£¡±ãÓÚ±£´æ£¡
Í·Îļþ£ºserver_udpsocket.h
#ifndef _SERVER_UDPSOCKET_H_
#define _SERVER_UDPSOCKET_H_
#include <stdio.h>
#include <stdlib.h>
......
ÔÚfedoraϽâѹ.debÎļþ(û°²×°dpkg):
ar p filename.deb data.tar.gz | tar zxvf -
ÆäËüѹËõÎļþµÄ½âѹ
#tar xv file.a
#uncompress file.Z
#gunzip file.gz
#bunzip2 file.bz2
#tar xvZf file.tar.Z
#compress -dc file.tar.Z | tar xvf -
#tar xvzf file.tar.gz
#gzip -dc file.tar.gz | tar ......
±¾ÎÄÏêϸ½éÉÜÈçºÎ±àдһ¸öÏÔ¿¨µÄÇý¶¯³ÌÐò¡£
framebuffer
deviceÔÚÄÚºËÀïÃæ×÷ΪÏÔ¿¨Çý¶¯Ä£ÐÍ£¬Ðí¶àº¯ÊýºÍÊý¾Ý½á¹¹¶¼ÊÇÌض¨£¬ÕýÊÇÕâЩÌض¨µÄ¶«Î÷ΪÎÒÃǵıà³ÌÌṩÁË·½±ã¡£
Òª¿ª·¢frame buffer
deviceÇý¶¯£¬ÄãÓ¦¸ÃÔĶÁSource\Source\Documentation\fbÏÂÃæµÄ˵Ã÷Îļþ£¬Èý¸öÖØÒªÎļþ00-
INDEX£¬framebuffer.txt£¬internal ......
1. ´ÓÓ²ÅÌ°²×°linuxµÄѧϰ£¬ºÍʵÑé Done
Use wingrub, install the Ubuntu on /dev/sda2. and could boot!
2. pppoe connection &nbs ......
¹ØÓÚ×ÔÐýËøÓ÷¨½éÉܵÄÎÄÕ£¬ÒѾÓкܶ࣬µ«ÓÐЩϸ½ÚµÄµØ·½µãµÄ»¹²»¹»Í¸¡£ÎÒÕâÀï¾Í°ÑÎÒ¸öÈËÈÏΪ´ó¼ÒÈÝÒ×ÓÐÒÉÎʵĵط½ÄóöÀ´ÌÖÂÛһϡ£
Ò»¡¢×ÔÐýËø£¨spinlock£©¼ò½é
×ÔÐýËøÔÚͬһʱ¿ÌÖ»Äܱ»×î¶àÒ»¸öÄÚºËÈÎÎñ³ÖÓУ¬ËùÒÔÒ»¸öʱ¿ÌÖ»ÓÐÒ»¸öÏß³ÌÔÊÐí´æÔÚÓÚÁÙ½çÇøÖС£Õâµã¿ÉÒÔÓ¦ÓÃÔڶദÀí»úÆ÷¡¢»òÔËÐÐÔÚµ¥´¦ÀíÆ÷ÉϵÄÇ ......