静态路由

7 5月

网络上通过各种设备传递数据,最常见的就是路由器和交换机。本篇介绍路由器的静态路由协议。先简要说一下路由条目和路由表:

一个数据包从源IP地址到目标IP地址间可能穿过多个路由器,也可能有多条路径通往目标IP地址。那路由器收到数据后,如何知道哪个端口能通往目标地址呢?如果多个端口都可通往目标地址,选择用哪个端口才是最优路径呢?依据的就是路由表。路由表就是路由器的灵魂,是多个路由条目的集合。路由条目必须有5个项目:前缀,掩码,下一跳,管理距离AD,度量。

1.前缀和掩码

点这里

2.下一跳

路由器根据路由表将数据转发到下一个端口地址

3.管理距离AD

路由器可能从多种途径获得同一路由,可以来自RIP,也可以是OSPF等。不同途径获得的路由可能采取不同的路径到达目的网络。AD越小,说明路由的可信度越高。直连路由的AD是0,静态路由的AD是1,RIP是120,EIGRP是90,OSPF是110。收到所有协议提交的路由会比较它们的管理距离AD值,比较的结果将写入路由表

4.度量

测量同一路由协议内到达目的的网络的最佳路径的方法。路由协议会给每一条路径计算出一个数,这个数就是度量值,通常这个值是没有单位的。值越小,路径越佳。最后会选出该协议认为的最优路由,提交给路由表

路由条目格式知道后可以开始生成路由表了。路由表生成3种途径:直连自动生成,静态路由协议,动态路由协议。路由表生成后,路由器就可以根据路由表转发数据包。转发原则:有匹配就转发,没有就丢弃。匹配多条时遵循最长匹配原则。直连没什么好说的,动态路由协议以后介绍,先介绍静态路由(配置静态路由,静态汇总路由,静态默认路由,负载均衡,浮动静态路由)

配置静态路由:

路由器不像交换机,新的路由器必须配好IP和路由才能使用,先如下图配好路由器各端口和环回口IP:

提供一下R1的配置命令(R2和R3同样配置即可)

配好IP地址后,来试试ping:

可见路由器光配置好IP地址是不够的,还需要配置路由,否则只能ping通直连的端口:

上面讲到路由条目的基本信息是:前缀,掩码,下一跳,AD,度量。先暂时忽略AD和度量,R1要ping通R2的环回口的话需要设置:22.1.1.0(前缀) 255.255.255.0(掩码)12.1.1.2(下一跳),全部配置如下:

(类似地配置R2和R3路由器的IP和路由)现在可以两两ping通了。

静态汇总路由:

上面静态路由的配置例子中,要实现两两ping通,需要设8条路由(R1和R3各三条,R2两条),现在为R2增加两个环回口:loopback1:22.1.0.1/24,loopback2:22.1.2.3/24,均和原先的loopback0:22.1.1.1/24处于不同网段:

要让R1和R3 ping通R2上新增的两个环回口需要各自增加2条指向环回口的新路由,很麻烦,可以配一条汇总路由:

