靜态路由是這樣的一種路由,它通過人工輸入到路由選擇表中。
二、靜态路由優點1、不需要動态路由選擇協議,這減少了路由器的日常開銷。
2、在小型互連網絡上很容易配置。
3、可以控制路由選擇。
三、靜态路由配置
五台路由器,劃分成三個網段;要求使用靜态路由協議,使得路由器之間能夠互相通信
幀中繼僅了解即可,不作為掌握技術。重點掌握靜态路由配置。
1、R1配置:
R1#sh run
Building configuration...
Current configuration : 743 bytes
!
version 12.2
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname R1
!
!
ip subnet-zero
no ip domain-lookup
!
!
!
!
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface Ethernet0
ip address 172.16.1.1 255.255.255.0
!
interface Ethernet1
no ip address
shutdown
!
interface Serial0
no ip address
shutdown
!
interface Serial1
ip address 172.16.2.1 255.255.255.0
encapsulation frame-relay
frame-relay map ip 172.16.2.3 103 broadcast
frame-relay map ip 172.16.2.5 105 broadcast
no frame-relay inverse-arp
!
ip classless
ip route 172.16.3.0 255.255.255.0 172.16.2.3
no ip http server
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
End
R2#sh run
Building configuration...
Current configuration:
!
version 12.0
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname R2
!
!
ip subnet-zero
no ip domain-lookup
!
!
!
!
interface Loopback0
ip address 2.2.2.2 255.255.255.255
no ip directed-broadcast
!
interface Ethernet0
ip address 172.16.1.2 255.255.255.0
no ip directed-broadcast
!
interface Ethernet1
no ip address
no ip directed-broadcast
shutdown
!
interface Serial0
no ip address
no ip directed-broadcast
shutdown
!
interface Serial1
no ip address
no ip directed-broadcast
shutdown
!
no ip http server
ip classless
ip route 172.16.2.0 255.255.255.0 172.16.1.1
ip route 172.16.3.0 255.255.255.0 172.16.1.1
!
!
line con 0
exec-timeout 0 0
logging synchronous
transport input none
line aux 0
line vty 0 4
!
End
R3#sh run
Building configuration...
Current configuration:
!
version 12.0
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname R3
!
!
!
!
!
!
ip subnet-zero
no ip domain-lookup
!
cns event-service server
!
!
!
!
!
interface Loopback0
ip address 3.3.3.3 255.255.255.255
no ip directed-broadcast
!
interface Ethernet0
no ip address
no ip directed-broadcast
shutdown
!
interface Serial0
ip address 172.16.3.3 255.255.255.0
no ip directed-broadcast
encapsulation ppp
!
interface Serial1
ip address 172.16.2.3 255.255.255.0
no ip directed-broadcast
encapsulation frame-relay
frame-relay map ip 172.16.2.5 301 broadcast
frame-relay map ip 172.16.2.1 301 broadcast
no frame-relay inverse-arp
!
ip classless
ip route 172.16.1.0 255.255.255.0 172.16.2.1
no ip http server
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
transport input none
line aux 0
line vty 0 4
!
End
R4#sh run
Building configuration...
Current configuration : 798 bytes
!
version 12.1
no service single-slot-reload-enable
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname R4
!
logging rate-limit console 10 except errors
!
ip subnet-zero
no ip finger
no ip domain-lookup
!
cns event-service server
!
!
!
!
!
interface Loopback0
ip address 4.4.4.4 255.255.255.255
!
interface Ethernet0
no ip address
shutdown
!
interface Serial0
no ip address
shutdown
!
interface Serial1
ip address 172.16.3.4 255.255.255.0
encapsulation ppp
clockrate 64000
!
ip kerberos source-interface any
ip classless
ip route 172.16.1.0 255.255.255.0 172.16.3.3
ip route 172.16.2.0 255.255.255.0 172.16.3.3
no ip http server
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
transport input none
line aux 0
line vty 0 4
!
End
R5#sh run
Building configuration...
Current configuration:
!
version 12.1
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname R5
!
!
!
!
!
!
ip subnet-zero
no ip domain-lookup
!
cns event-service server
!
!
!
interface Loopback0
ip address 5.5.5.5 255.255.255.255
!
interface Ethernet0
no ip address
shutdown
!
interface Serial0
no ip address
shutdown
!
interface Serial1
ip address 172.16.2.5 255.255.255.0
encapsulation frame-relay
frame-relay map ip 172.16.2.3 501 broadcast
frame-relay map ip 172.16.2.1 501 broadcast
no frame-relay inverse-arp
!
ip classless
ip route 172.16.1.0 255.255.255.0 172.16.2.1
ip route 172.16.3.0 255.255.255.0 172.16.2.3
no ip http server
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
transport input none
line aux 0
line vty 0 4
總結:靜态路由配置非常簡單,就像地圖一樣需要管理員手動進行繪制,路由目的地及下一跳,可以理解為到達目的地就必須要到達下一站才能逐跳達到。經過的每一跳路由器都都必須有到達目标的路由和下一跳地址。
,更多精彩资讯请关注tft每日頭條,我们将持续为您更新最新资讯!