- 論壇徽章:
- 2
|
本帖最后由 anonym0us 于 2016-03-27 17:23 編輯
無標(biāo)題.png (19.53 KB, 下載次數(shù): 62)
下載附件
2016-03-27 17:23 上傳
- 靜態(tài)路由:
- 首先配置R1 R2 R3的基本配置,為相應(yīng)的接口配置合理的IP 地址。同一根網(wǎng)線上連接的兩個(gè)路由器,要配置相同的網(wǎng)絡(luò)位,不同的主機(jī)位因?yàn)樗麄兪俏挥谕粋(gè)網(wǎng)絡(luò)的不同設(shè)備。
- R1配置:
- Router>enable
- Router#configure terminal
- Router(config)#line console 0
- Router(config-line)#exec-timeout 0 0
- Router(config-line)#logging synchronous
- Router(config-line)#exit
- Router(config)#no ip domain-lookup
- Router(config)#ho R1
- R1(config)#interface loopback 0
- R1(config-if)#ip address 1.1.1.1 255.255.255.255
- R1(config-if)#no shutdown
- R1(config-if)#exit
- R1(config)#interface loopback 1
- R1(config-if)#ip address 1.1.2.1 255.255.255.255
- R1(config-if)#no shutdown
- R1(config-if)#exit
- R1(config)#interface loopback 2
- R1(config-if)#ip address 1.1.3.1 255.255.255.255
- R1(config-if)#no shutdown
- R1(config-if)#exit
- R1(config)#interface loopback 3
- R1(config-if)#ip address 1.1.4.1 255.255.255.255
- R1(config-if)#no shutdown
- R1(config-if)#exit
- R1(config)#interface f0/0
- R1(config-if)#ip address 12.1.1.1 255.255.255.0
- R1(config-if)#no shutdown
- R1(config-if)#exit
- R2配置:
- Router>enable
- Router#config terminal
- Router(config)#line console 0
- Router(config-line)#exec-timeout 0 0
- Router(config-line)#logging synchronous
- Router(config-line)#exit
- Router(config)#no ip domain-lookup
- Router(config)#ho R2
- R2(config)#interface f0/0
- R2(config-if)#ip address 12.1.1.2 255.255.255.0
- R2(config-if)#no shutdown
- R2(config-if)#exit
- R2(config)#interface f0/1
- R2(config-if)#ip address 23.1.1.2 255.255.255.0
- R2(config-if)#no shutdown
- R2(config-if)#exit
- R2(config)#interface loopback 0
- R2(config-if)#ip address 2.2.2.2 255.255.255.255
- R2(config-if)#no shutdown
- R2(config-if)#exit
- R3配置:
- Router>enable
- Router#config terminal
- Router(config)#line console 0
- Router(config-line)#exec-timeout 0 0
- Router(config-line)#logging synchronous
- Router(config-line)#exit
- Router(config)#no ip domain-lookup
- Router(config)#ho R3
- R3(config)#interface f0/1
- R3(config-if)#ip address 23.1.1.3 255.255.255.0
- R3(config-if)#no shutdown
- R3(config-if)#exit
- R3(config)#interface lo0
- R3(config-if)#ip address 3.3.3.3 255.255.255.255
- R3(config-if)#no shutdown
- R3(config-if)#exit
- 接下來在R1 R2 R3上配置靜態(tài)路由,由于一個(gè)路由器的接口配置了IP 地址之后,對(duì)于路由器而言,就產(chǎn)生了到達(dá)該網(wǎng)絡(luò)的路徑,就是我們所說的直連路徑。因此我們僅僅需要配置到達(dá)網(wǎng)絡(luò)中其他地方(非直連)網(wǎng)絡(luò)的路徑即可。
- R1配置:
- 對(duì)于R1而言直連路經(jīng)就是路由表中打C 標(biāo)記的路由,而2.2.2.2/32,3.3.3.3/32,23.1.1.0/24
- 這幾條路徑R1的路由表中沒有(這些是非直連路徑),因此需要針對(duì)這幾條路徑進(jìn)行配置.
- R1#sho ip route
- Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
- D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
- N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
- E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
- i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
- * - candidate default, U - per-user static route, o - ODR
- P - periodic downloaded static route
- Gateway of last resort is not set
- 1.0.0.0/32 is subnetted, 4 subnets
- C 1.1.1.1 is directly connected, Loopback0
- C 1.1.2.1 is directly connected, Loopback1
- C 1.1.3.1 is directly connected, Loopback2
- C 1.1.4.1 is directly connected, Loopback3
- 12.0.0.0/24 is subnetted, 1 subnets
- C 12.1.1.0 is directly connected, FastEthernet0/0
- R1#
- 要去哪里----目標(biāo)IP地址和掩碼
- R1(config)#ip route 3.3.3.3 255.255.255.255 12.1.1.2 有誰幫我把數(shù)據(jù)轉(zhuǎn)發(fā)到目的地---下一跳地址
- R1(config)#ip route 23.1.1.0 255.255.255.0 12.1.1.2
- R1(config)#ip route 2.2.2.2 255.255.255.255 f0/0 要去那里,該從那個(gè)接口把數(shù)據(jù)發(fā)出去—出接口
- R2配置:
- 對(duì)于R2而言 只有 1.1.1.1-----1.1.2.1----1.1.3.1----1.1.4.1以及3.3.3.3 是不直接相連的(非直連),因此只需要針對(duì)這些網(wǎng)段寫靜態(tài)路由就可以了,對(duì)于1.1.1.1----1.1.4.1的這四條路徑,可以用匯總的方式,以一條命令去完成對(duì)于四條命令的匹配.---進(jìn)行匯總.同時(shí)注意,匯總的時(shí)候,有可能將1.1.5.1等等不存在的網(wǎng)段也匯總進(jìn)去了,因此注意,在R1上(應(yīng)為匯總的1.1.1.1—1.1.4.1 是R1上的路徑)部署黑洞路由.
- R2(config)#ip route 1.1.0.0 255.255.248.0 12.1.1.1
- R2(config)#ip route 3.3.3.3 255.255.255.255 23.1.1.3
- R1配置:
- R1(config)#ip route 1.1.0.0 255.255.248.0 null 0
- R3配置:
- 在R3上 我們可以認(rèn)為R3上網(wǎng)絡(luò)的終點(diǎn),因此對(duì)于R3而言,到網(wǎng)絡(luò)的任意一點(diǎn),都可以被缺省路由匹配.
- R3(config)#ip route 0.0.0.0 0.0.0.0 23.1.1.2
- 檢查路由表,看看路徑是否都齊全.
- R1 R2 R3要有到達(dá) 1.1.1.1—1.1.2.1---1.1.3.1---1.1.4.1以及12.1.1.0/24;23.1.1.0/24;
- 2.2.2.2/32;3.3.3.3/32的路徑.
- R1配置:
- R1#sho ip route
- Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
- D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
- N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
- E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
- i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
- * - candidate default, U - per-user static route, o - ODR
- P - periodic downloaded static route
- Gateway of last resort is not set
- 1.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
- S 1.1.0.0/21 is directly connected, Null0
- C 1.1.1.1/32 is directly connected, Loopback0
- C 1.1.2.1/32 is directly connected, Loopback1
- C 1.1.3.1/32 is directly connected, Loopback2
- C 1.1.4.1/32 is directly connected, Loopback3
- 2.0.0.0/32 is subnetted, 1 subnets
- S 2.2.2.2 is directly connected, FastEthernet0/0
- 3.0.0.0/32 is subnetted, 1 subnets
- S 3.3.3.3 [1/0] via 12.1.1.2
- 12.0.0.0/24 is subnetted, 1 subnets
- C 12.1.1.0 is directly connected, FastEthernet0/0
- 23.0.0.0/24 is subnetted, 1 subnets
- S 23.1.1.0 [1/0] via 12.1.1.2
- R2配置:
- R2#sho ip route
- Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
- D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
- N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
- E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
- i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
- * - candidate default, U - per-user static route, o - ODR
- P - periodic downloaded static route
- Gateway of last resort is not set
- 1.0.0.0/21 is subnetted, 1 subnets
- S 1.1.0.0 [1/0] via 12.1.1.1
- 2.0.0.0/32 is subnetted, 1 subnets
- C 2.2.2.2 is directly connected, Loopback0
- 3.0.0.0/32 is subnetted, 1 subnets
- S 3.3.3.3 [1/0] via 23.1.1.3
- 12.0.0.0/24 is subnetted, 1 subnets
- C 12.1.1.0 is directly connected, FastEthernet0/0
- 23.0.0.0/24 is subnetted, 1 subnets
- C 23.1.1.0 is directly connected, FastEthernet0/1
- R3配置:
- R3#sho ip rou
- Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
- D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
- N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
- E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
- i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
- * - candidate default, U - per-user static route, o - ODR
- P - periodic downloaded static route
- Gateway of last resort is 23.1.1.2 to network 0.0.0.0
- 3.0.0.0/32 is subnetted, 1 subnets
- C 3.3.3.3 is directly connected, Loopback0
- 23.0.0.0/24 is subnetted, 1 subnets
- C 23.1.1.0 is directly connected, FastEthernet0/1
- S* 0.0.0.0/0 [1/0] via 23.1.1.2
復(fù)制代碼 |
|