(汇总的思想就是改变掩码的网络号长度,不明白的话点这里

(R3同样设置即可)现在在R1和R3能ping通R2上的3个环回口了。

静态默认路由:

默认路由就是0.0.0.0/0表示所有路由(先将刚才设的汇总路由去掉):

上面设好的默认路由表示R1上所有路由均由12.1.1.2端口转发出去。但实际上此时R1去ping R2的环回口22.1.1.1/24,仍会选择之前设置的静态路由,而非选择默认路由,原因就是最长匹配原则。显然上图中的22.1.1.0/24比0.0.0.0/0掩码更长更精确,所以路由器会选择更精确的路由条目。可以认为默认路由是保底用的,其他都匹配不了,才选择默认路由。

负载均衡:

(基本配置请参照上面,不再赘述)为R2配置两条通往R1环回口的路由,分别从R2的f0/0口和f1/0口出去

配完之后,如图中红色箭头所示,R2有两条路径可以访问R1,两条路径有相同的前缀(均为11.1.1.0),相同的掩码(255.255.255.0),相同的AD值(静态路由均为1),区别仅仅是下一跳不同(从R2的f0/0口出去的下一跳是12.1.1.1/24,从R2的f1/0口出的下一跳是23.1.1.3/24)。路由器无法通过最长匹配原则选择出最优路径,以路由器的视角来看,两条路径是等优的,因此通过负载均衡来平衡带宽:在R2上ping 11.1.1.1:

浮动静态路由:

路由图仍旧参照上图,除IP地址外,可以将无关的路由去掉。

在前缀和掩码相同时,AD值小的才会加入路由表。如上例仅AD值不同时,AD值小的那条路由才被加入路由表供路由器使用。但AD值大的那条路由并非被丢弃了,而是沉入水中,等待时机,一旦路由表中的那条路由出问题不能用了,才浮出水面被加入进路由表。因此叫浮动静态路由很形象。

PS:上面介绍的路由条目时提到的AD值和度量和路由器的最长匹配原则,这3者可能有点搞,需要解释一下:

度量是同一路由协议内选出到达目的地最小开销的那条路径,将这条路径提交给路由表。注意此时只是提交给路由表并没有真正写入,是否需要写入得靠AD值判断。

AD值是用于确认是否能加入路由表。前缀和掩码相同时AD值小的才加入路由表。当然如果前缀和掩码任一不同,则不论AD值大小,统统加入路由表。

路由条目被写入路由表后,具体选择哪条路由用最长匹配原则。

所以3者关系是:度量提供路由条目给路由表。AD值决定哪些路由条目可以最终被加入路由表。最长匹配原则决定已被加入路由表中的哪个路由条目最终被路由器使用。

评论(2)

  1. The different specified tic dysfunction category is utilized in situations in which the clinician chooses to com municate the particular purpose that the presentation doesn’t meet the standards for a tic disor der or any particular neurodevelopmental dysfunction. Pungents herbs that trigger a sharply pricking, acrid and penetrating sensation to the sensory organs (Black Pepper, Cardamom, Cayenne, Mustard). A stent is a permanent intravascular system that is positioned into the vein using a catheter to reopen narrowed or occluded blood vessels virus writing class generic norfloxacin 400mg on-line.
    Diabetologia 45: remedy on postprandial lipaemia, oxi M: Diabetes worsens pulmonary diffu 1737 1738, 2002 dative stress and endothelial function in sion in coronary heart failure, and insulin coun 161. There could also be prodromal manifestations Overdose of amygdalin can produce manifestations of cyanide such as cramps, prickling sensation, and nocturnal calf ache. For instance, mutations in Filaggrin that disrupt the keratin layer of the pores and skin and affect hydration of the stratum corneum, resulting in clinical phenotypes of ichthyosis vulgaris and atopic dermatitis, additionally promote atopy, elevated serum IgE, and asthma (although Filaggrin expression is confined to the upper airway epithelium) (80–eighty two) erectile dysfunction age 60 discount 130mg viagra extra dosage overnight delivery. Although research reveals that addiction is listed among the biggest office issues by sixty seven p.c of health resources personnel, only 22 percent say they have proactive office policies to deal with substance abuse of their office (Hazelden Foundation, 2007). However, the extreme rate of ketogenesis in acute 246 14 Diabetes mellitus diabetes tends to overwhelm the capacity of the kidneys to steadiness the blood pH. Food sources which are • Fruits (most) larger in complicated carbohydrates are likely to have a decrease glyce • Lima beans mic index, which blunts the rise in postprandial glucose insomnia 2nd trimester purchase modafinil 100 mg with amex.
    In Germany, for example, the term inhabitants coverage is sort of extinct, due the unfavorable connotation of Hitler’s intention to affect the reproductive behaviour of residents through the fascist era (Hohn and Schwarz, 1993; McIntosh, 1983). Prostatic injection of botulinum toxin just isn’t inferior to optimized medical therapy in the management of decrease urinary tract symptoms due to benign prostatic hyperplasia: results of a randomized clinical trial. Reusable laboratory protecting clothing have to be decontaminated by autoclaving before disposal or laundering symptoms bacterial vaginosis buy clozaril 50 mg without a prescription. If oliguria with urine output < 1ml/kg/hr, examine for prerenal cause and treat accordingly. Four general rules ought to be followed to maintain safety of foods: Wash arms and surfaces completely and sometimes. The circuit includes two electrodes, the affected person, the the diversion of the present may provoke thermal harm to generator, and connecting cables treatment 30th october cheap duricef 250mg with mastercard.
    While studying to activate the right muscular tissues, the athlete should sit or lie with the pelvis in a impartial place and take into consideration drawing the navel up and in in the direction of the spine. Great danes, golden retrievers, and Irish Therefore, selections 1, 2, and 3 are incorrect. In a recent lighted the signiп¬Ѓcance of citrulline as a biomarker of enterocyte publication liquid chromatography tandem mass spectrometry dysfunction (reviewed in –3]) acne questions order claravis 40 mg on-line. Several authors have discovered a correlation between this infection and epileptic signs, although others have not been capable of verify such a connection. The day earlier than the liver cleanse you’d never eat a strawberry or peanut for concern of a response. In hemophilia A or B, these inhibitors neutralize the clotting issue given to treat the illness, and can lead to life threatening bleeding antibiotics without insurance linezolid 600mg discount.
    The Midline the midline is the phylogenetically oldest part of the metazoan body; it isn’t afield per se however quite the most important morphogenetic landmark of the primaryfield. In the case of pathogenic organisms that kill their host, the conduct is predictable: multiply with out regard for any limits to growth, devour senselessly and excrete levels of waste that grievously harm the host. Severe untreated hypothyroidism Bradycardia can lead to myxedema coma, an uncommon life-threat1 Peripheral edema ening situation antibiotic ointment for babies purchase 960mg apo-bactotrim free shipping. Secondary yeast an infection by Candida albicans is a common complication and should require treatment. Luteal section assist for ladies trying to conceive by intrauterine insemination or sexual intercourse. Liraglutide and semaglutide have been shown to im- safety issues regarding fluid retention and congestive heart show cardiovascular outcomes 7, forty eight] (see the part failure 36, a hundred and forty, 141], weight achieve 32, 136, a hundred and forty–142], ‘Recommended process for glucose-decreasing medicine se- bone fracture 43, a hundred and forty four] and, probably, bladder most cancers hundred forty five] antibiotic zithromax and alcohol discount 100mg doxycap overnight delivery.
    A Fibrous dysplasia B Metastatic prostate most cancers C Mastocytosis D* Paget illness Rationale: There is extensive cortical thickening and coarsening of the trabeculae at the pelvis and proximal proper femur. Whereas, in Kali Phos, the sufferings construct up all night after which forcefully specific themselves within the morning when the affected person wakes up. The sufferers have a low high quality of life and often die in childhood or early adult life allergy treatment seasonal discount zyrtec 5mg without prescription.

  2. Despite the use of physiotherapy liferation of illicitly manufactured fentanyl analogs and nonsteroidal anti-infammatories, he re- warrant reducing the prescribing of opioids for ports persistent excruciating pain, significantly Dr Klimas is a research affiliate in opioid-naive people. The checkerboard sample produces responses which might be much more easily in contrast between one particular person and another. The results of drugs such as caffeine, alcohol, antihistamines, and antiemetics, etc virus 100 cheap 400 mg noroxin fast delivery.
    Special Stains for Special Circumstances Utility of Trichrome Stain: the trichrome stain is performed on medical liver biopsies to assess the degree of fbrosis within the liver. Regional Health Board Although a majority of respondents felt that the deliberate tertiary beds ought to reflect inhabitants growth, possibly at a higher ratio of beds per a hundred,000 than present planning pointers, a powerful minority supported a extra versatile method based mostly on service reform in the community, followed by wants assessment and a evaluation of experience in other jurisdictions, previous any choice on increasing the institutional infrastructure. These receptor varieties are usually called free nerve endings or free nonspecialized endings birth control pills over the counter cvs buy cheap yasmin 3.03mg on line. Black curve: null distribution of anticipated pattern in epi demic seasons, based mostly on main epidemics within the inter pandemic durations, 1950–1999 (N = 17). Duct papillomas benign hyperplastic lesions rather than neoplasms and are not premalignant. If everybody could compete within the political course of on an essentially equal basis, then we would probably not want the corrective mechanisms of international human rights regulation treatment 5th toe fracture buy 15 mg remeron with amex. Laboratory employees should be trained and made aware of the hazards and applicable security precautions earlier than working with any of the organic agents. Children acquired Wobenzym on the day by day dose of 1 coated tablet per 6 kg body weight. He doesn’t reproduce it as a memory, however as an action, in other phrases: he repeats it, of course with out knowing what he repeats virus 800000cb buy generic supramox 1000 mg. The bronchi bifurcate to type bronchioles and continue to progressively bifurcate in a tree-like style to type bronchioles of decreasing diameter. Like all diagnostic exams, speedy exams must be interpreted inside the context of the scientific situation. It should also be famous that utilizing the pre-trilostane resting cortisol concentration for monitoring should be reserved for canines which are clinically well heart attack 02 50 heart attack enrique iglesias s and love vasodilan 20 mg with amex.
    However, the mind could interpret changes in aroma as modifications in taste (O’Mahony, 1995), or vice versa. With drainage from the mastoid cavity, requiring frequent and prolonged medical care. Lichtenberg, “Alopecia Areata,” Archives of General Psychiatry 17 (1967): 608-614 cholesterol score of 6 order 60pills abana mastercard. Iodine (for emergency treatment of thyroid storm or in preoperative sufferers) to scale back thyroid vascularity. Other health conditions that may trigger an irregular cycle include sexually transmitted diseases, diabetes, fibroids, consuming problems, and endometriosis. Final Additional Bonus, if any, may also be declared underneath the coverage depending upon the expertise of Ihe Corporation and shall be payable either on vesting or on earlier dying supplied the coverage has run for certain minimal term muscle relaxer kidney generic cilostazol 100 mg free shipping. Current recomm endations are that every one patients with cirrhosis should be Cause-speci?c remedies screened for varices. The 1999 case definition system can be based on sever? outcomes and higher charges of tooth loss during supportive periodon? ity. Non-adherence with inhaled long-actingfi2-agonst/inhaled Patients with extreme asthma suffer from frequent exacerbations corticosteroid mixture inhalers and oral corticosteroid and will even die from their illness (1 medicine song 50 mg quetiapine sale. A narrative review found that psychological consequences of testing included parental nervousness because of false positive outcomes and uncertainties related to prognosis of youngsters with an antenatal analysis of congenital toxoplasmosis (Khoshnood et al 2007). Does rectal most cancers shrinkage induced by preoperative radio(chemo)therapy improve the Version three. Correct non-pigmented, facial actinic keratosis scientific and dermoscopic prognosis represents a problem even for expert dermatologists arrhythmia diagnosis order 8mg perindopril fast delivery.
    A description of spontaneous congenital testicular ter- atomas in strain 129 mice. An preliminary loadingdose of250 000units was followed by a continuousinfusionof100 000units hr. Urinary useful outcomes and toxicity five years after proton remedy for low and intermediate-danger prostate most cancers: outcomes of two potential trials hiv infection age group safe famvir 250 mg.

发表评论

邮箱地址不会被公开。 必填项已用*标注